cajun::drive_t Class Reference

#include <drive.H>

List of all members.

Public Member Functions

 drive_t (base_path_interpolator_t *path_interpolator, speed_planner_t *speed_planner, guide_mode_t *guide_mode, base_steering_t *steering_controller, safe_speed_advisor_t *safe_speed_advisor, base_throttle_t *throttle_controller, world_state_t *world_state, const conf_t &steering_conf, const conf_t &cajun_conf)
 ~drive_t ()
void drive_the_bot (double tstamp, bool bot_should_die)
 Central function of the class which makes function calls to read iput data, check if system should be paused, get the guide point on the path , and ask steering controller to provide steering commands to drive to this point, calls safety_speed_advisor and speed planner to get instantneous desired speed and calls throttle controller to provde throttle commands and populates these steering commands.
void publish_pause_values (double tstamp, double pause_brake, steering_data_t::gear_t gear_)
 Publishes the steering commands when started or before terminating the program.
bool shutdown ()
 Returns true if the vehicle is stopped and software can quit.

Private Member Functions

bool read_steering_conf (const conf_t &steering_conf)
 Read parameters from steering config file.
bool read_cajun_conf (const conf_t &cajun_conf)
 Read parameters from cajun.conf config file.
void update_data (double tstamp)
 Updates all input data, and callt he function that will print a message once per every change of signal line status.
void compute_azimuths ()
 Compute azimuth for all the waypoint in m_path, the path to be followed.
void update_signal_line (double tstamp)
 Print a message once per every change of signal line status.
bool check_staled_data (double tstamp)
 Checks the how old is each of the input data, and returns 'false' if any data is older than max timeout amount.
void update_stale_status (double tstamp, double data_tstamp, double timeout, bool &data_staled, const char *data_name)
 This is a common interface to print message regarding staled status for each of the input data that is being read.
void update_delayed_hardware_pause (double tstamp, bool h_pause)
 Delays the hardware unpause signal so as to give the system enough time to register the environment and determine what to do. Also its GC's requirement to have a lag before start moving after receiving the unpause signal.
void update_software_pause (double tstamp, int goal_index)
 Goes through all the conditions which can cause software pause, right now there are only 2, one is staled data, and second no more path to follow.
void update_bot_should_die (double tstamp, bool received_interrupt)
 Goes through all conditions which can cause bot to die.
void update_bot_should_stop (double tstamp, int goal_index)
 Goes through all conditions which can cause bot to stop.
void update_zero_speed (double tstamp, int goal_index)
void update_gear_action (double tstamp)
void update_action_status (double tstamp, bool bot_should_die, int goal_index)
 Updates status of 'software_pause', 'm_bot_stopped', 'm_bot_should_die' variables.
double steering_position (double tstamp)
 Depending on the what is selected in config file, steering feedback is provided from drive queue or last iteration's steering command.
double map_steering_angle_to_command (double st_angle)
 Maps the steering wheel angle to steering command from -1 to +1.
void convert_to_output_format (double tstamp, path_data_t &output_path)
 Generate path data to output detail path from vector<waypoint_t>.
void update_flag (double tstamp, bool &present_status, bool new_status, const char *mesg, const char *mesg_okay, const char *mesg_not_okay)
 updates the flag and prints appropriate message once per a change in flag
void change_gear (double tstamp_)
 Gives gear command, records gear issue command_tstamp for confirming gear is changed. Also disables m_gear_change_stop flag once gear is changed.

Private Attributes

base_path_interpolator_tm_path_interpolator
speed_planner_tm_speed_planner
guide_mode_tm_guide_mode
base_steering_tm_steering_controller
safe_speed_advisor_tm_safe_speed_advisor
base_throttle_tm_throttle_controller
world_state_t * m_world_state
nav_data_t m_nav
heading_data_t m_heading
sog_data_t m_sog
drive_data_t m_drive
steering_data_t m_steering
signal_line_data_t m_signal_line
path_data_t m_input_path
std::vector< waypoint_tm_path
bool m_input_path_forward
steering_data_t::gear_t m_pres_gear
steering_data_t::gear_t m_req_gear
double m_gear_req_tstamp
double m_gear_change_time
bool m_gear_change_stop
bool m_nav_staled
bool m_heading_staled
bool m_sog_staled
bool m_drive_staled
bool m_signal_line_staled
bool m_path_staled
bool m_bot_should_die
bool m_bot_should_stop
bool m_bot_stopped
bool m_software_pause
bool m_hardware_pause
bool m_covered_input_path
bool m_empty_input_path
bool m_zero_speed_path
double m_min_wheel_angle
double m_max_wheel_angle
double m_max_stop_speed
double m_pause_brake
double m_prev_tstamp
double m_unpause_delay_left
double m_unpause_delay
double m_path_data_timeout
double m_data_timeout
int m_steering_position_feedback
double m_min_dis_to_reach_wp

