This module performs hardware access to the Atlas2000 robot. More...
|
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 |
This module performs hardware access to the Atlas2000 robot.
| #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) |
Referenced by DES_set_new_baud(), InitDES_communication(), initialize_communications(), and initialize_robot().
| #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 carmen_default_message atlas2000_reset_command_message |
| typedef carmen_default_message atlas2000_reset_occurred_message |
| 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
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().

| void atlas_motion_command | ( | void | ) |
prepares a motion message, using a PWM table, and send message to PIC if not in dummy mode
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().

| static void catcher | ( | int | sig | ) | [static] |
| double fsgn | ( | double | val | ) |
| static void initialize_robot | ( | void | ) | [static] |
initialize usb devices if not in dummy mode
References bzero, COM_DEVICE_MOTORS, COM_DEVICE_SENSORS, TYPE_executionflags::dummy, PortHandlerMotors, PortHandlerSensors, and ret.
Referenced by main().

| long numChars | ( | int | sd | ) |
| void print_all | ( | void | ) |
References robot_status_message::cross_sensor, robot_motion_command_message::dir, TYPE_vert_sign_console::H, robot_lights_command_message::headlights, TYPE_vert_sign_console::J, TYPE_vert_sign_console::M, TYPE_vert_sign_console::N, robot_lights_command_message::reverselights, robot_motion_command_message::speed, robot_lights_command_message::taillights, robot_lights_command_message::turnleft, robot_lights_command_message::turnright, TYPE_vert_sign_console::U, and TYPE_vert_sign_console::Y.
Referenced by main().

| void read_frequency_change_handler | ( | ) |
called when frequency of messaging changes, for now it olny prints a message
References TYPE_executionflags::debug, and read_frequency.
| void robot_publish_brake_toggle | ( | char | toggle | ) |
function that publishes a toggle command for low level braking
| toggle | flag that indicates to activate or not the low level braking |
Referenced by brake_toogle_computation(), and main().

| void robot_publish_lights_command | ( | robot_lights_command_message * | msg | ) |
| void robot_publish_motion_command | ( | robot_motion_command_message * | msg | ) |
| void robot_publish_reset_distance_traveled | ( | void | ) |
This functions publishes reset distance traveled commands.
Referenced by main().

| 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_publish_vert_sign_command | ( | robot_vert_sign_command_message * | msg | ) |
function that publishes vertecal sign command, to interface with robot lights
| msg | - all params for signalize diferent vertical signs |
Referenced by main(), and optional_signs_computation().

| void robot_reset | ( | void | ) |
| 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
| msg | pointer to store the published variable value | |
| handler | handler activated when a message is received | |
| subscribe_how | set the subscribe mode |
Referenced by main().

| void robot_subscribe_motion_command | ( | robot_motion_command_message * | msg, | |
| carmen_handler_t | handler, | |||
| carmen_subscribe_t | subscribe_how | |||
| ) |
| void robot_subscribe_reset_distance_traveled | ( | carmen_handler_t | handler, | |
| carmen_subscribe_t | subscribe_how | |||
| ) |
Subscrive distance_traveled resets.
| msg | pointer to store the published variable value | |
| handler | handler activated when a message is received | |
| subscribe_how | set the subscribe mode |
Referenced by main().

| void robot_subscribe_status | ( | robot_status_message * | msg, | |
| carmen_handler_t | handler, | |||
| carmen_subscribe_t | subscribe_how | |||
| ) |
| 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
| msg | pointer to store the published variable value | |
| handler | handler activated when a message is received | |
| subscribe_how | set the subscribe mode |
Referenced by main().

| void safety_handler | ( | void | ) |
this is a legacy function used to halt the robot if link with host was lost. should not be used
References robot_motion_command_message::timestamp.
Referenced by main().

| int arguments |
| carmen_param_t basesensor_params[] |
{
{(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().
| char* COM_DEVICE_MOTORS |
Referenced by initialize_robot(), and main().
| char* COM_DEVICE_SENSORS |
Referenced by initialize_robot(), and main().
| unsigned char cross_sensor |
Referenced by atlas_lights_command(), main(), and read_cross_sensor_value().
| IPC_RETURN_TYPE err |
Referenced by bus_call(), firei_server_n3_query_shminfo_handler(), cPTU_Base::get_current(), cPTU_Base::get_desired(), cPTU_Base::GetSerialChar(), hokuyo_server_query_shminfo_handler(), ipm_query_shminfo_handler(), main(), pdtm_publish_command(), pdtm_publish_data(), pdtm_subscribe_command(), query_image_handler(), query_sensordata_handler(), query_shminfo_handler(), read_message(), register_ipc_messages(), playback::RegisterMessages(), send_data(), and send_OpCode().
Referenced by DEVICE_read_data(), handler_command_msg(), handler_distance_data(), handler_gga_msg_received(), handler_msg_received(), handler_param_daemon(), handler_rmc_msg_received(), handler_rx_msg_received(), heartbeat_handler(), heartbeat_handler_n0(), heartbeat_handler_n1(), initialize_communications(), main(), refresh_windows(), and send_to_plc().
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 |
Referenced by atlas_motion_command(), main(), and send_dir_brake().
| double minimum_dir |
| double minimum_dir |
Referenced by atlas_motion_command(), main(), and send_dir_brake().
| void motion |
Referenced by main().
char TYPE_vert_sign_console::N [inherited] |
Referenced by main(), and print_all().
Referenced by atlas_motion_command(), initialize_robot(), send_dir_brake(), and shutdown_module().
| double read_frequency |
Referenced by main(), and read_frequency_change_handler().
| 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().
1.6.3