This cm is quite a group! Something at the upper level since it affects high level behaviours in navigation, perception and information flow. More...
![]() |
This cm is quite a group! Something at the upper level since it affects high level behaviours in navigation, perception and information flow.
#define _BLUECOLOR_ CV_RGB(0,0,255) |
#define _CALIBRATIONDIRECTORY_ "../trafficlights/" |
#define _GREENCOLOR_ CV_RGB(0,255,0) |
#define _REDCOLOR_ CV_RGB(255,0,0) |
#define CHANGESTATE 1 |
#define COMPETITION_ROUND 1 |
#define DISTANT_LIGHTS_ACTIVE 1 |
#define DISTANT_LIGHTS_PERSISTENCE 1.5 |
Persistence for distance lights. In meters.
#define DISTANT_LIGHTS_TIME_PERSISTENCE 0.5 |
Lights timeout usend in trafficlights computation. In seconds.
#define DONOTCHANGESTATE 0 |
#define FRAME_CROSSDETECTIONCOLOR CV_RGB(100,100,255) |
#define FRAME_CROSSDETECTIONCPOS 110 |
#define FRAME_CROSSDETECTIONLPOS 115 |
#define FRAME_CROSSDETECTIONLSTEP 12 |
#define FRAME_CROSSDETECTIONVALCOLSTEP 55 |
#define FRAME_DIRECTIONCOLOR CV_RGB(100,100,255) |
#define FRAME_DIRECTIONCPOS 110 |
#define FRAME_DIRECTIONLPOS 5 |
#define FRAME_DIRECTIONLSTEP 12 |
#define FRAME_DIRECTIONVALCOLSTEP 40 |
#define FRAME_MODECOLOR CV_RGB(100,100,255) |
#define FRAME_MODECPOS 240 |
#define FRAME_MODELPOS 5 |
#define FRAME_MODELSTEP 12 |
#define FRAME_MODEVALCOLSTEP 55 |
#define FRAME_PTUCOLOR CV_RGB(100,100,255) |
#define FRAME_PTUCPOS 345 |
#define FRAME_PTULPOS 5 |
#define FRAME_PTULSTEP 12 |
#define FRAME_PTUVALCOLSTEP 35 |
#define FRAME_SIGNALSCOLOR CV_RGB(100,100,255) |
#define FRAME_SIGNALSCPOS 345 |
#define FRAME_SIGNALSLPOS 65 |
#define FRAME_SIGNALSLSTEP 12 |
#define FRAME_SIGNALSVALCOLSTEP 55 |
#define FRAME_SPEEDCOLOR CV_RGB(100,100,255) |
#define FRAME_SPEEDCPOS 110 |
#define FRAME_SPEEDLPOS 65 |
#define FRAME_SPEEDLSTEP 12 |
#define FRAME_SPEEDVALCOLSTEP 40 |
#define FRAME_TIMERSCOLOR CV_RGB(100,100,255) |
#define FRAME_TIMERSCPOS 5 |
#define FRAME_TIMERSLPOS 5 |
#define FRAME_TIMERSLSTEP 12 |
#define FRAME_TIMERSVALCOLSTEP 55 |
#define GO_AFTER_TIMEOUT 0 |
CHANGE HERE TO GO AFTER 3 SWCS TO PARK.
#define HALF_LAP_LENGTH 18 |
Half of the complete lap lenght. In meters.
#define LEFT_TURN_REDUCE_SPEED 2 |
Speed reduction zone when making a left turn In meters.
Referenced by speedcontrol(), and state_management().
#define LIGHTS_PERSISTENCE 5 |
Lights timeout usend in trafficlights computation. In seconds.
#define macro_max | ( | a, | |||
b | ) | ((a)>=(b) ? (a) : (b)) |
#define macro_min | ( | a, | |||
b | ) | ((a)<=(b) ?( a) :( b)) |
#define OFF 0 |
#define ON 1 |
#define PARKINGTIMEOUT 3.8 |
#define saturatemax | ( | val, | |||
max | ) | ((val)>(max) ?( max) :( val)) |
#define saturatemin | ( | val, | |||
min | ) | ((val)<(min) ?( min) :( val)) |
#define SEARCHFORCROSS_BLACKOUT 0.7*HALF_LAP_LENGTH |
Blackout used in normal mode to search for cross. In meters.
#define WINDOW2_POS_X 750 |
#define WINDOW2_POS_Y 350 |
enum TYPE_States |
enum TYPE_transitioncause |
void brake_toogle_computation | ( | void | ) |
References CROSSSTATE, TYPE_RobotStatus::current_state, TYPE_RobotStatus::distance_since_distantlights_found, DISTANT_LIGHTS_PERSISTENCE, ENDSTATE, GREENARROWUP, TYPE_RobotStatus::lap_number, msg, OFF, ON, robot_publish_brake_toggle(), rstat, STOPSTATE, TYPE_RobotStatus::total_laps, and YELLOWARROWLEFT.
void check_command | ( | int | argc, | |
char ** | argv | |||
) |
checks for command line instructions
Calling this function will alter the state of the flags. Possible instructions are:
argc | standart argc. pass from main routine | |
argv | standart argv. pass from main routine |
void cm_param_daemon_install_escapemanouver | ( | TYPE_EscapeManouver * | em, | |
int | subscribe_changes | |||
) |
void cm_param_daemon_install_speedlist | ( | TYPE_SpeedList * | sl, | |
int | subscribe_changes | |||
) |
intalls parameters contained in section drivingdirectives.
TYPE_DrivingDirectives | pointer to the variables to be installed | |
subscribe_changes | 1 yes or 0 no |
void cross_computation | ( | void | ) |
References TYPE_RobotStatus::cross, TYPE_RobotStatus::detections, FALSE, msg, TYPE_RobotStatus::prev_cross, rstat, send_msg_to_soundplayer(), foveationcontrol_pointto_xyz_message::timestamp, and TRUE.
void distant_trafficlights_computation | ( | void | ) |
References TYPE_RobotStatus::dd, TYPE_RobotStatus::distance_since_distantlights_found, DISTANT_LIGHTS_PERSISTENCE, DISTANT_LIGHTS_TIME_PERSISTENCE, GREENARROWUP, TYPE_DrivingDirectives::intersectionbehaviour, msg, NONE, param_daemon_set_drivingdirectives_intersectionbehaviour(), REDCROSS, rstat, send_msg_to_soundplayer(), TAKELEFT, TAKERIGHT, c_timer::tic(), timer, foveationcontrol_pointto_xyz_message::timestamp, YELLOWARROWLEFT, and YELLOWARROWRIGHT.
void DrawTrafficLightsInfo | ( | IplImage * | src, | |
int | line, | |||
int | col | |||
) |
Draws traffic lights info to an IplImage.
void FRM_Draw_Timers_Frame | ( | void | ) |
int FRM_Init_CrossDetection_Frame | ( | void | ) |
int FRM_Init_Direction_Frame | ( | void | ) |
int FRM_Init_Mode_Frame | ( | void | ) |
int FRM_Init_PTU_Frame | ( | void | ) |
int FRM_Init_Signals_Frame | ( | void | ) |
int FRM_Init_Speed_Frame | ( | void | ) |
void FRM_Init_Timers_Frame | ( | void | ) |
void gui_draw_crossinfo | ( | void | ) |
void gui_draw_dirinfo | ( | void | ) |
void gui_draw_signalsinfo | ( | void | ) |
void gui_draw_speedinfo | ( | void | ) |
void gui_draw_timersinfo | ( | void | ) |
void gui_drawall | ( | void | ) |
Draws metric grid on sensorfusion image.
#ifndef _CM_H_ #define _CM_H_ /* #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h>*/ #include <lar/lar.h> // #include "../cross/cross_interface.h" // #include "../soundgenerator/soundgenerator_interface.h" // #include "../trafficlights/trafficlights_interface.h" // #include "../motionplanner2/motionplanner2_interface.h" // #include "../roaddetection/roaddetection_interface.h" // #include "../lar_libs/videosaving.h" // #include "../parking_detector/park_interface.h" #include "cm_interface.h" #define WINDOW2_POS_X 750 #define WINDOW2_POS_Y 350 #define ON 1 #define OFF 0 #define CHANGESTATE 1 #define DONOTCHANGESTATE 0 #define PARKINGTIMEOUT 3.8 #define HALF_LAP_LENGTH 18 #define SEARCHFORCROSS_BLACKOUT 0.7*HALF_LAP_LENGTH #define DISTANT_LIGHTS_PERSISTENCE 1.5 #define DISTANT_LIGHTS_ACTIVE 1 #define LIGHTS_PERSISTENCE 5 #define LEFT_TURN_REDUCE_SPEED 2 #define DISTANT_LIGHTS_TIME_PERSISTENCE 0.5 #define GO_AFTER_TIMEOUT 0 #define _CALIBRATIONDIRECTORY_ "../trafficlights/" #define COMPETITION_ROUND 1 /*day 0 1 or 2 */ #define saturatemax(val,max) ((val)>(max) ?( max) :( val)) #define saturatemin(val,min) ((val)<(min) ?( min) :( val)) #define macro_min(a,b) ((a)<=(b) ?( a) :( b)) //macro to get minimum value #define macro_max(a,b) ((a)>=(b) ? (a) : (b)) //macro to get maximum value #include "cm_types.h" #include "cm_fprototypes.h" #include "cm_globalvars.h" #include "cm_instparams.h" #include "cm_transitions.h" #include "cm_miscelaneous.h" #include "cm_gui.h" #endif
main header include
void GUI_drawframe | ( | void | ) |
void gui_drawptuinfo | ( | void | ) |
void increment_lap_number | ( | void | ) |
References TYPE_RobotStatus::lap_number, msg, rstat, send_msg_to_soundplayer(), c_timer::tic(), and timer.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Reset distance traveled, we are now starting the race
References TYPE_RobotStatus::cross, cross_computation(), TYPE_RobotStatus::current_state, TYPE_RobotStatus::detections, DUMMYSTATE, FALSE, gui_drawall(), TYPE_RobotStatus::lap_number, msg, OFF, ON, TYPE_RobotStatus::previous_state, robot_publish_reset_distance_traveled(), rstat, TYPE_RobotStatus::search_for_park, send_motion_msg_to_robot(), set_robot_lights(), set_search_for_cross(), set_search_for_lights(), setup_flags(), setup_gui(), setup_intel_ipp(), setup_ipc(), setup_messaging(), shutdown_module(), start_race(), STARTSTATE, state_management(), c_timer::tic(), timer, foveationcontrol_pointto_xyz_message::timestamp, c_timer::toc(), and TYPE_RobotStatus::total_laps.
void motionplanner_msgreceived_handler | ( | void | ) |
void optional_signs_computation | ( | void | ) |
References _LAR_TEXT_RED_, BUS_MODE, TYPE_RobotStatus::current_state, FALSE, INFORMATION_HOSPITAL, INFORMATION_REC_SPEED_60, MANDATORY_BUS_LANE, MANDATORY_MEDIUM_LIGTHS, msg, NORMALSTATE, printc, robot_publish_vert_sign_command(), rstat, send_msg_to_soundplayer(), send_vs_command(), c_timer::tic(), timer, foveationcontrol_pointto_xyz_message::timestamp, c_timer::toc(), TRUE, WARNING_DIP_AHEAD, and WARNING_ROAD_NARROWS.
Referenced by state_management().
void print_trajectoriesstats | ( | mptn2d_motion_message * | msg | ) |
void ptu_control | ( | void | ) |
void search_for_cross_computation | ( | void | ) |
References CROSSSTATE, TYPE_RobotStatus::current_state, TYPE_RobotStatus::distance_since_lap_count, msg, NORMALSTATE, OFF, ON, rstat, SEARCHFORCROSS_BLACKOUT, set_search_for_cross(), c_timer::tic(), and timer.
void send_dir_and_speed | ( | void | ) |
Escape Manouver
Escape Manouver
References CROSSSTATE, TYPE_RobotStatus::current_state, TYPE_RobotStatus::direction, TYPE_RobotStatus::doing_em, DUMMYSTATE, TYPE_RobotStatus::em, ENDSTATE, FALSE, TYPE_EscapeManouver::max_angle, TYPE_EscapeManouver::min_angle, msg, NORMALSTATE, park_step, PARKSTATE, TYPE_SpeedList::reverse, rstat, send_motion_msg_to_robot(), TYPE_RobotStatus::sl, TYPE_RobotStatus::speed, STARTSTATE, STOPSTATE, c_timer::tic(), timer, c_timer::toc(), and TRUE.
int send_motion_msg_to_robot | ( | double | dir, | |
int | speed | |||
) |
int send_msg_to_soundplayer | ( | int | filenumber, | |
char * | filename, | |||
int | mode | |||
) |
References msg, and soundplayer_publish_command_message().
void send_vs_command | ( | vscshfba_command_message * | vs_cm_message | ) |
References FALSE, initialise, vscshfba_command_message::runmodule, vscshfba_command_message::s_info_hosp, vscshfba_command_message::s_info_rec_speed_60, vscshfba_command_message::s_mand_bus_lane, vscshfba_command_message::s_mand_ligths, vscshfba_command_message::s_warn_dip, vscshfba_command_message::s_warn_narrow, TRUE, and vscshfba_publish_command_message().
Referenced by optional_signs_computation().
void sensorfusion_heartbeat_handler | ( | void | ) |
References sensorfusion_heartbeat, and TRUE.
int set_robot_lights | ( | int | right, | |
int | left, | |||
int | head, | |||
int | tail, | |||
int | reverse | |||
) |
void set_search_for_cross | ( | char | on_off, | |
char | forcecommunication | |||
) |
References lar_cross_publish_command_message(), msg, rstat, and TYPE_RobotStatus::search_for_cross.
void set_search_for_laser | ( | char | on_off, | |
char | force_communication | |||
) |
References rstat, and TYPE_RobotStatus::search_for_laser.
void set_search_for_lights | ( | char | on_off, | |
char | ptu_tracking, | |||
char | sGAU, | |||
char | sYAL, | |||
char | sRC, | |||
char | sYAR, | |||
char | force_communication | |||
) |
void set_search_for_park | ( | char | on_off, | |
char | force_communication | |||
) |
References msg, pdtm_publish_command(), rstat, and TYPE_RobotStatus::search_for_park.
void setup_drivingbehaviour | ( | Type_LanePositioning | lp, | |
ENUM_Drivingreactiveness | dr | |||
) |
References motion_weights, param_daemon_set_drivingdirectives_lanepositioning(), param_daemon_set_motion_weights(), REACTIVENESS_HIGH, REACTIVENESS_LOW, REACTIVENESS_NORMAL, TYPE_motion_weights::W_acos, TYPE_motion_weights::W_difo, TYPE_motion_weights::W_dist, TYPE_motion_weights::W_ibeh, and TYPE_motion_weights::W_rdist.
int setup_flags | ( | int | argc, | |
char ** | argv | |||
) |
Sets up program flags to FALSE and then calls check_command().
argc | standart argc. pass from main routine | |
argv | standart argv. pass from main routine |
int setup_gui | ( | void | ) |
int setup_ipc | ( | int | argc, | |
char ** | argv | |||
) |
int setup_messaging | ( | void | ) |
#ifndef _CM_H_ #define _CM_H_ /* #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h>*/ #include <lar/lar.h> // #include "../cross/cross_interface.h" // #include "../soundgenerator/soundgenerator_interface.h" // #include "../trafficlights/trafficlights_interface.h" // #include "../motionplanner2/motionplanner2_interface.h" // #include "../roaddetection/roaddetection_interface.h" // #include "../lar_libs/videosaving.h" // #include "../parking_detector/park_interface.h" #include "cm_interface.h" #define WINDOW2_POS_X 750 #define WINDOW2_POS_Y 350 #define ON 1 #define OFF 0 #define CHANGESTATE 1 #define DONOTCHANGESTATE 0 #define PARKINGTIMEOUT 3.8 #define HALF_LAP_LENGTH 18 #define SEARCHFORCROSS_BLACKOUT 0.7*HALF_LAP_LENGTH #define DISTANT_LIGHTS_PERSISTENCE 1.5 #define DISTANT_LIGHTS_ACTIVE 1 #define LIGHTS_PERSISTENCE 5 #define LEFT_TURN_REDUCE_SPEED 2 #define DISTANT_LIGHTS_TIME_PERSISTENCE 0.5 #define GO_AFTER_TIMEOUT 0 #define _CALIBRATIONDIRECTORY_ "../trafficlights/" #define COMPETITION_ROUND 1 /*day 0 1 or 2 */ #define saturatemax(val,max) ((val)>(max) ?( max) :( val)) #define saturatemin(val,min) ((val)<(min) ?( min) :( val)) #define macro_min(a,b) ((a)<=(b) ?( a) :( b)) //macro to get minimum value #define macro_max(a,b) ((a)>=(b) ? (a) : (b)) //macro to get maximum value #include "cm_types.h" #include "cm_fprototypes.h" #include "cm_globalvars.h" #include "cm_instparams.h" #include "cm_transitions.h" #include "cm_miscelaneous.h" #include "cm_gui.h" #endif
main header include
References carmen_ptucontrolsubscribe_status_message(), lar_cross_subscribe_data_message(), motionplanner_msgreceived_handler(), mptn2d_subscribe_data(), msg, pdtm_subscribe_data(), robot_subscribe_status(), tlcstm_subscribe_data_message(), and vscshfba_subscribe_data().
void shutdown_module | ( | int | x | ) |
Shuts down cm module with a clean exit.
makes a clean shutdown of the program
Disconnects from ipc and releases video writer
x | Signal value. To shutdown signal must be SIGINT |
void signals_management | ( | void | ) |
References CROSSSTATE, TYPE_RobotStatus::current_state, TYPE_RobotStatus::dd, TYPE_RobotStatus::doing_em, ENDSTATE, TYPE_DrivingDirectives::intersectionbehaviour, NORMALSTATE, OFF, ON, rstat, set_robot_lights(), STARTSTATE, STOPSTATE, TAKELEFT, TAKERIGHT, timer, and c_timer::toc().
void speedcontrol | ( | void | ) |
Decides the robot's speed based in the current mode and also some preprocessing directives.
#ifndef _CM_H_ #define _CM_H_ /* #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h>*/ #include <lar/lar.h> // #include "../cross/cross_interface.h" // #include "../soundgenerator/soundgenerator_interface.h" // #include "../trafficlights/trafficlights_interface.h" // #include "../motionplanner2/motionplanner2_interface.h" // #include "../roaddetection/roaddetection_interface.h" // #include "../lar_libs/videosaving.h" // #include "../parking_detector/park_interface.h" #include "cm_interface.h" #define WINDOW2_POS_X 750 #define WINDOW2_POS_Y 350 #define ON 1 #define OFF 0 #define CHANGESTATE 1 #define DONOTCHANGESTATE 0 #define PARKINGTIMEOUT 3.8 #define HALF_LAP_LENGTH 18 #define SEARCHFORCROSS_BLACKOUT 0.7*HALF_LAP_LENGTH #define DISTANT_LIGHTS_PERSISTENCE 1.5 #define DISTANT_LIGHTS_ACTIVE 1 #define LIGHTS_PERSISTENCE 5 #define LEFT_TURN_REDUCE_SPEED 2 #define DISTANT_LIGHTS_TIME_PERSISTENCE 0.5 #define GO_AFTER_TIMEOUT 0 #define _CALIBRATIONDIRECTORY_ "../trafficlights/" #define COMPETITION_ROUND 1 /*day 0 1 or 2 */ #define saturatemax(val,max) ((val)>(max) ?( max) :( val)) #define saturatemin(val,min) ((val)<(min) ?( min) :( val)) #define macro_min(a,b) ((a)<=(b) ?( a) :( b)) //macro to get minimum value #define macro_max(a,b) ((a)>=(b) ? (a) : (b)) //macro to get maximum value #include "cm_types.h" #include "cm_fprototypes.h" #include "cm_globalvars.h" #include "cm_instparams.h" #include "cm_transitions.h" #include "cm_miscelaneous.h" #include "cm_gui.h" #endif
main header include
References TYPE_SpeedList::cross, CROSSSTATE, TYPE_RobotStatus::current_state, TYPE_RobotStatus::dd, TYPE_RobotStatus::distance_since_lap_count, DUMMYSTATE, ENDSTATE, GREENARROWUP, TYPE_DrivingDirectives::intersectionbehaviour, TYPE_RobotStatus::lap_number, LEFT_TURN_REDUCE_SPEED, msg, TYPE_SpeedList::normal, NORMALSTATE, TYPE_SpeedList::park, park_step, PARKSTATE, rstat, saturatemax, TYPE_RobotStatus::sl, TYPE_RobotStatus::speed, STARTSTATE, TYPE_SpeedList::stop, STOPSTATE, TAKELEFT, foveationcontrol_pointto_xyz_message::timestamp, TYPE_RobotStatus::total_laps, TYPE_SpeedList::turbo, and YELLOWARROWLEFT.
void start_race | ( | const char * | text, | |
int | start | |||
) |
#ifndef _CM_H_ #define _CM_H_ /* #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h>*/ #include <lar/lar.h> // #include "../cross/cross_interface.h" // #include "../soundgenerator/soundgenerator_interface.h" // #include "../trafficlights/trafficlights_interface.h" // #include "../motionplanner2/motionplanner2_interface.h" // #include "../roaddetection/roaddetection_interface.h" // #include "../lar_libs/videosaving.h" // #include "../parking_detector/park_interface.h" #include "cm_interface.h" #define WINDOW2_POS_X 750 #define WINDOW2_POS_Y 350 #define ON 1 #define OFF 0 #define CHANGESTATE 1 #define DONOTCHANGESTATE 0 #define PARKINGTIMEOUT 3.8 #define HALF_LAP_LENGTH 18 #define SEARCHFORCROSS_BLACKOUT 0.7*HALF_LAP_LENGTH #define DISTANT_LIGHTS_PERSISTENCE 1.5 #define DISTANT_LIGHTS_ACTIVE 1 #define LIGHTS_PERSISTENCE 5 #define LEFT_TURN_REDUCE_SPEED 2 #define DISTANT_LIGHTS_TIME_PERSISTENCE 0.5 #define GO_AFTER_TIMEOUT 0 #define _CALIBRATIONDIRECTORY_ "../trafficlights/" #define COMPETITION_ROUND 1 /*day 0 1 or 2 */ #define saturatemax(val,max) ((val)>(max) ?( max) :( val)) #define saturatemin(val,min) ((val)<(min) ?( min) :( val)) #define macro_min(a,b) ((a)<=(b) ?( a) :( b)) //macro to get minimum value #define macro_max(a,b) ((a)>=(b) ? (a) : (b)) //macro to get maximum value #include "cm_types.h" #include "cm_fprototypes.h" #include "cm_globalvars.h" #include "cm_instparams.h" #include "cm_transitions.h" #include "cm_miscelaneous.h" #include "cm_gui.h" #endif
main header include
void state_management | ( | void | ) |
LIST HERE STATE ACTIONS
LIST HERE TRANSITION CONDITION
LIST HERE TRANSITION ACTIONS
LIST HERE STATE ACTIONS
LIST HERE TRANSITION CONDITION
LIST HERE TRANSITION ACTIONS
LIST HERE STATE ACTIONS
LIST HERE TRANSITION CONDITION
LIST HERE TRANSITION ACTIONS
LIST HERE TRANSITION ACTIONS
LIST HERE TRANSITION ACTIONS
LIST HERE STATE ACTIONS
LIST HERE TRANSITION CONDITION
LIST HERE TRANSITION ACTIONS
LIST HERE TRANSITION ACTIONS
LIST HERE STATE ACTIONS
LIST HERE TRANSITION CONDITION
References brake_toogle_computation(), cdltm_publish_jumpsearch(), cross_computation(), CROSSSTATE, TYPE_RobotStatus::current_state, TYPE_RobotStatus::dd, TYPE_RobotStatus::distance_since_distantlights_found, TYPE_RobotStatus::distance_since_lap_count, DISTANT_LIGHTS_ACTIVE, distant_trafficlights_computation(), DRIVECENTER, DRIVELEFT, DRIVERIGHT, DUMMYSTATE, ENDSTATE, increment_lap_number(), TYPE_DrivingDirectives::intersectionbehaviour, TYPE_RobotStatus::lap_number, LEFT_TURN_REDUCE_SPEED, msg, NORMALSTATE, OFF, ON, optional_signs_computation(), param_daemon_set_ipm_uselaser(), park_step, PARKINGTIMEOUT, PARKSTATE, TYPE_RobotStatus::previous_state, REACTIVENESS_HIGH, REACTIVENESS_NORMAL, rstat, search_for_cross_computation(), send_dir_and_speed(), send_msg_to_soundplayer(), set_search_for_cross(), set_search_for_lights(), set_search_for_park(), setup_drivingbehaviour(), signals_management(), TYPE_RobotStatus::speed, speedcontrol(), STARTSTATE, STOPSTATE, TAKELEFT, TAKERIGHT, c_timer::tic(), timer, foveationcontrol_pointto_xyz_message::timestamp, c_timer::toc(), TYPE_RobotStatus::total_laps, trafficlights_computation(), transition_cross_to_normal_by_cross_sensor(), transition_cross_to_normal_by_timeout(), transition_cross_to_stop(), transition_normal_to_cross(), transition_start_to_normal(), transition_stop_to_end(), transition_stop_to_normal(), and transition_stop_to_park().
void trafficlights_computation | ( | void | ) |
References TYPE_RobotStatus::dd, GREENARROWUP, TYPE_DrivingDirectives::intersectionbehaviour, LIGHTS_PERSISTENCE, msg, NONE, param_daemon_set_drivingdirectives_intersectionbehaviour(), REDCROSS, rstat, send_msg_to_soundplayer(), TAKELEFT, TAKERIGHT, foveationcontrol_pointto_xyz_message::timestamp, YELLOWARROWLEFT, and YELLOWARROWRIGHT.
int transition_cross_to_normal_by_cross_sensor | ( | void | ) |
Checks if a transition from TypeState.CROSSSTATE to TypeState.NORMALSTATE should ocuur.
int transition_cross_to_normal_by_timeout | ( | void | ) |
Checks if a transition from TypeState.CROSSTATE to TypeState.NORMALSTATE should ocuur.
int transition_cross_to_stop | ( | void | ) |
Checks if a transition from TypeState.CROSSSTATE to TypeState.STOPSTATE should ocuur.
int transition_normal_to_cross | ( | void | ) |
Checks if a transition from TypeState.NORMALSTATE to TypeState.CROSSSTATE should ocuur.
int transition_start_to_normal | ( | void | ) |
Checks if a transition from TypeState.STARTSTATE to TypeState.NORMALSTATE should ocuur.
#ifndef _CM_H_ #define _CM_H_ /* #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h>*/ #include <lar/lar.h> // #include "../cross/cross_interface.h" // #include "../soundgenerator/soundgenerator_interface.h" // #include "../trafficlights/trafficlights_interface.h" // #include "../motionplanner2/motionplanner2_interface.h" // #include "../roaddetection/roaddetection_interface.h" // #include "../lar_libs/videosaving.h" // #include "../parking_detector/park_interface.h" #include "cm_interface.h" #define WINDOW2_POS_X 750 #define WINDOW2_POS_Y 350 #define ON 1 #define OFF 0 #define CHANGESTATE 1 #define DONOTCHANGESTATE 0 #define PARKINGTIMEOUT 3.8 #define HALF_LAP_LENGTH 18 #define SEARCHFORCROSS_BLACKOUT 0.7*HALF_LAP_LENGTH #define DISTANT_LIGHTS_PERSISTENCE 1.5 #define DISTANT_LIGHTS_ACTIVE 1 #define LIGHTS_PERSISTENCE 5 #define LEFT_TURN_REDUCE_SPEED 2 #define DISTANT_LIGHTS_TIME_PERSISTENCE 0.5 #define GO_AFTER_TIMEOUT 0 #define _CALIBRATIONDIRECTORY_ "../trafficlights/" #define COMPETITION_ROUND 1 /*day 0 1 or 2 */ #define saturatemax(val,max) ((val)>(max) ?( max) :( val)) #define saturatemin(val,min) ((val)<(min) ?( min) :( val)) #define macro_min(a,b) ((a)<=(b) ?( a) :( b)) //macro to get minimum value #define macro_max(a,b) ((a)>=(b) ? (a) : (b)) //macro to get maximum value #include "cm_types.h" #include "cm_fprototypes.h" #include "cm_globalvars.h" #include "cm_instparams.h" #include "cm_transitions.h" #include "cm_miscelaneous.h" #include "cm_gui.h" #endif
main header include
int transition_stop_to_end | ( | void | ) |
Checks if a transition from TypeState.STOPSTATE to TypeState.ENDSTATE should ocuur.
int transition_stop_to_normal | ( | void | ) |
Checks if a transition from TypeState.STOPSTATE to TypeState.NORMALSTATE should ocuur.
int transition_stop_to_park | ( | void | ) |
Checks if a transition from TypeState.STOPSTATE to TypeState.PARKSTATE should ocuur.
bool BUS_MODE |
Referenced by optional_signs_computation().
char { ... } ::cross [inherited] |
int TYPE_SpeedList::cross [inherited] |
Referenced by speedcontrol().
struct { ... } TYPE_RobotStatus::detections [inherited] |
double distance_cross_start |
double { ... } ::distance_in_crossstate [inherited] |
double { ... } ::distance_since_distantlights_found [inherited] |
double { ... } ::distance_since_lap_count [inherited] |
double { ... } ::escapemanouver [inherited] |
double { ... } ::escapemanouver [inherited] |
CvFont Font |
double { ... } ::in_bus_lane_distance [inherited] |
double { ... } ::in_bus_lane_distance [inherited] |
double TYPE_timers::in_bus_lane_distance [inherited] |
double { ... } ::in_bus_lane_time [inherited] |
double { ... } ::in_bus_lane_time [inherited] |
double TYPE_timers::in_bus_lane_time [inherited] |
double { ... } ::in_crossstate [inherited] |
double { ... } ::in_crossstate [inherited] |
double { ... } ::in_endstate [inherited] |
double { ... } ::in_endstate [inherited] |
double { ... } ::in_normalstate [inherited] |
double { ... } ::in_normalstate [inherited] |
double { ... } ::in_parkstate [inherited] |
double { ... } ::in_parkstate [inherited] |
double { ... } ::in_startstate [inherited] |
double { ... } ::in_startstate [inherited] |
double { ... } ::in_stopstate [inherited] |
double { ... } ::in_stopstate [inherited] |
double { ... } ::maincycle [inherited] |
double { ... } ::maincycle [inherited] |
double { ... } ::maincycle_GUI [inherited] |
double { ... } ::maincycle_GUI [inherited] |
double TYPE_EscapeManouver::max_angle [inherited] |
Referenced by send_dir_and_speed().
int TYPE_SpeedList::park [inherited] |
Referenced by speedcontrol().
int park_step |
double { ... } ::park_timeout [inherited] |
double { ... } ::park_timeout [inherited] |
char { ... } ::prev_cross [inherited] |
double { ... } ::progstart [inherited] |
int TYPE_SpeedList::reverse [inherited] |
Referenced by send_dir_and_speed().
double { ... } ::since_lap_count [inherited] |
double { ... } ::since_lap_count [inherited] |
CvFont smallFont |
int TYPE_SpeedList::stop [inherited] |
Referenced by speedcontrol().
struct { ... } TYPE_timers::toc [inherited] |
int TYPE_SpeedList::turbo [inherited] |
Referenced by advanced_speed_control(), high_level_obstacle_avoidance_and_speed_control(), and speedcontrol().
vscshfba_command_message TYPE_msg::vs_command_message [inherited] |
double { ... } ::vs_detected_distance [inherited] |
double { ... } ::vs_detected_distance [inherited] |
double TYPE_timers::vs_detected_distance [inherited] |
double { ... } ::vs_detected_time [inherited] |
double { ... } ::vs_detected_time [inherited] |
double TYPE_timers::vs_detected_time [inherited] |
vscshfba_data_message TYPE_msg::vs_message [inherited] |