Constructor & Destructor Documentation

drive_t::drive_t ( base_path_interpolator_t path_interpolator,
speed_planner_t speed_planner,
guide_mode_t guide_mode,
base_steering_t steering_controller,
safe_speed_advisor_t safe_speed_advisor,
base_throttle_t throttle_controller,
world_state_t *  world_state,
const conf_t &  steering_conf,
const conf_t &  cajun_conf 
)
cajun::drive_t::~drive_t (  )  [inline]

Member Function Documentation

void drive_t::change_gear ( double  tstamp_  )  [private]

Gives gear command, records gear issue command_tstamp for confirming gear is changed. Also disables m_gear_change_stop flag once gear is changed.

References m_bot_stopped, m_gear_change_stop, m_gear_change_time, m_gear_req_tstamp, m_input_path_forward, m_pres_gear, and m_req_gear.

Referenced by drive_the_bot().

bool drive_t::check_staled_data ( double  tstamp  )  [private]

Checks the how old is each of the input data, and returns 'false' if any data is older than max timeout amount.

References m_data_timeout, m_heading, m_heading_staled, m_input_path, m_nav, m_nav_staled, m_path_data_timeout, m_path_staled, m_signal_line, m_signal_line_staled, m_sog, m_sog_staled, and update_stale_status().

Referenced by update_software_pause().

void drive_t::compute_azimuths (  )  [private]

Compute azimuth for all the waypoint in m_path, the path to be followed.

References m_empty_input_path, and m_path.

Referenced by update_data().

void drive_t::convert_to_output_format ( double  tstamp,
path_data_t &  output_path 
) [private]

Generate path data to output detail path from vector<waypoint_t>.

References m_path.

Referenced by drive_the_bot().

void drive_t::drive_the_bot ( double  tstamp,
bool  bot_should_die 
)

Central function of the class which makes function calls to read iput data, check if system should be paused, get the guide point on the path , and ask steering controller to provide steering commands to drive to this point, calls safety_speed_advisor and speed planner to get instantneous desired speed and calls throttle controller to provde throttle commands and populates these steering commands.

References change_gear(), convert_to_output_format(), cajun::speed_planner_t::desired_speed(), cajun::guide_mode_t::guide(), m_bot_should_die, m_bot_should_stop, m_bot_stopped, m_covered_input_path, m_empty_input_path, m_gear_change_stop, m_guide_mode, m_hardware_pause, m_heading, m_input_path, m_min_dis_to_reach_wp, m_nav, m_path, m_pause_brake, m_pres_gear, m_req_gear, m_safe_speed_advisor, m_software_pause, m_sog, m_speed_planner, m_steering, m_steering_controller, m_throttle_controller, m_world_state, cajun::safe_speed_advisor_t::max_speed_limit(), cajun::next_goal_to_drive_to(), publish_pause_values(), cajun::safe_speed_advisor_t::set_safe_path_speeds(), cajun::base_steering_t::steer(), steering_position(), cajun::base_throttle_t::throttle(), update_action_status(), update_data(), and update_flag().

Referenced by main().

double drive_t::map_steering_angle_to_command ( double  st_angle  )  [private]

Maps the steering wheel angle to steering command from -1 to +1.

References m_max_wheel_angle, and m_min_wheel_angle.

void drive_t::publish_pause_values ( double  tstamp,
double  pause_brake,
steering_data_t::gear_t  gear_ 
)

Publishes the steering commands when started or before terminating the program.

References m_nav, and m_world_state.

Referenced by drive_the_bot(), and main().

bool drive_t::read_cajun_conf ( const conf_t &  cajun_conf  )  [private]

Read parameters from cajun.conf config file.

References D2R, m_gear_change_time, m_max_wheel_angle, and m_min_wheel_angle.

Referenced by drive_t().

bool drive_t::read_steering_conf ( const conf_t &  steering_conf  )  [private]

Read parameters from steering config file.

References m_data_timeout, m_max_stop_speed, m_min_dis_to_reach_wp, m_pause_brake, m_steering_position_feedback, and m_unpause_delay.

Referenced by drive_t().

bool drive_t::shutdown (  ) 

Returns true if the vehicle is stopped and software can quit.

References m_bot_should_die, and m_bot_stopped.

