Context Manager demo
[Demos]

This context manager demo is copy of the original contex manager that implements some demostration features. More...

Collaboration diagram for Context Manager demo:

Data Structures

struct  TYPE_SpeedList_2
struct  TYPE_EscapeManouver_2
struct  TYPE_birdviewparams
 */ More...
struct  TYPE_msg
struct  TYPE_timers
 List of timers used in the program. They should be set using carmen_get_time(). More...
struct  TYPE_img
 List of images used in the program. They should have type IplImage*. More...
struct  TYPE_RobotStatus
struct  TYPE_flg

Files

file  cm_interface.h
 

*/


Defines

#define WINDOW2_POS_X   750
 */
#define WINDOW2_POS_Y   350
#define ON   1
#define OFF   0
#define CHANGESTATE   1
#define DONOTCHANGESTATE   0
#define PARKINGTIMEOUT   6.3
#define HALF_LAP_LENGTH   18
 Half of the complete lap lenght. In meters.
#define SEARCHFORCROSS_BLACKOUT   0.7*HALF_LAP_LENGTH
 Blackout used in normal mode to search for cross. In meters.
#define DISTANT_LIGHTS_PERSISTENCE   1.5
 Persistence for distance lights. In meters.
#define DISTANT_LIGHTS_ACTIVE   1
#define LIGHTS_PERSISTENCE   5
 Lights timeout usend in trafficlights computation. In seconds.
#define DISTANT_LIGHTS_TIME_PERSISTENCE   0.5
 Lights timeout usend in trafficlights computation. In seconds.
#define GO_AFTER_TIMEOUT   0
 CHANGE HERE TO GO AFTER 3 SWCS TO PARK.
#define _CALIBRATIONDIRECTORY_   "../trafficlights/"
#define COMPETITION_ROUND   1
#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))
#define macro_max(a, b)   ((a)>=(b) ? (a) : (b))
#define _GREENCOLOR_   CV_RGB(0,255,0)
#define _REDCOLOR_   CV_RGB(255,0,0)
#define _BLUECOLOR_   CV_RGB(0,0,255)
#define FRAME_DIRECTIONCOLOR   CV_RGB(100,100,255)
#define FRAME_DIRECTIONLPOS   5
#define FRAME_DIRECTIONCPOS   110
#define FRAME_DIRECTIONLSTEP   12
#define FRAME_DIRECTIONVALCOLSTEP   40
#define FRAME_TIMERSCOLOR   CV_RGB(100,100,255)
#define FRAME_TIMERSLPOS   5
#define FRAME_TIMERSCPOS   5
#define FRAME_TIMERSLSTEP   12
#define FRAME_TIMERSVALCOLSTEP   55
#define FRAME_SPEEDCOLOR   CV_RGB(100,100,255)
#define FRAME_SPEEDLPOS   65
#define FRAME_SPEEDCPOS   110
#define FRAME_SPEEDLSTEP   12
#define FRAME_SPEEDVALCOLSTEP   40
#define FRAME_MODECOLOR   CV_RGB(100,100,255)
#define FRAME_MODELPOS   5
#define FRAME_MODECPOS   240
#define FRAME_MODELSTEP   12
#define FRAME_MODEVALCOLSTEP   55
#define FRAME_CROSSDETECTIONCOLOR   CV_RGB(100,100,255)
#define FRAME_CROSSDETECTIONLPOS   115
#define FRAME_CROSSDETECTIONCPOS   110
#define FRAME_CROSSDETECTIONLSTEP   12
#define FRAME_CROSSDETECTIONVALCOLSTEP   55
#define FRAME_PTUCOLOR   CV_RGB(100,100,255)
#define FRAME_PTULPOS   5
#define FRAME_PTUCPOS   345
#define FRAME_PTULSTEP   12
#define FRAME_PTUVALCOLSTEP   35
#define FRAME_SIGNALSCOLOR   CV_RGB(100,100,255)
#define FRAME_SIGNALSLPOS   65
#define FRAME_SIGNALSCPOS   345
#define FRAME_SIGNALSLSTEP   12
#define FRAME_SIGNALSVALCOLSTEP   55

