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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include "trajectory_segment.hpp"
00044
00045
00046 namespace KDL {
00047
00048
00049 Trajectory_Segment::Trajectory_Segment(Path* _geom, VelocityProfile* _motprof, bool _aggregate):
00050 motprof(_motprof),geom(_geom), aggregate(_aggregate)
00051 {
00052
00053 }
00054
00055 Trajectory_Segment::Trajectory_Segment(Path* _geom, VelocityProfile* _motprof, double _duration, bool _aggregate):
00056 motprof(_motprof),geom(_geom), aggregate(_aggregate)
00057 {
00058
00059 motprof->SetProfileDuration(0, geom->PathLength(), _duration);
00060 }
00061
00062
00063 double Trajectory_Segment::Duration() const
00064 {
00065 return motprof->Duration();
00066 }
00067
00068 Frame Trajectory_Segment::Pos(double time) const
00069 {
00070 return geom->Pos(motprof->Pos(time));
00071 }
00072
00073 Twist Trajectory_Segment::Vel(double time) const
00074 {
00075 return geom->Vel(motprof->Pos(time),motprof->Vel(time));
00076 }
00077
00078 Twist Trajectory_Segment::Acc(double time) const
00079 {
00080 return geom->Acc(motprof->Pos(time),motprof->Vel(time),motprof->Acc(time));
00081 }
00082
00083
00084 void Trajectory_Segment::Write(std::ostream& os) const
00085 {
00086 os << "SEGMENT[ " << std::endl;
00087 os << " ";geom->Write(os);os << std::endl;
00088 os << " ";motprof->Write(os);os << std::endl;
00089 os << "]";
00090 }
00091
00092 Trajectory_Segment::~Trajectory_Segment()
00093 {
00094 if (aggregate)
00095 {
00096 delete motprof;
00097 delete geom;
00098 }
00099 }
00100 Path* Trajectory_Segment::GetPath() {
00101 return geom;
00102 }
00103
00104 VelocityProfile* Trajectory_Segment::GetProfile() {
00105 return motprof;
00106 }
00107
00108
00109 }