Referenced by main().

double drive_t::steering_position ( double  tstamp  )  [private]

Depending on the what is selected in config file, steering feedback is provided from drive queue or last iteration's steering command.

References m_steering, m_steering_position_feedback, message, and msg_logger.

Referenced by drive_the_bot().

void drive_t::update_action_status ( double  tstamp,
bool  bot_should_die,
int  goal_index 
) [private]
void drive_t::update_bot_should_die ( double  tstamp,
bool  received_interrupt 
) [private]

Goes through all conditions which can cause bot to die.

References m_bot_should_die, m_empty_input_path, m_signal_line, and update_flag().

Referenced by update_action_status().

void drive_t::update_bot_should_stop ( double  tstamp,
int  goal_index 
) [private]

Goes through all conditions which can cause bot to stop.

References m_bot_should_stop, m_covered_input_path, m_empty_input_path, and update_flag().

Referenced by update_action_status().

void drive_t::update_data ( double  tstamp  )  [private]

Updates all input data, and callt he function that will print a message once per every change of signal line status.

References compute_azimuths(), cajun::base_path_interpolator_t::interpolate(), m_empty_input_path, m_heading, m_input_path, m_input_path_forward, m_nav, m_path, m_path_interpolator, m_sog, m_world_state, update_flag(), and update_signal_line().

Referenced by drive_the_bot().

void drive_t::update_delayed_hardware_pause ( double  tstamp,
bool  h_pause 
) [private]

Delays the hardware unpause signal so as to give the system enough time to register the environment and determine what to do. Also its GC's requirement to have a lag before start moving after receiving the unpause signal.

References m_hardware_pause, m_prev_tstamp, m_unpause_delay, m_unpause_delay_left, and update_flag().

Referenced by update_action_status().

void drive_t::update_flag ( double  tstamp,
bool &  present_status,
bool  new_status,
const char *  mesg,
const char *  mesg_okay,
const char *  mesg_not_okay 
) [private]

updates the flag and prints appropriate message once per a change in flag

References message, and msg_logger.

Referenced by drive_the_bot(), update_bot_should_die(), update_bot_should_stop(), update_data(), update_delayed_hardware_pause(), update_gear_action(), update_software_pause(), and update_zero_speed().

void drive_t::update_gear_action ( double  tstamp  )  [private]
void drive_t::update_signal_line ( double  tstamp  )  [private]

Print a message once per every change of signal line status.

References m_signal_line, m_world_state, message, and msg_logger.

Referenced by update_data().

void drive_t::update_software_pause ( double  tstamp,
int  goal_index 
) [private]

Goes through all the conditions which can cause software pause, right now there are only 2, one is staled data, and second no more path to follow.

References check_staled_data(), m_software_pause, and update_flag().

Referenced by update_action_status().

void drive_t::update_stale_status ( double  tstamp,
double  data_tstamp,
double  timeout,
bool &  data_staled,
const char *  data_name 
) [private]

This is a common interface to print message regarding staled status for each of the input data that is being read.

References message, and msg_logger.

Referenced by check_staled_data().

void drive_t::update_zero_speed ( double  tstamp,
int  goal_index 
) [private]

Member Data Documentation

drive_data_t cajun::drive_t::m_drive [private]

Referenced by change_gear().

Referenced by drive_the_bot().

heading_data_t cajun::drive_t::m_heading [private]

Referenced by check_staled_data(), and drive_t().

path_data_t cajun::drive_t::m_input_path [private]
nav_data_t cajun::drive_t::m_nav [private]

Referenced by check_staled_data(), and drive_t().

std::vector<waypoint_t> cajun::drive_t::m_path [private]

Referenced by check_staled_data(), and drive_t().

Referenced by update_data().

Referenced by check_staled_data(), and drive_t().

steering_data_t::gear_t cajun::drive_t::m_pres_gear [private]
steering_data_t::gear_t cajun::drive_t::m_req_gear [private]

Referenced by change_gear(), drive_t(), and drive_the_bot().

Referenced by drive_the_bot().

signal_line_data_t cajun::drive_t::m_signal_line [private]

Referenced by check_staled_data(), and drive_t().

sog_data_t cajun::drive_t::m_sog [private]

Referenced by check_staled_data(), and drive_t().

Referenced by drive_the_bot().

steering_data_t cajun::drive_t::m_steering [private]
world_state_t* cajun::drive_t::m_world_state [private]

The documentation for this class was generated from the following files:

Generated on Fri Apr 9 10:45:16 2010 for UCSteeringController by  doxygen 1.6.1