Skip to content

Commit

Permalink
HighLevelCmd: Add missing shift for traj. eval
Browse files Browse the repository at this point in the history
The evaluation function in the high-level commander ignored the trajectory shift
after a trajectory was completed, resulting in a jump in the setpoint.
  • Loading branch information
whoenig committed Apr 7, 2018
1 parent 2107af2 commit 585d85c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/src/pptraj.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ struct traj_eval piecewise_eval(
// if we get here, the trajectory has ended
struct poly4d const *end_piece = &(traj->pieces[traj->n_pieces - 1]);
struct traj_eval ev = poly4d_eval(end_piece, end_piece->duration);
ev.pos = vadd(ev.pos, traj->shift);
ev.vel = vzero();
ev.acc = vzero();
ev.omega = vzero();
Expand Down Expand Up @@ -333,6 +334,7 @@ struct traj_eval piecewise_eval_reversed(
// if we get here, the trajectory has ended
struct poly4d const *end_piece = &(traj->pieces[0]);
struct traj_eval ev = poly4d_eval(end_piece, 0.0f);
ev.pos = vadd(ev.pos, traj->shift);
ev.vel = vzero();
ev.acc = vzero();
ev.omega = vzero();
Expand Down

0 comments on commit 585d85c

Please sign in to comment.