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, double cs_hz)
49 memset(traj, 0, sizeof(struct trajectory));
52 traj->scheduler_task = -1;
56 /** structure initialization */
57 void trajectory_set_cs(struct trajectory *traj, struct cs *cs_d,
63 traj->csm_distance = cs_d;
64 traj->csm_angle = cs_a;
68 /** structure initialization */
69 void trajectory_set_robot_params(struct trajectory *traj,
70 struct robot_system *rs,
71 struct robot_position *pos)
80 /** set speed consign */
81 void trajectory_set_speed(struct trajectory *traj, double d_speed, double a_speed)
85 traj->d_speed = d_speed;
86 traj->a_speed = a_speed;
90 /** set acc consign */
91 void trajectory_set_acc(struct trajectory *traj, double d_acc, double a_acc)
100 /** set windows for trajectory */
101 void trajectory_set_windows(struct trajectory *traj, double d_win,
102 double a_win_deg, double a_start_deg)
106 traj->d_win = d_win ;
107 traj->a_win_rad = RAD(a_win_deg);
108 traj->a_start_rad = RAD(a_start_deg);
112 /** set corrective coef for circle */
113 void trajectory_set_circle_coef(struct trajectory *traj, double coef)
117 traj->circle_coef = coef ;