Enumerations

enum  ENUM_Drivingreactiveness {
  REACTIVENESS_NORMAL = 101, REACTIVENESS_HIGH, REACTIVENESS_LOW, REACTIVENESS_NORMAL = 101,
  REACTIVENESS_HIGH, REACTIVENESS_LOW
}
enum  TYPE_States {
  DUMMYSTATE = 76, STARTSTATE, NORMALSTATE, CROSSSTATE,
  STOPSTATE, PARKSTATE, ENDSTATE, DUMMYSTATE = 76,
  STARTSTATE, NORMALSTATE, CROSSSTATE, STOPSTATE,
  PARKSTATE, ENDSTATE
}
enum  TYPE_transitioncause {
  START_TO_NORMAL_GAU = 1, START_TO_NORMAL_YAL, START_TO_NORMAL_TIMEOUT, START_TO_NORMAL_GAU = 1,
  START_TO_NORMAL_YAL, START_TO_NORMAL_TIMEOUT
}

Functions

void sensorfusion_heartbeat_handler (void)
void motionplanner_msgreceived_handler (void)
int main (int argc, char *argv[])
**LOCAL COPY NOT TO BE
PUBLICLY INCLUDED
****************************************************void 
print_trajectoriesstats (mptn2d_motion_message *msg)
 */
void state_management (void)
void increment_lap_number (void)
void set_search_for_cross (char on_off, char forcecommunication)
void set_search_for_lights (char on_off, char ptu_tracking, char sGAU, char sYAL, char sRC, char sYAR, char force_communication)
void cross_computation (void)
void trafficlights_computation (void)
void send_dir_and_speed (void)
void ptu_control (void)
void signals_management (void)
void setup_drivingbehaviour (Type_LanePositioning lp, ENUM_Drivingreactiveness dr)
void set_search_for_park (char on_off, char force_communication)
void set_search_for_laser (char on_off, char force_communication)
int set_robot_lights (int right, int left, int head, int tail, int reverse)
int send_msg_to_soundplayer (int filenumber, char *filename, int mode)
int send_motion_msg_to_robot (double dir, int speed)
void distant_trafficlights_computation (void)
void brake_toogle_computation (void)
void search_for_cross_computation (void)
void high_level_obstacle_avoidance_and_speed_control (void)
void advanced_speed_control (bool in_follow_maneuver, bool in_overtake_maneuver)
void gui_drawall (void)
 Draws metric grid on sensorfusion image.
void gui_draw_timersinfo (void)
void gui_draw_speedinfo (void)
void gui_draw_dirinfo (void)
void gui_draw_crossinfo (void)
void gui_draw_signalsinfo (void)
void gui_drawptuinfo (void)
void DrawTrafficLightsInfo (IplImage *src, int line, int col)
 */
void GUI_drawframe (void)
int setup_gui (void)
void FRM_Init_Timers_Frame (void)
int FRM_Init_Speed_Frame (void)
int FRM_Init_Direction_Frame (void)
int FRM_Init_CrossDetection_Frame (void)
int FRM_Init_Mode_Frame (void)
int FRM_Init_PTU_Frame (void)
int FRM_Init_Signals_Frame (void)
void FRM_Draw_Timers_Frame (void)
void cm_2_param_daemon_install_speedlist (TYPE_SpeedList_2 *sl, int subscribe_changes)
 intalls parameters contained in section drivingdirectives.
void cm_2_param_daemon_install_escapemanouver (TYPE_EscapeManouver_2 *em, int subscribe_changes)
void shutdown_module (int x)
 Shuts down cm module with a clean exit.
int setup_ipc (int argc, char **argv)
int transition_start_to_normal (void)
 */

Variables

