+ d_consign = 400000 + rs_get_distance(traj->robot);
+ a_consign = 400000 + rs_get_angle(traj->robot);
+
+ /* angle consign */
+/* a_consign = (int32_t)(v2pol_target.theta * */
+/* (traj->position->phys.distance_imp_per_mm) * */
+/* (traj->position->phys.track_mm) / 2.0); */
+/* a_consign += rs_get_angle(traj->robot); */
+
+ /* step 2 : update state, or delete event if we reached the
+ * destination */
+
+/* /\* output angle -> delete event *\/ */
+/* if (a_consign >= traj->target.circle.dest_angle) { */
+/* a_consign = traj->target.circle.dest_angle; */
+/* delete_event(traj); */
+/* } */
+
+ /* step 3 : send the processed commands to cs */
+
+/* EVT_DEBUG(E_TRAJECTORY,"EVENT CIRCLE d_cur=%" PRIi32 ", d_consign=%" PRIi32 */
+/* ", d_speed=%" PRIi32 ", a_cur=%" PRIi32 ", a_consign=%" PRIi32 */
+/* ", a_speed=%" PRIi32 ", radius = %f", */
+/* rs_get_distance(traj->robot), d_consign, get_quadramp_distance_speed(traj), */
+/* rs_get_angle(traj->robot), a_consign, get_quadramp_angle_speed(traj), */
+/* radius); */
+
+ cs_set_consign(traj->csm_angle, a_consign);
+ cs_set_consign(traj->csm_distance, d_consign);
+}
+
+/* trajectory event for lines */
+static void trajectory_manager_line_event(struct trajectory *traj)
+{
+ double x = position_get_x_double(traj->position);
+ double y = position_get_y_double(traj->position);
+ double a = position_get_a_rad_double(traj->position);
+ double advance, dist_to_line;
+ point_t robot, proj, target_pt;
+ int32_t d_consign = 0, a_consign = 0;
+ vect2_cart v2cart_pos;
+ vect2_pol v2pol_target;
+
+ robot.x = x;
+ robot.y = y;
+
+ /* target point on the line is further on the line */
+ proj_pt_line(&robot, &traj->target.line.line, &proj);
+ dist_to_line = pt_norm(&robot, &proj);
+ if (dist_to_line > traj->target.line.advance)
+ advance = 0;
+ else
+ advance = traj->target.line.advance - dist_to_line;
+ target_pt.x = proj.x + advance * cos(traj->target.line.angle);
+ target_pt.y = proj.y + advance * sin(traj->target.line.angle);
+
+ /* target vector */
+ v2cart_pos.x = target_pt.x - x;
+ v2cart_pos.y = target_pt.y - y;
+ vect2_cart2pol(&v2cart_pos, &v2pol_target);
+ v2pol_target.theta = simple_modulo_2pi(v2pol_target.theta - a);