25 double Trajectory_Composite::Duration()
const{
29 Frame Trajectory_Composite::Pos(
double time)
const {
39 for (i=0;i<vt.size();i++) {
41 return vt[i]->Pos(time-previoustime);
45 traj = vt[vt.size()-1];
50 Twist Trajectory_Composite::Vel(
double time)
const {
59 for (i=0;i<vt.size();i++) {
61 return vt[i]->Vel(time-previoustime);
65 traj = vt[vt.size()-1];
66 return traj->Vel(traj->Duration());
69 Twist Trajectory_Composite::Acc(
double time)
const {
78 for (i=0;i<vt.size();i++) {
80 return vt[i]->Acc(time-previoustime);
84 traj = vt[vt.size()-1];
85 return traj->Acc(traj->Duration());
89 vt.insert(vt.end(),elem);
90 duration += elem->Duration();
91 vd.insert(vd.end(),duration);
94 void Trajectory_Composite::Destroy() {
95 VectorTraj::iterator it;
96 for (it=vt.begin();it!=vt.end();it++) {
99 vt.erase(vt.begin(),vt.end());
100 vd.erase(vd.begin(),vd.end());
103 Trajectory_Composite::~Trajectory_Composite() {
108 os <<
"COMPOSITE[ " << vt.size() <<
std::endl;
110 for (i=0;i<vt.size();i++) {
118 for (
unsigned int i = 0; i < vt.size(); ++i) {
119 comp->
Add(vt[i]->Clone());