**LOCAL COPY ONLY
**LOCAL COPY ONLY
**LOCAL COPY ONLY
**LOCAL COPY NOT TO BE
PUBLICLY INCLUDED
****************************************************ENUM_Drivingreactiveness 
drivingreactiveness
 */
Type_LanePositioning lanepositioning
int park_step
double distance_cross_start
char sensorfusion_heartbeat
TYPE_flg flg
TYPE_msg msg
TYPE_img img
TYPE_ipm_expert_params birdviewparams
TYPE_RobotStatus rstat
TYPE_motion_weights motion_weights
CvFont Font
CvFont smallFont
TYPE_timers timer
**LOCAL COPY ONLY
**LOCAL COPY ONLY
**LOCAL COPY ONLY
int TYPE_SpeedList_2::stop
int TYPE_SpeedList_2::cross
int TYPE_SpeedList_2::park
int TYPE_SpeedList_2::turbo
int TYPE_SpeedList_2::reverse
double TYPE_EscapeManouver_2::max_angle
**LOCAL COPY ONLY
**LOCAL COPY ONLY
**LOCAL COPY ONLY
**LOCAL COPY ONLY
int TYPE_birdviewparams::width
int TYPE_birdviewparams::height
lar_cross_data_message TYPE_msg::cross
lar_cross_command_message TYPE_msg::cross_command
tlcstm_command_message TYPE_msg::lights_command
tlcstm_data_message TYPE_msg::lights
tlcstm_data_message TYPE_msg::lights_prev
carmen_ptucontrol_status_message TYPE_msg::ptu
robot_motion_command_message TYPE_msg::robot_command
robot_status_message TYPE_msg::robot_status
carmen_ptucontrol_command_message TYPE_msg::ptu_command
cdltm_jumpsearch_message TYPE_msg::roaddetection_jumpsearch
robot_lights_command_message TYPE_msg::robot_lights_command
soundplayer_command_message TYPE_msg::soundplayer
pdtm_data_message TYPE_msg::park
pdtm_command_message TYPE_msg::park_command
roc_data_message TYPE_msg::roc_data
double   TYPE_timers::maincycle
double   TYPE_timers::maincycle_GUI
double   TYPE_timers::in_stopstate
double   TYPE_timers::in_startstate
double   TYPE_timers::in_normalstate
double   TYPE_timers::in_parkstate
double   TYPE_timers::in_crossstate
double   TYPE_timers::in_endstate
double   TYPE_timers::since_lap_count
double   TYPE_timers::escapemanouver
double   TYPE_timers::park_timeout
double   TYPE_timers::distance_since_lap_count
double   TYPE_timers::distance_in_crossstate
double   TYPE_timers::distance_since_distantlights_found
double   TYPE_timers::maincycle
double   TYPE_timers::maincycle_GUI
double   TYPE_timers::in_stopstate
double   TYPE_timers::in_startstate
double   TYPE_timers::in_normalstate
double   TYPE_timers::in_parkstate
double   TYPE_timers::in_crossstate
double   TYPE_timers::in_endstate
double   TYPE_timers::since_lap_count
double   TYPE_timers::escapemanouver
double   TYPE_timers::park_timeout
struct {
   double   progstart
   double   TYPE_timers::maincycle
   double   TYPE_timers::maincycle_GUI
   double   TYPE_timers::in_stopstate
   double   TYPE_timers::in_startstate
   double   TYPE_timers::in_normalstate
   double   TYPE_timers::in_parkstate
   double   TYPE_timers::in_crossstate
   double   TYPE_timers::in_endstate
   double   TYPE_timers::since_lap_count
   double   TYPE_timers::escapemanouver
   double   TYPE_timers::park_timeout
TYPE_timers::toc
IplImage * TYPE_img::frame
IplImage * TYPE_img::framemask
TYPE_EscapeManouver TYPE_RobotStatus::em
TYPE_DrivingDirectives TYPE_RobotStatus::dd
TYPE_SpeedList TYPE_RobotStatus::sl
char TYPE_RobotStatus::doing_em
char   TYPE_RobotStatus::prev_cross
struct {
   char   cross
   char   TYPE_RobotStatus::prev_cross
TYPE_RobotStatus::detections
char TYPE_RobotStatus::lightsdetected
char TYPE_RobotStatus::lightsdetected_pulse
unsigned int TYPE_RobotStatus::lap_number
unsigned int TYPE_RobotStatus::total_laps
double TYPE_RobotStatus::previous_directions [10]
TYPE_States TYPE_RobotStatus::current_state
TYPE_States TYPE_RobotStatus::previous_state
char TYPE_RobotStatus::transition_cause [1024]
double TYPE_RobotStatus::direction
int TYPE_RobotStatus::speed
int TYPE_RobotStatus::search_for_park
int TYPE_RobotStatus::search_for_laser
double TYPE_RobotStatus::distance_since_distantlights_found
double TYPE_RobotStatus::distance_since_lap_count
char TYPE_flg::debugmode
char TYPE_flg::motionplanner2_msg_received
char TYPE_flg::graphical
char TYPE_flg::savevideo

Detailed Description

This context manager demo is copy of the original contex manager that implements some demostration features.

Author:
mike, jalmeida
Date:
18/05/2010

Define Documentation

#define _BLUECOLOR_   CV_RGB(0,0,255)
#define _CALIBRATIONDIRECTORY_   "../trafficlights/"

Referenced by LA_Init_All().

#define _GREENCOLOR_   CV_RGB(0,255,0)

Referenced by LD_DrawGroupInfo().

#define _REDCOLOR_   CV_RGB(255,0,0)
#define CHANGESTATE   1
#define COMPETITION_ROUND   1
#define DISTANT_LIGHTS_ACTIVE   1

Referenced by state_management().

#define DISTANT_LIGHTS_PERSISTENCE   1.5

Persistence for distance lights. In meters.

Referenced by brake_toogle_computation(), and distant_trafficlights_computation().

#define DISTANT_LIGHTS_TIME_PERSISTENCE   0.5

Lights timeout usend in trafficlights computation. In seconds.

Referenced by distant_trafficlights_computation().

#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 LIGHTS_PERSISTENCE   5

Lights timeout usend in trafficlights computation. In seconds.

Referenced by trafficlights_computation().

#define macro_max ( a,
 )     ((a)>=(b) ? (a) : (b))
#define macro_min ( a,
 )     ((a)<=(b) ?( a) :( b))
