work on trajectory, update cobboard and ballboard too
[aversive.git] / modules / devices / robot / trajectory_manager / trajectory_manager.c
index 773388e..7311532 100644 (file)
 /************ 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)