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 {
00036 struct TolerancedJointValue
00037 {
00038 TolerancedJointValue(double nominal, double lower, double upper) : nominal(nominal), lower(lower), upper(upper)
00039 {
00040 }
00041
00042 TolerancedJointValue(double nominal) : nominal(nominal), lower(nominal), upper(nominal)
00043 {
00044 }
00045
00046 double range() const
00047 {
00048 return upper - lower;
00049 }
00050
00051 double nominal, lower, upper;
00052 };
00053
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
00092 JointTrajectoryPt(const std::vector<TolerancedJointValue> &joints,
00093 const descartes_core::TimingConstraint &timing = descartes_core::TimingConstraint());
00094
00099 JointTrajectoryPt(const std::vector<double> &joints,
00100 const descartes_core::TimingConstraint &timing = descartes_core::TimingConstraint());
00101
00102 virtual ~JointTrajectoryPt(){};
00103
00108
00109 virtual bool getClosestCartPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00110 Eigen::Affine3d &pose) const;
00111
00112
00113 virtual bool getNominalCartPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00114 Eigen::Affine3d &pose) const;
00115
00116
00117 virtual void getCartesianPoses(const descartes_core::RobotModel &model, EigenSTL::vector_Affine3d &poses) const;
00124
00125 virtual bool getClosestJointPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00126 std::vector<double> &joint_pose) const;
00127
00128 virtual bool getNominalJointPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00129 std::vector<double> &joint_pose) const;
00130
00131
00132 virtual void getJointPoses(const descartes_core::RobotModel &model,
00133 std::vector<std::vector<double> > &joint_poses) const;
00136
00137 virtual bool isValid(const descartes_core::RobotModel &model) const;
00138
00139
00145 virtual bool setDiscretization(const std::vector<double> &discretization);
00146
00147 virtual descartes_core::TrajectoryPtPtr copy() const
00148 {
00149 return descartes_core::TrajectoryPtPtr(new JointTrajectoryPt(*this));
00150 }
00151
00152 void setJoints(const std::vector<TolerancedJointValue> &joints);
00153
00154 inline void setTool(const descartes_core::Frame &tool)
00155 {
00156 tool_ = tool;
00157 }
00158
00159 inline void setWobj(const descartes_core::Frame &wobj)
00160 {
00161 wobj_ = wobj;
00162 }
00165 inline const std::vector<double> &nominal() const
00166 {
00167 return nominal_;
00168 }
00169
00170 inline const std::vector<double> &upper() const
00171 {
00172 return upper_;
00173 }
00174
00175 inline const std::vector<double> &lower() const
00176 {
00177 return lower_;
00178 }
00179
00180 protected:
00181 std::vector<double> nominal_;
00182 std::vector<double> lower_;
00183 std::vector<double> upper_;
00184 std::vector<double> discretization_;
00189 descartes_core::Frame tool_;
00190 descartes_core::Frame wobj_;
00192 };
00193
00194 }
00195
00196 #endif