X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fdevices%2Frobot%2Ftrajectory_manager%2Ftrajectory_manager.c;h=731153226a695ce8b369004551ea261f918dce3e;hp=5fe3865d6db8032962daa79c3fbf58c117143b5d;hb=8933c04126fa2885cdcc255271632bd4a5a51afe;hpb=91987ff2747a521681d087935148964eed6b3556 diff --git a/modules/devices/robot/trajectory_manager/trajectory_manager.c b/modules/devices/robot/trajectory_manager/trajectory_manager.c index 5fe3865..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_s 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) @@ -98,5 +109,11 @@ void trajectory_set_windows(struct trajectory *traj, double d_win, IRQ_UNLOCK(flags); } - - +/** set corrective coef for circle */ +void trajectory_set_circle_coef(struct trajectory *traj, double coef) +{ + uint8_t flags; + IRQ_LOCK(flags); + traj->circle_coef = coef ; + IRQ_UNLOCK(flags); +}