#define OFF   0
#define ON   1
#define PARKINGTIMEOUT   6.3

Referenced by state_management().

#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.

Referenced by search_for_cross_computation().

#define WINDOW2_POS_X   750

*/

#define WINDOW2_POS_Y   350

Enumeration Type Documentation

Enumerator:
REACTIVENESS_NORMAL 
REACTIVENESS_HIGH 
REACTIVENESS_LOW 
REACTIVENESS_NORMAL 
REACTIVENESS_HIGH 
REACTIVENESS_LOW 

state machine possible states

Enumerator:
DUMMYSTATE 
STARTSTATE 

This state should never ocuur.

NORMALSTATE 

The first state when the program starts.

CROSSSTATE 
STOPSTATE 
PARKSTATE 
ENDSTATE 
DUMMYSTATE 
STARTSTATE 

This state should never ocuur.

NORMALSTATE 

The first state when the program starts.

CROSSSTATE 
STOPSTATE 
PARKSTATE 
ENDSTATE 
Enumerator:
START_TO_NORMAL_GAU 
START_TO_NORMAL_YAL 
START_TO_NORMAL_TIMEOUT 
START_TO_NORMAL_GAU 
START_TO_NORMAL_YAL 
START_TO_NORMAL_TIMEOUT 

Function Documentation

void advanced_speed_control ( bool  in_follow_maneuver,
bool  in_overtake_maneuver 
)
void brake_toogle_computation ( void   ) 
void cm_2_param_daemon_install_escapemanouver ( TYPE_EscapeManouver_2 em,
int  subscribe_changes 
)
void cm_2_param_daemon_install_speedlist ( TYPE_SpeedList_2 sl,
int  subscribe_changes 
)

