Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef JOINT_TRAJECTORY_PT_H_
00026 #define JOINT_TRAJECTORY_PT_H_
00027
00028 #include <vector>
00029 #include "descartes_core/trajectory_pt.h"
00030
00031 namespace descartes_trajectory
00032 {
00033
00037 struct TolerancedJointValue
00038 {
00039 TolerancedJointValue(double nominal, double lower, double upper)
00040 : nominal(nominal), lower(lower), upper(upper)
00041 {}
00042
00043 TolerancedJointValue(double nominal)
00044 : nominal(nominal), lower(nominal), upper(nominal)
00045 {}
00046
00047 double range() const
00048 {
00049 return upper - lower;
00050 }
00051
00052 double nominal, lower, upper;
00053 };
00054
00067 class JointTrajectoryPt: public descartes_core::TrajectoryPt
00068 {
00069 public:
00070 EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
00071 public:
00076 JointTrajectoryPt(const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00077
00084 JointTrajectoryPt(const std::vector<TolerancedJointValue> &joints, const descartes_core::Frame &tool,
00085 const descartes_core::Frame &wobj,
00086 const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00087
00088
00093 JointTrajectoryPt(const std::vector<TolerancedJointValue> &joints,
00094 const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00095
00096
00101 JointTrajectoryPt(const std::vector<double> &joints,
00102 const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00103
00104 virtual ~JointTrajectoryPt() {};
00105
00110
00111 virtual bool getClosestCartPose(const std::vector<double> &seed_state,
00112 const descartes_core::RobotModel &model, Eigen::Affine3d &pose) const;
00113
00114
00115 virtual bool getNominalCartPose(const std::vector<double> &seed_state,
00116 const descartes_core::RobotModel &model, Eigen::Affine3d &pose) const;
00117
00118
00119 virtual void getCartesianPoses(const descartes_core::RobotModel &model, EigenSTL::vector_Affine3d &poses) const;
00126
00127 virtual bool getClosestJointPose(const std::vector<double> &seed_state,
00128 const descartes_core::RobotModel &model,
00129 std::vector<double> &joint_pose) const;
00130
00131 virtual bool getNominalJointPose(const std::vector<double> &seed_state,
00132 const descartes_core::RobotModel &model,
00133 std::vector<double> &joint_pose) const;
00134
00135
00136 virtual void getJointPoses(const descartes_core::RobotModel &model,
00137 std::vector<std::vector<double> > &joint_poses) const;
00140
00141 virtual bool isValid(const descartes_core::RobotModel &model) const;
00142
00143
00148 virtual bool setDiscretization(const std::vector<double> &discretization);
00149
00150 virtual descartes_core::TrajectoryPtPtr copy() const
00151 {
00152 return descartes_core::TrajectoryPtPtr(new JointTrajectoryPt(*this));
00153 }
00154
00155 void setJoints(const std::vector<TolerancedJointValue> &joints);
00156
00157 inline
00158 void setTool(const descartes_core::Frame &tool)
00159 {
00160 tool_ = tool;
00161 }
00162
00163 inline
00164 void setWobj(const descartes_core::Frame &wobj)
00165 {
00166 wobj_ = wobj;
00167 }
00170 inline
00171 const std::vector<double>& nominal() const
00172 {
00173 return nominal_;
00174 }
00175
00176 inline
00177 const std::vector<double>& upper() const
00178 {
00179 return upper_;
00180 }
00181
00182 inline
00183 const std::vector<double>& lower() const
00184 {
00185 return lower_;
00186 }
00187
00188 protected:
00189 std::vector<double> nominal_;
00190 std::vector<double> lower_;
00191 std::vector<double> upper_;
00192 std::vector<double> discretization_;
00197 descartes_core::Frame tool_;
00198 descartes_core::Frame wobj_;
00201 };
00202
00203 }
00204
00205
00206
00207 #endif