2 #include "typedefs.hpp"
3 #include <openrave/openrave.h>
11 virtual void SetDOFValues(
const DblVec& dofs) = 0;
12 virtual void GetDOFLimits(DblVec& lower, DblVec& upper)
const = 0;
13 virtual DblVec GetDOFValues() = 0;
14 virtual int GetDOF()
const = 0;
15 virtual OpenRAVE::EnvironmentBasePtr GetEnv() = 0;
16 virtual DblMatrix PositionJacobian(
int link_ind,
const OR::Vector& pt)
const = 0;
17 virtual DblMatrix RotationJacobian(
int link_ind)
const = 0;
18 virtual bool DoesAffect(
const KinBody::Link& link) = 0;
19 virtual vector<OpenRAVE::KinBodyPtr> GetBodies() = 0;
20 virtual std::vector<KinBody::LinkPtr> GetAffectedLinks() = 0;
21 virtual void GetAffectedLinks(std::vector<KinBody::LinkPtr>& links,
bool only_with_geom, vector<int>& link_inds) = 0;
22 virtual DblVec RandomDOFValues() = 0;
27 typedef boost::shared_ptr<Saver> SaverPtr;
33 parent->SetDOFValues(dofvals);
37 virtual SaverPtr Save() {
43 typedef boost::shared_ptr<Configuration> ConfigurationPtr;
50 RobotAndDOF(OR::KinBodyPtr _robot,
const IntVec& _joint_inds,
int _affinedofs=0,
const OR::Vector _rotationaxis=OR::Vector(0,0,1)) :
51 robot(_robot), joint_inds(_joint_inds), affinedofs(_affinedofs), rotationaxis(_rotationaxis) {}
53 void SetDOFValues(
const DblVec& dofs);
54 void GetDOFLimits(DblVec& lower, DblVec& upper)
const;
55 DblVec GetDOFValues();
57 virtual OpenRAVE::EnvironmentBasePtr GetEnv() {
return robot->GetEnv();};
58 IntVec GetJointIndices()
const {
return joint_inds;}
59 DblMatrix PositionJacobian(
int link_ind,
const OR::Vector& pt)
const;
60 DblMatrix RotationJacobian(
int link_ind)
const;
61 OR::RobotBasePtr GetRobot()
const {
return boost::dynamic_pointer_cast<RobotBase>(robot);}
62 virtual vector<OpenRAVE::KinBodyPtr> GetBodies();
63 bool DoesAffect(
const KinBody::Link& link);
64 std::vector<KinBody::LinkPtr> GetAffectedLinks();
65 void GetAffectedLinks(std::vector<KinBody::LinkPtr>& links,
bool only_with_geom, vector<int>& link_inds);
66 DblVec RandomDOFValues();
69 OpenRAVE::KinBody::KinBodyStateSaver saver;
70 RobotSaver(OpenRAVE::KinBodyPtr robot) : saver(robot) {}
75 void SetRobotActiveDOFs();
78 OpenRAVE::KinBodyPtr robot;
81 OR::Vector rotationaxis;
83 typedef boost::shared_ptr<RobotAndDOF> RobotAndDOFPtr;