intalls parameters contained in section drivingdirectives.

Parameters:
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.

Referenced by main(), and state_management().

Here is the call graph for this function:

Here is the caller graph for this function:

void distant_trafficlights_computation ( void   ) 
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

Referenced by main().

Here is the caller graph for this function:

void GUI_drawframe ( void   ) 
void gui_drawptuinfo ( void   ) 
void high_level_obstacle_avoidance_and_speed_control ( void   ) 
void increment_lap_number ( void   ) 

References TYPE_RobotStatus::lap_number, msg, rstat, send_msg_to_soundplayer(), c_timer::tic(), and timer.

Referenced by state_management().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)
void motionplanner_msgreceived_handler ( void   ) 

Referenced by setup_messaging().

Here is the caller graph for this function:

** LOCAL COPY NOT TO BE PUBLICLY INCLUDED** ************************************************** void print_trajectoriesstats ( mptn2d_motion_message msg  ) 

*/

Type Constraints
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.

Referenced by state_management().

Here is the call graph for this function:

Here is the caller graph for this function:

void send_dir_and_speed ( void   ) 
int send_motion_msg_to_robot ( double  dir,
int  speed 
)

References msg, and robot_publish_motion_command().

Referenced by main(), and send_dir_and_speed().

Here is the call graph for this function:

Here is the caller graph for this function:

int send_msg_to_soundplayer ( int  filenumber,
char *  filename,
int  mode 
)

References msg, and soundplayer_publish_command_message().

Referenced by cross_computation(), distant_trafficlights_computation(), increment_lap_number(), optional_signs_computation(), state_management(), and trafficlights_computation().

Here is the call graph for this function:

Here is the caller graph for this function:

void sensorfusion_heartbeat_handler ( void   ) 

References sensorfusion_heartbeat, and TRUE.

int set_robot_lights ( int  right,
int  left,
int  head,
int  tail,
int  reverse 
)

References msg, and robot_publish_lights_command().

Referenced by high_level_obstacle_avoidance_and_speed_control(), main(), and signals_management().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_search_for_cross ( char  on_off,
char  forcecommunication 
)

References lar_cross_publish_command_message(), msg, rstat, and TYPE_RobotStatus::search_for_cross.

Referenced by main(), search_for_cross_computation(), and state_management().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_search_for_laser ( char  on_off,
char  force_communication 
)
void set_search_for_lights ( char  on_off,
char  ptu_tracking,
char  sGAU,
char  sYAL,
char  sRC,
char  sYAR,
char  force_communication 
)

References msg, and tlcstm_publish_command_message().

Referenced by main(), and state_management().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_search_for_park ( char  on_off,
char  force_communication 
)

References msg, pdtm_publish_command(), rstat, and TYPE_RobotStatus::search_for_park.

Referenced by state_management().

Here is the call graph for this function:

Here is the caller graph for this function:

void setup_drivingbehaviour ( Type_LanePositioning  lp,
ENUM_Drivingreactiveness  dr 
)
int setup_gui ( void   ) 

Referenced by main().

Here is the caller graph for this function:

int setup_ipc ( int  argc,
char **  argv 
)

Referenced by main().

Here is the caller graph for this function:

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

Parameters:
x Signal value. To shutdown signal must be SIGINT
void signals_management ( void   ) 
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, DISTANT_LIGHTS_ACTIVE, distant_trafficlights_computation(), DRIVERIGHT, DUMMYSTATE, ENDSTATE, high_level_obstacle_avoidance_and_speed_control(), increment_lap_number(), TYPE_DrivingDirectives::intersectionbehaviour, TYPE_RobotStatus::lap_number, msg, NORMALSTATE, OFF, ON, 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(), speedcontrol(), STARTSTATE, STOPSTATE, TAKELEFT, 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_normal(), and transition_stop_to_park().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void trafficlights_computation ( void   ) 
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

