aversive_10-03-12/modules/devices/robot/trajectory_manager/trajectory_manager.c File Reference

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <aversive.h>
#include <aversive/error.h>
#include <scheduler.h>
#include <vect2.h>
#include <position_manager.h>
#include <robot_system.h>
#include <control_system_manager.h>
#include <quadramp.h>
#include <trajectory_manager.h>

Go to the source code of this file.

Defines

#define M_2PI   (2*M_PI)
#define DEG(x)   ((x) * (180.0 / M_PI))
#define RAD(x)   ((x) * (M_PI / 180.0))
#define UPDATE_D   1
#define UPDATE_A   2
#define RESET_D   4
#define RESET_A   8

Functions

void trajectory_init (struct trajectory *traj)
void trajectory_set_cs (struct trajectory *traj, struct cs *cs_d, struct cs *cs_a)
void trajectory_set_robot_params (struct trajectory *traj, struct robot_system *rs, struct robot_position *pos)
void trajectory_set_speed (struct trajectory *traj, int16_t d_speed, int16_t a_speed)
void trajectory_set_windows (struct trajectory *traj, double d_win, double a_win_deg, double a_start_deg)
void __trajectory_goto_d_a_rel (struct trajectory *traj, double d_cm, double a_rad, uint8_t flags)
void trajectory_d_rel (struct trajectory *traj, double d_cm)
void trajectory_only_d_rel (struct trajectory *traj, double d_cm)
void trajectory_a_rel (struct trajectory *traj, double a_deg_rel)
void trajectory_a_abs (struct trajectory *traj, double a_deg_abs)
void trajectory_turnto_xy (struct trajectory *traj, double x_abs_cm, double y_abs_cm)
void trajectory_turnto_xy_behind (struct trajectory *traj, double x_abs_cm, double y_abs_cm)
void trajectory_only_a_rel (struct trajectory *traj, double a_deg)
void trajectory_d_a_rel (struct trajectory *traj, double d_cm, double a_deg)
void trajectory_stop (struct trajectory *traj)
void trajectory_hardstop (struct trajectory *traj)
void trajectory_goto_xy_abs (struct trajectory *traj, double x, double y)
void trajectory_goto_forward_xy_abs (struct trajectory *traj, double x, double y)
void trajectory_goto_d_a_rel (struct trajectory *traj, double d, double a)
void trajectory_goto_xy_rel (struct trajectory *traj, double x_rel_cm, double y_rel_cm)
uint8_t trajectory_finished (struct trajectory *traj)
uint8_t trajectory_in_window (struct trajectory *traj, double d_win, double a_win_rad)


Define Documentation

#define DEG (  )     ((x) * (180.0 / M_PI))

Definition at line 42 of file trajectory_manager.c.

#define M_2PI   (2*M_PI)

Definition at line 40 of file trajectory_manager.c.

#define RAD (  )     ((x) * (M_PI / 180.0))

#define RESET_A   8

#define RESET_D   4

#define UPDATE_A   2

#define UPDATE_D   1


Function Documentation

void __trajectory_goto_d_a_rel ( struct trajectory traj,
double  d_cm,
double  a_rad,
uint8_t  flags 
)

void trajectory_a_abs ( struct trajectory traj,
double  a_deg_abs 
)

void trajectory_a_rel ( struct trajectory traj,
double  a_deg_rel 
)

turn by 'a' degrees

Definition at line 279 of file trajectory_manager.c.

References __trajectory_goto_d_a_rel(), RAD, RESET_D, RUNNING_A, trajectory::state, UPDATE_A, and UPDATE_D.

void trajectory_d_a_rel ( struct trajectory traj,
double  d_cm,
double  a_deg 
)

turn by 'a' degrees

Definition at line 333 of file trajectory_manager.c.

References __trajectory_goto_d_a_rel(), RAD, RUNNING_AD, trajectory::state, UPDATE_A, and UPDATE_D.

