Atlas2000
[Hardware Bases]

This module performs hardware access to the Atlas2000 robot. More...

Collaboration diagram for Atlas2000:

Data Structures

struct  robot_brake_toggle_message
 xxxxxxxxxx More...
struct  robot_motion_command_message
 xxxxxxxxxx More...
struct  robot_lights_command_message
 xxxxxxxxxx More...
struct  robot_vert_sign_command_message
 robot_vert_sign_command_message struct where is defined all 6 different signs. More...
struct  robot_status_message
 xxxxxxxxxx More...
struct  TYPE_vert_sign_console
struct  robot_reset_distance_traveled_message
 This is reset message for the traveled distance. More...

Files

file  atlas2000.cpp
 

atlas2000.cpp file for this module. This is where main is defined and etc.


file  atlas2000_interface.cpp
 

xxxx


file  atlas2000_interface.h
 

Definition of the interface of the module base. This file specifies the interface to subscribe the messages of that module and to receive its data via ipc.


file  atlas2000_messages.h
 

This file specifies the messages for this modules used to transmit xxxx data via ipc to other modules.xxxxxxxxxxxxxxxxx.


Defines

#define bzero(b, len)   (memset((b), '\0', (len)), (void) 0)
#define RELEASE   0
#define TABLESIZE   11
#define ATLAS2000_RESET_OCCURRED_NAME   "atlas2000_reset_occurred"
 Control message to pass to the process control module. Always capitals finishes with _RESET_OCCURRED_NAME and the value is small letters the same without the suffix name.
#define ATLAS2000_RESET_COMMAND_NAME   "atlas2000_reset_command"
 Control message to pass to the process control module. Always capitals finishes with _RESET_COMMAND_NAME and the value is small letters the same without the suffix name.
#define ROBOT_BRAKE_TOGGLE_NAME   (char*)"robot_brake_toggle"
#define ROBOT_BRAKE_TOGGLE_FMT   (char*)"{char,double,string}"
#define ROBOT_MOTION_COMMAND_NAME   (char*)"robot_motion_command"
#define ROBOT_MOTION_COMMAND_FMT   (char*)"{double,double,int,string}"
#define ROBOT_RESET_DISTANCE_TRAVELED_NAME   (char*)"robot_reset_distance_traveled_name"
#define ROBOT_RESET_DISTANCE_TRAVELED_FMT   (char*)"{int,double,string}"
#define ROBOT_LIGHTS_COMMAND_NAME   (char*)"robot_lights_command"
#define ROBOT_LIGHTS_COMMAND_FMT   (char*)"{double,int,int,int,int,int,string}"
#define ROBOT_VERT_SIGN_COMMAND_NAME   (char*)"robot_vert_sign_command"
#define ROBOT_VERT_SIGN_COMMAND_FMT   (char*)"{int,double,string}"
#define ROBOT_STATUS_NAME   (char*)"robot_status"
#define ROBOT_STATUS_FMT   (char*)"{double,int,double,int,int,int,int,int,int,int,double,double,string}"
#define KEYBOARD   0
#define MAX_CODE_LENGTH   5
#define DEBUG   0
#define SPEED_STEP   10
#define DIR_STEP   1

Typedefs

typedef carmen_default_message atlas2000_reset_occurred_message
typedef carmen_default_message atlas2000_reset_command_message
typedef global_dummy_message robot_reset_distance_traveled_message

Functions

static void initialize_robot (void)
 initialize usb devices if not in dummy mode
void atlas_motion_command (void)
 prepares a motion message, using a PWM table, and send message to PIC if not in dummy mode
void atlas_lights_command (void)
 prepares a lights command message, using a byte table, and send message to PIC if not in dummy mode, more important, receive a message from the PIC regarding the cross sensor
void safety_handler (void)
 this is a legacy function used to halt the robot if link with host was lost. should not be used
void read_frequency_change_handler ()
 called when frequency of messaging changes, for now it olny prints a message
void robot_subscribe_reset_distance_traveled (carmen_handler_t handler, carmen_subscribe_t subscribe_how)
 Subscrive distance_traveled resets.
