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 TRAJECTORY_PT_H_
00026 #define TRAJECTORY_PT_H_
00027
00028 #include <Eigen/Core>
00029 #include <Eigen/Geometry>
00030 #include <eigen_stl_containers/eigen_stl_vector_container.h>
00031 #include <vector>
00032
00033 #include "descartes_core/robot_model.h"
00034 #include "descartes_core/trajectory_id.h"
00035 #include "descartes_core/trajectory_timing_constraint.h"
00036
00037 namespace descartes_core
00038 {
00042 struct Frame
00043 {
00044 Frame(){};
00045 Frame(const Eigen::Affine3d &a) : frame(a), frame_inv(a.inverse()){};
00046
00047 EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
00048 Eigen::Affine3d frame;
00049 Eigen::Affine3d frame_inv;
00050
00051 static const Frame Identity()
00052 {
00053 return Frame(Eigen::Affine3d::Identity());
00054 }
00055 };
00056
00066 DESCARTES_CLASS_FORWARD(TrajectoryPt);
00067 class TrajectoryPt
00068 {
00069 public:
00070 typedef TrajectoryID ID;
00071
00072 TrajectoryPt(const TimingConstraint &timing) : id_(TrajectoryID::make_id()), timing_(timing)
00073 {
00074 }
00075
00076 virtual ~TrajectoryPt()
00077 {
00078 }
00079
00092 virtual bool getClosestCartPose(const std::vector<double> &seed_state, const RobotModel &kinematics,
00093 Eigen::Affine3d &pose) const = 0;
00094
00102 virtual bool getNominalCartPose(const std::vector<double> &seed_state, const RobotModel &kinematics,
00103 Eigen::Affine3d &pose) const = 0;
00104
00109 virtual void getCartesianPoses(const RobotModel &kinematics, EigenSTL::vector_Affine3d &poses) const = 0;
00123 virtual bool getClosestJointPose(const std::vector<double> &seed_state, const RobotModel &model,
00124 std::vector<double> &joint_pose) const = 0;
00125
00132 virtual bool getNominalJointPose(const std::vector<double> &seed_state, const RobotModel &model,
00133 std::vector<double> &joint_pose) const = 0;
00134
00140 virtual void getJointPoses(const RobotModel &model, std::vector<std::vector<double> > &joint_poses) const = 0;
00146 virtual bool isValid(const RobotModel &model) const = 0;
00147
00152 virtual bool setDiscretization(const std::vector<double> &discretization) = 0;
00153
00158 inline ID getID() const
00159 {
00160 return id_;
00161 }
00162
00166 void setID(const ID &id)
00167 {
00168 id_ = id;
00169 }
00176 virtual TrajectoryPtPtr copy() const = 0;
00177
00184 virtual TrajectoryPtPtr copyAndSetTiming(const TimingConstraint &tm) const
00185 {
00186 TrajectoryPtPtr cp = copy();
00187 cp->setTiming(tm);
00188 return cp;
00189 }
00190
00195 virtual TrajectoryPtPtr clone() const
00196 {
00197 TrajectoryPtPtr cp = copy();
00198 cp->setID(TrajectoryID::make_id());
00199 return cp;
00200 }
00201
00207 virtual TrajectoryPtPtr cloneAndSetTiming(const TimingConstraint &tm) const
00208 {
00209 TrajectoryPtPtr cp = clone();
00210 cp->setTiming(tm);
00211 return cp;
00212 }
00213
00214 const TimingConstraint &getTiming() const
00215 {
00216 return timing_;
00217 }
00218
00219 void setTiming(const TimingConstraint &timing)
00220 {
00221 timing_ = timing;
00222 }
00223
00224 protected:
00225 ID id_;
00226 TimingConstraint timing_;
00227 };
00228
00229 }
00230
00231 #endif