X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fdevices%2Frobot%2Ftrajectory_manager%2Ftrajectory_manager_core.c;h=e3311a9007b789cdf90c5b25f53b3b4486926c86;hp=e3afa27c91c45469530a08a2a5f16bee9f09b146;hb=4abb0bf96078e303a8f43a0ba020a1801b908ae4;hpb=580718729e72aa18b9e247b8647b188ee195eabf diff --git a/modules/devices/robot/trajectory_manager/trajectory_manager_core.c b/modules/devices/robot/trajectory_manager/trajectory_manager_core.c index e3afa27..e3311a9 100644 --- a/modules/devices/robot/trajectory_manager/trajectory_manager_core.c +++ b/modules/devices/robot/trajectory_manager/trajectory_manager_core.c @@ -191,8 +191,6 @@ void trajectory_stop(struct trajectory *traj) UPDATE_A | UPDATE_D | RESET_D | RESET_A); } -#include - /** set relative angle and distance consign to 0, and break any * deceleration ramp in quadramp filter */ void trajectory_hardstop(struct trajectory *traj) @@ -320,8 +318,12 @@ uint8_t trajectory_distance_finished(struct trajectory *traj) * distance. */ uint8_t trajectory_finished(struct trajectory *traj) { - return trajectory_angle_finished(traj) && + uint8_t flags, ret; + IRQ_LOCK(flags); + ret = trajectory_angle_finished(traj) && trajectory_distance_finished(traj); + IRQ_UNLOCK(flags); + return ret; } /** return true if traj is nearly finished */ @@ -1057,7 +1059,8 @@ int8_t trajectory_clitoid(struct trajectory *traj, if (calc_clitoid(traj, x, y, a_rad, alpha_deg, beta_deg, R_mm, Vd, traj->a_acc, d_inter_mm, &Aa, &Va, &remain) < 0) { - DEBUG(E_TRAJECTORY, "%s() calc_clitoid returned an error"); + DEBUG(E_TRAJECTORY, "%s() calc_clitoid returned an error", + __FUNCTION__); return -1; }