void robot_subscribe_motion_command (robot_motion_command_message *msg, carmen_handler_t handler, carmen_subscribe_t subscribe_how)
void robot_subscribe_brake_toggle (robot_brake_toggle_message *msg, carmen_handler_t handler, carmen_subscribe_t subscribe_how)
void robot_subscribe_lights_command (robot_lights_command_message *msg, carmen_handler_t handler, carmen_subscribe_t subscribe_how)
 subscribe function to receive lights activation commands
void robot_subscribe_vert_sign_command (robot_vert_sign_command_message *msg, carmen_handler_t handler, carmen_subscribe_t subscribe_how)
 subscribe function to receive vertical signs activations commands
void robot_subscribe_status (robot_status_message *msg, carmen_handler_t handler, carmen_subscribe_t subscribe_how)
void robot_publish_reset_distance_traveled (void)
 This functions publishes reset distance traveled commands.
void robot_publish_motion_command (robot_motion_command_message *msg)
void robot_publish_brake_toggle (char toggle)
 function that publishes a toggle command for low level braking
void robot_publish_lights_command (robot_lights_command_message *msg)
void robot_publish_vert_sign_command (robot_vert_sign_command_message *msg)
 function that publishes vertecal sign command, to interface with robot lights
void robot_publish_status (robot_motion_command_message motion, robot_lights_command_message lights, robot_vert_sign_command_message vert_sign, unsigned char cross_sensor, double distance_traveled, double real_velocity)
void robot_reset (void)
double fsgn (double val)
static void catcher (int sig)
long numChars (int sd)
void print_all (void)

Variables

char * COM_DEVICE_MOTORS
char * COM_DEVICE_SENSORS
int PortHandlerMotors
int PortHandlerSensors
int arguments
int table_pwm_to_send [TABLESIZE] = {0 , 10 , 20 , 30 , 40 , 45 , 50 , 60, 70 , 80 ,90}
int table_dir_angle [TABLESIZE] = {-11 , -8 , -4 , -2 , -1 , 0 , 1 , 3 , 5 , 8 , 11}
double read_frequency
double time_elapsed
double maximum_dir
double minimum_dir
unsigned char cross_sensor
IPC_RETURN_TYPE err
robot_motion_command_message motion_command
robot_lights_command_message lights_command
robot_vert_sign_command_message vert_sign_command
TYPE_executionflags flags
carmen_param_t basesensor_params []
double dir_step
static int signalled
robot_status_message bs
robot_motion_command_message motion
robot_lights_command_message lights
robot_vert_sign_command_message vert_sign
int maxspeed
double maximum_dir
double minimum_dir
char TYPE_vert_sign_console::U
char TYPE_vert_sign_console::H
char TYPE_vert_sign_console::J
char TYPE_vert_sign_console::N
char TYPE_vert_sign_console::M
TYPE_vert_sign_console vert_sign_console

Detailed Description

This module performs hardware access to the Atlas2000 robot.


Define Documentation

#define ATLAS2000_RESET_COMMAND_NAME   "atlas2000_reset_command"

Control message to pass to the process control module. Always capitals finishes with _RESET_COMMAND_NAME and the value is small letters the same without the suffix name.

#define ATLAS2000_RESET_OCCURRED_NAME   "atlas2000_reset_occurred"

Control message to pass to the process control module. Always capitals finishes with _RESET_OCCURRED_NAME and the value is small letters the same without the suffix name.

#define bzero ( b,
len   )     (memset((b), '\0', (len)), (void) 0)
#define DEBUG   0

Referenced by main().

#define DIR_STEP   1
#define KEYBOARD   0

Referenced by main().

#define MAX_CODE_LENGTH   5

Referenced by main().

#define RELEASE   0
#define ROBOT_BRAKE_TOGGLE_FMT   (char*)"{char,double,string}"
#define ROBOT_BRAKE_TOGGLE_NAME   (char*)"robot_brake_toggle"
#define ROBOT_LIGHTS_COMMAND_FMT   (char*)"{double,int,int,int,int,int,string}"

Referenced by register_ipc_messages().

#define ROBOT_LIGHTS_COMMAND_NAME   (char*)"robot_lights_command"

Referenced by register_ipc_messages().

#define ROBOT_MOTION_COMMAND_FMT   (char*)"{double,double,int,string}"

Referenced by register_ipc_messages().

#define ROBOT_MOTION_COMMAND_NAME   (char*)"robot_motion_command"

