aversive_10-03-12/modules/devices/robot/position_manager/position_manager.h File Reference

#include <math.h>
#include <robot_system.h>

Go to the source code of this file.

Data Structures

struct  robot_physical_params
struct  xya_position
struct  xya_position_s16
struct  robot_position

Functions

void position_init (struct robot_position *pos)
void position_set (struct robot_position *pos, int16_t x, int16_t y, int16_t a)
void position_use_ext (struct robot_position *pos)
void position_use_mot (struct robot_position *pos)
void position_set_physical_params (struct robot_position *pos, double track_cm, double distance_imp_per_cm)
void position_set_related_robot_system (struct robot_position *pos, struct robot_system *rs)
void position_manage (struct robot_position *pos)
int16_t position_get_x_s16 (struct robot_position *pos)
int16_t position_get_y_s16 (struct robot_position *pos)
int16_t position_get_a_deg_s16 (struct robot_position *pos)
double position_get_x_double (struct robot_position *pos)
double position_get_y_double (struct robot_position *pos)
double position_get_a_rad_double (struct robot_position *pos)


Function Documentation

int16_t position_get_a_deg_s16 ( struct robot_position pos  ) 

returns current alpha

Definition at line 214 of file position_manager.c.

References xya_position_s16::a, and robot_position::pos_s16.

double position_get_a_rad_double ( struct robot_position pos  ) 

double position_get_x_double ( struct robot_position pos  ) 

int16_t position_get_x_s16 ( struct robot_position pos  ) 

returns current x

Definition at line 198 of file position_manager.c.

References robot_position::pos_s16, and xya_position_s16::x.

double position_get_y_double ( struct robot_position pos  ) 

int16_t position_get_y_s16 ( struct robot_position pos  ) 

returns current y

Definition at line 206 of file position_manager.c.

References robot_position::pos_s16, and xya_position_s16::y.

void position_init ( struct robot_position pos  ) 

initialization of the robot_position pos, everthing is set to 0

Definition at line 29 of file position_manager.c.

References IRQ_LOCK, and IRQ_UNLOCK.

void position_manage ( struct robot_position pos  ) 

Process the absolute position (x,y,a) depending on the delta on virtual encoders since last read, and depending on physical parameters.

Process the absolute position (x,y,a) depending on the delta on virtual encoders since last read, and depending on physical parameters. The processed position is in cm.

Definition at line 112 of file position_manager.c.

References a, xya_position_s16::a, xya_position::a, rs_polar::angle, rs_polar::distance, robot_physical_params::distance_imp_per_cm, robot_system::flags, IRQ_LOCK, IRQ_UNLOCK, robot_position::phys, robot_position::pos_d, robot_position::pos_s16, robot_position::prev_encoders, robot_position::rs, rs_get_ext_angle(), rs_get_ext_distance(), robot_physical_params::track_cm, robot_position::use_ext, xya_position::x, xya_position_s16::x, xya_position::y, and xya_position_s16::y.

void position_set ( struct robot_position pos,
int16_t  x,
int16_t  y,
int16_t  a 
)

void position_set_physical_params ( struct robot_position pos,
double  track_cm,
double  distance_imp_per_cm 
)

Set the physical parameters of the robot :

  • distance between wheels (track, in cm)
  • number of impulsions for 1 cm (distance)

Set the physical parameters of the robot :

  • number of impulsions for 1 cm (distance)
  • number of impulsions for 1 degree (angle)

Definition at line 69 of file position_manager.c.

References robot_physical_params::distance_imp_per_cm, IRQ_LOCK, IRQ_UNLOCK, robot_position::phys, and robot_physical_params::track_cm.

void position_set_related_robot_system ( struct robot_position pos,
struct robot_system rs 
)

Save in pos structure the pointer to the associated robot_system. The robot_system structure is used to get values from virtual encoders that return angle and distance.

Definition at line 56 of file position_manager.c.

References IRQ_LOCK, IRQ_UNLOCK, and robot_position::rs.

void position_use_ext ( struct robot_position pos  ) 

void position_use_mot ( struct robot_position pos  ) 


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