2 * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: trajectory_manager.c,v 1.4.4.17 2009-05-18 12:28:36 zer0 Exp $
22 /* Trajectory Manager v3 - zer0 - for Eurobot 2010 */
29 #include <aversive/error.h>
30 #include <scheduler.h>
33 #include <position_manager.h>
34 #include <robot_system.h>
35 #include <control_system_manager.h>
38 #include <trajectory_manager.h>
39 #include "trajectory_manager_utils.h"
41 /************ INIT FUNCS */
43 /** structure initialization */
44 void trajectory_init(struct trajectory *traj)
49 memset(traj, 0, sizeof(struct trajectory));
51 traj->scheduler_task = -1;
55 /** structure initialization */
56 void trajectory_set_cs(struct trajectory *traj, struct cs *cs_d,
62 traj->csm_distance = cs_d;
63 traj->csm_angle = cs_a;
67 /** structure initialization */
68 void trajectory_set_robot_params(struct trajectory *traj,
69 struct robot_system *rs,
70 struct robot_position *pos)
79 /** set speed consign */
80 void trajectory_set_speed(struct trajectory *traj, int16_t d_speed, int16_t a_speed)
84 traj->d_speed = d_speed;
85 traj->a_speed = a_speed;
89 /** set windows for trajectory */
90 void trajectory_set_windows(struct trajectory *traj, double d_win,
91 double a_win_deg, double a_start_deg)
96 traj->a_win_rad = RAD(a_win_deg);
97 traj->a_start_rad = RAD(a_start_deg);
101 /** set corrective coef for circle */
102 void trajectory_set_circle_coef(struct trajectory *traj, double coef)
106 traj->circle_coef = coef ;