Referenced by register_ipc_messages().

#define ROBOT_RESET_DISTANCE_TRAVELED_FMT   (char*)"{int,double,string}"
#define ROBOT_RESET_DISTANCE_TRAVELED_NAME   (char*)"robot_reset_distance_traveled_name"
#define ROBOT_STATUS_FMT   (char*)"{double,int,double,int,int,int,int,int,int,int,double,double,string}"

Referenced by main().

#define ROBOT_STATUS_NAME   (char*)"robot_status"

Referenced by main().

#define ROBOT_VERT_SIGN_COMMAND_FMT   (char*)"{int,double,string}"
#define ROBOT_VERT_SIGN_COMMAND_NAME   (char*)"robot_vert_sign_command"
#define SPEED_STEP   10

Referenced by main().

#define TABLESIZE   11

Referenced by atlas_motion_command().


Typedef Documentation

typedef carmen_default_message atlas2000_reset_command_message
typedef carmen_default_message atlas2000_reset_occurred_message

Function Documentation

void atlas_lights_command ( void   ) 

prepares a lights command message, using a byte table, and send message to PIC if not in dummy mode, more important, receive a message from the PIC regarding the cross sensor

Returns:
nothing for now (should return an error code)

References cross_sensor, TYPE_executionflags::debug, TYPE_executionflags::dummy, robot_lights_command_message::headlights, i, msg, n, PortHandlerSensors, robot_lights_command_message::reverselights, robot_lights_command_message::taillights, robot_lights_command_message::turnleft, and robot_lights_command_message::turnright.

Referenced by main().

Here is the caller graph for this function:

void atlas_motion_command ( void   ) 

prepares a motion message, using a PWM table, and send message to PIC if not in dummy mode

Returns:
nothing for now (should return an error code)

References TYPE_executionflags::debug, robot_motion_command_message::dir, dir, TYPE_executionflags::dummy, i, msg, n, PortHandlerMotors, robot_motion_command_message::speed, speed, table_dir_angle, table_pwm_to_send, and TABLESIZE.

Referenced by main().

Here is the caller graph for this function:

static void catcher ( int  sig  )  [static]

References signalled.

Referenced by main().

Here is the caller graph for this function:

double fsgn ( double  val  ) 
static void initialize_robot ( void   )  [static]

initialize usb devices if not in dummy mode

Returns:
nothing for now

References bzero, COM_DEVICE_MOTORS, COM_DEVICE_SENSORS, TYPE_executionflags::dummy, PortHandlerMotors, PortHandlerSensors, and ret.

Referenced by main().

Here is the caller graph for this function:

long numChars ( int  sd  ) 

Referenced by main().

Here is the caller graph for this function:

void print_all ( void   ) 
void read_frequency_change_handler (  ) 

called when frequency of messaging changes, for now it olny prints a message

Returns:
nothing for now (should return an error code)

References TYPE_executionflags::debug, and read_frequency.

void robot_publish_brake_toggle ( char  toggle  ) 

function that publishes a toggle command for low level braking

Parameters:
toggle flag that indicates to activate or not the low level braking
Returns:

Referenced by brake_toogle_computation(), and main().

Here is the caller graph for this function:

void robot_publish_lights_command ( robot_lights_command_message msg  ) 

Referenced by main(), and set_robot_lights().

Here is the caller graph for this function:

void robot_publish_motion_command ( robot_motion_command_message msg  ) 

Referenced by main(), and send_motion_msg_to_robot().

Here is the caller graph for this function:

void robot_publish_reset_distance_traveled ( void   ) 

This functions publishes reset distance traveled commands.

Returns:

Referenced by main().

Here is the caller graph for this function:

void robot_publish_status ( robot_motion_command_message  motion,
robot_lights_command_message  lights,
robot_vert_sign_command_message  vert_sign,
unsigned char  cross_sensor,
double  distance_traveled,
double  real_velocity 
)

Referenced by main().

Here is the caller graph for this function:

void robot_publish_vert_sign_command ( robot_vert_sign_command_message msg  ) 

function that publishes vertecal sign command, to interface with robot lights

Parameters:
msg - all params for signalize diferent vertical signs
Returns:

Referenced by main(), and optional_signs_computation().

Here is the caller graph for this function:

void robot_reset ( void   ) 
void robot_subscribe_brake_toggle ( robot_brake_toggle_message msg,
carmen_handler_t  handler,
carmen_subscribe_t  subscribe_how 
)

Referenced by main().

Here is the caller graph for this function:

void robot_subscribe_lights_command ( robot_lights_command_message msg,
carmen_handler_t  handler,
carmen_subscribe_t  subscribe_how 
)

subscribe function to receive lights activation commands

Parameters:
msg pointer to store the published variable value
handler handler activated when a message is received
subscribe_how set the subscribe mode
Returns:

Referenced by main().

Here is the caller graph for this function:

void robot_subscribe_motion_command ( robot_motion_command_message msg,
carmen_handler_t  handler,
carmen_subscribe_t  subscribe_how 
)

Referenced by main().

Here is the caller graph for this function:

void robot_subscribe_reset_distance_traveled ( carmen_handler_t  handler,
carmen_subscribe_t  subscribe_how 
)

Subscrive distance_traveled resets.

Parameters:
msg pointer to store the published variable value
handler handler activated when a message is received
subscribe_how set the subscribe mode
Returns:

Referenced by main().

Here is the caller graph for this function:

void robot_subscribe_status ( robot_status_message msg,
carmen_handler_t  handler,
carmen_subscribe_t  subscribe_how 
)

Referenced by main(), and setup_messaging().

Here is the caller graph for this function:

void robot_subscribe_vert_sign_command ( robot_vert_sign_command_message msg,
carmen_handler_t  handler,
carmen_subscribe_t  subscribe_how 
)

subscribe function to receive vertical signs activations commands

Parameters:
msg pointer to store the published variable value
handler handler activated when a message is received
subscribe_how set the subscribe mode
Returns:
void - .

Referenced by main().

Here is the caller graph for this function:

void safety_handler ( void   ) 

this is a legacy function used to halt the robot if link with host was lost. should not be used

Returns:
nothing for now (should return an error code)

References robot_motion_command_message::timestamp.

Referenced by main().

Here is the caller graph for this function:


Variable Documentation

int arguments
carmen_param_t basesensor_params[]
Initial value:
 {

    {(char*)"base", (char*)"frequency", CARMEN_PARAM_DOUBLE, &read_frequency, 1, NULL},
    {(char*)"base", (char*)"comport_motors", CARMEN_PARAM_STRING, &COM_DEVICE_MOTORS, 0, NULL},
    {(char*)"base", (char*)"comport_sensors", CARMEN_PARAM_STRING, &COM_DEVICE_SENSORS, 0, NULL},
    {(char*)"base", (char*)"maximum_dir", CARMEN_PARAM_DOUBLE, &maximum_dir, 1, NULL},
    {(char*)"base", (char*)"minimum_dir", CARMEN_PARAM_DOUBLE, &minimum_dir, 1, NULL}}

Referenced by main().

Referenced by initialize_robot(), and main().

Referenced by initialize_robot(), and main().

unsigned char cross_sensor
double dir_step

Referenced by main().

IPC_RETURN_TYPE err
char TYPE_vert_sign_console::H [inherited]

Referenced by main(), and print_all().

char TYPE_vert_sign_console::J [inherited]

Referenced by main(), and print_all().

char TYPE_vert_sign_console::M [inherited]

Referenced by main(), and print_all().

double maximum_dir
double maximum_dir
int maxspeed

Referenced by main().

double minimum_dir
double minimum_dir
void motion

Referenced by main().

char TYPE_vert_sign_console::N [inherited]

Referenced by main(), and print_all().

int signalled [static]

Referenced by catcher(), and main().

int table_dir_angle[TABLESIZE] = {-11 , -8 , -4 , -2 , -1 , 0 , 1 , 3 , 5 , 8 , 11}

Referenced by atlas_motion_command().

int table_pwm_to_send[TABLESIZE] = {0 , 10 , 20 , 30 , 40 , 45 , 50 , 60, 70 , 80 ,90}

Referenced by atlas_motion_command().

double time_elapsed

Referenced by main().

char TYPE_vert_sign_console::U [inherited]

Referenced by main(), and print_all().

Generated on Wed Jun 2 12:43:28 2010 for LAR Atlas by  doxygen 1.6.3