void trajectory_d_rel ( struct trajectory traj,
double  d_cm 
)

go straight forward (d is in cm)

Definition at line 265 of file trajectory_manager.c.

References __trajectory_goto_d_a_rel(), RESET_A, RUNNING_D, trajectory::state, UPDATE_A, and UPDATE_D.

uint8_t trajectory_finished ( struct trajectory traj  ) 

return true if the position consign is equal to the filtered position consign (after quadramp filter), for angle and distance.

Definition at line 442 of file trajectory_manager.c.

References cs_get_consign(), cs_get_filtered_consign(), trajectory::csm_angle, and trajectory::csm_distance.

void trajectory_goto_d_a_rel ( struct trajectory traj,
double  d,
double  a 
)

void trajectory_goto_forward_xy_abs ( struct trajectory traj,
double  x,
double  y 
)

go forward to a x,y point, using a trajectory event

Definition at line 379 of file trajectory_manager.c.

References trajectory::cart, DEBUG, E_TRAJECTORY, RUNNING_XY_F_START, trajectory::state, trajectory::target, _vect2_cart::x, and _vect2_cart::y.

void trajectory_goto_xy_abs ( struct trajectory traj,
double  x,
double  y 
)

void trajectory_goto_xy_rel ( struct trajectory traj,
double  x_rel_cm,
double  y_rel_cm 
)

void trajectory_hardstop ( struct trajectory traj  ) 

uint8_t trajectory_in_window ( struct trajectory traj,
double  d_win,
double  a_win_rad 
)

void trajectory_init ( struct trajectory traj  ) 

structure initialization

Definition at line 50 of file trajectory_manager.c.

References IRQ_LOCK, IRQ_UNLOCK, READY, trajectory::scheduler_task, and trajectory::state.

void trajectory_only_a_rel ( struct trajectory traj,
double  a_deg 
)

update angle consign without changing distance consign

Definition at line 326 of file trajectory_manager.c.

References __trajectory_goto_d_a_rel(), RAD, RUNNING_A, trajectory::state, and UPDATE_A.

void trajectory_only_d_rel ( struct trajectory traj,
double  d_cm 
)

update distance consign without changing angle consign

Definition at line 272 of file trajectory_manager.c.

References __trajectory_goto_d_a_rel(), RUNNING_D, trajectory::state, and UPDATE_D.

void trajectory_set_cs ( struct trajectory traj,
struct cs cs_d,
struct cs cs_a 
)

structure initialization

Definition at line 62 of file trajectory_manager.c.

References trajectory::csm_angle, trajectory::csm_distance, IRQ_LOCK, and IRQ_UNLOCK.

void trajectory_set_robot_params ( struct trajectory traj,
struct robot_system rs,
struct robot_position pos 
)

structure initialization

Definition at line 74 of file trajectory_manager.c.

References IRQ_LOCK, IRQ_UNLOCK, trajectory::position, and trajectory::robot.

void trajectory_set_speed ( struct trajectory traj,
int16_t  d_speed,
int16_t  a_speed 
)

set speed consign

Definition at line 86 of file trajectory_manager.c.

References trajectory::a_speed, trajectory::d_speed, IRQ_LOCK, and IRQ_UNLOCK.

void trajectory_set_windows ( struct trajectory traj,
double  d_win,
double  a_win_deg,
double  a_start_deg 
)

void trajectory_stop ( struct trajectory traj  ) 

set relative angle and distance consign to 0

Definition at line 340 of file trajectory_manager.c.

References __trajectory_goto_d_a_rel(), READY, RESET_A, RESET_D, trajectory::state, UPDATE_A, and UPDATE_D.

void trajectory_turnto_xy ( struct trajectory traj,
double  x_abs_cm,
double  y_abs_cm 
)

void trajectory_turnto_xy_behind ( struct trajectory traj,
double  x_abs_cm,
double  y_abs_cm 
)


Generated on Fri Mar 12 06:32:06 2010 for AVR by  doxygen 1.5.6