Checks if a transition from TypeState.STARTSTATE to TypeState.NORMALSTATE should ocuur.

Returns:
1 if transition ocuurs or 0 if no transition takes place
1 if transition ocuurs or 0 if no transition takes place

Referenced by state_management().

Here is the caller graph for this function:


Variable Documentation

char { ... } ::cross [inherited]
int TYPE_SpeedList_2::cross [inherited]
char TYPE_flg::debugmode [inherited]
struct { ... } TYPE_RobotStatus::detections [inherited]

Referenced by cross_computation(), and main().

double TYPE_RobotStatus::direction [inherited]
double { ... } ::distance_in_crossstate [inherited]
double { ... } ::distance_since_distantlights_found [inherited]
double { ... } ::distance_since_lap_count [inherited]
char TYPE_RobotStatus::doing_em [inherited]
** LOCAL COPY NOT TO BE PUBLICLY INCLUDED** ************************************************** ENUM_Drivingreactiveness drivingreactiveness

*/

Referenced by send_dir_and_speed().

double { ... } ::escapemanouver [inherited]
double { ... } ::escapemanouver [inherited]
double TYPE_timers::escapemanouver [inherited]
CvFont Font
IplImage * TYPE_img::frame [inherited]
IplImage * TYPE_img::framemask [inherited]
char TYPE_flg::graphical [inherited]
int TYPE_birdviewparams::height [inherited]
double { ... } ::in_crossstate [inherited]
double { ... } ::in_crossstate [inherited]
double TYPE_timers::in_crossstate [inherited]
double { ... } ::in_endstate [inherited]
double { ... } ::in_endstate [inherited]
double TYPE_timers::in_endstate [inherited]
double { ... } ::in_normalstate [inherited]
double { ... } ::in_normalstate [inherited]
double TYPE_timers::in_normalstate [inherited]
double { ... } ::in_parkstate [inherited]
double { ... } ::in_parkstate [inherited]
double TYPE_timers::in_parkstate [inherited]
double { ... } ::in_startstate [inherited]
double { ... } ::in_startstate [inherited]
double TYPE_timers::in_startstate [inherited]
double { ... } ::in_stopstate [inherited]
double { ... } ::in_stopstate [inherited]
double TYPE_timers::in_stopstate [inherited]
unsigned int TYPE_RobotStatus::lap_number [inherited]
double { ... } ::maincycle [inherited]
double { ... } ::maincycle [inherited]
double TYPE_timers::maincycle [inherited]
double { ... } ::maincycle_GUI [inherited]
double { ... } ::maincycle_GUI [inherited]
double TYPE_timers::maincycle_GUI [inherited]

Referenced by setup_drivingbehaviour().

** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
** LOCAL COPY ONLY
int TYPE_SpeedList_2::park [inherited]
int park_step
double { ... } ::park_timeout [inherited]
double { ... } ::park_timeout [inherited]
double TYPE_timers::park_timeout [inherited]
char { ... } ::prev_cross [inherited]
char TYPE_RobotStatus::prev_cross [inherited]

Referenced by cross_computation().

Referenced by main(), and state_management().

double { ... } ::progstart [inherited]
int TYPE_SpeedList_2::reverse [inherited]
char TYPE_flg::savevideo [inherited]

Referenced by set_search_for_laser().

Referenced by main(), and set_search_for_park().

double { ... } ::since_lap_count [inherited]
double { ... } ::since_lap_count [inherited]
double TYPE_timers::since_lap_count [inherited]
CvFont smallFont
int TYPE_RobotStatus::speed [inherited]
int TYPE_SpeedList_2::stop [inherited]
struct { ... } TYPE_timers::toc [inherited]
unsigned int TYPE_RobotStatus::total_laps [inherited]
int TYPE_SpeedList_2::turbo [inherited]
int TYPE_birdviewparams::width [inherited]
Generated on Wed Jun 2 12:43:05 2010 for LAR Atlas by  doxygen 1.6.3