X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fdevices%2Frobot%2Ftrajectory_manager%2Ftrajectory_manager.c;fp=modules%2Fdevices%2Frobot%2Ftrajectory_manager%2Ftrajectory_manager.c;h=731153226a695ce8b369004551ea261f918dce3e;hp=773388ee5d6fb0be370ce301ba4a93f01e2b7583;hb=fa8546ea39c7442ad3bf5a822a72a2b50a41045d;hpb=a33ceba76b3770d48c68a321b5d259893ddc613c diff --git a/modules/devices/robot/trajectory_manager/trajectory_manager.c b/modules/devices/robot/trajectory_manager/trajectory_manager.c index 773388e..7311532 100644 --- a/modules/devices/robot/trajectory_manager/trajectory_manager.c +++ b/modules/devices/robot/trajectory_manager/trajectory_manager.c @@ -41,12 +41,13 @@ /************ INIT FUNCS */ /** structure initialization */ -void trajectory_init(struct trajectory *traj) +void trajectory_init(struct trajectory *traj, double cs_hz) { uint8_t flags; IRQ_LOCK(flags); memset(traj, 0, sizeof(struct trajectory)); + traj->cs_hz = cs_hz; traj->state = READY; traj->scheduler_task = -1; IRQ_UNLOCK(flags); @@ -77,7 +78,7 @@ void trajectory_set_robot_params(struct trajectory *traj, } /** set speed consign */ -void trajectory_set_speed(struct trajectory *traj, int16_t d_speed, int16_t a_speed) +void trajectory_set_speed(struct trajectory *traj, double d_speed, double a_speed) { uint8_t flags; IRQ_LOCK(flags); @@ -86,6 +87,16 @@ void trajectory_set_speed(struct trajectory *traj, int16_t d_speed, int16_t a_sp IRQ_UNLOCK(flags); } +/** set acc consign */ +void trajectory_set_acc(struct trajectory *traj, double d_acc, double a_acc) +{ + uint8_t flags; + IRQ_LOCK(flags); + traj->d_acc = d_acc; + traj->a_acc = a_acc; + IRQ_UNLOCK(flags); +} + /** set windows for trajectory */ void trajectory_set_windows(struct trajectory *traj, double d_win, double a_win_deg, double a_start_deg)