cajun::control_panel_window_t Class Reference

Used for displaying statistics about the bots state. More...

#include <control_panel_window.H>

List of all members.

Public Member Functions

void update_fps (unsigned fps_)
 Used to update the frames per second display.
void update_data ()
 Update GLUI controls with latest queue data.
void mouse_callback (int button, int state, int x, int y)
 Callback for mouse clicks.
void normalKey_callback (int key)
 Callback for normal keys. Used to control throttle and steering values.
void controlKey_callback (int key)
 Callback for control keys. Used to set manual override for bot steering controller.
void display ()
 Display function for secondary window.

Static Public Member Functions

static control_panel_window_tcreate_window (char const *conf_filename, int viz_mode, world_state_t *ws_, graphic_interface_t *interface_)
 Create a new control panel window for monitoring the bot.

Private Member Functions

 control_panel_window_t (char const *conf_filename, int viz_mode, world_state_t *ws_, graphic_interface_t *interface_)
 Create a new control panel window.
void setup_glui_controls ()
 Perform initial setup of GLUI control widgets.
void read_queues ()
 Fetch latest data from the queues.
void write_control_data ()
 Push control data onto the control queue with current time.
void write_playback_data ()
 Push playback control data onto the playback control queue with current time.
void pause_control ()
 Send "pause" signal to simulation and write to the queue.
void find_gp_driver_conf_files (const char *conf_dir_)
 Used to scan the bot configuration directory for gp sensor configuration files.

Static Private Member Functions

static void update_simulation (int mode_)
 Callback for simulation control buttons.
static void update_calibration (int which_)
 Used to populate the entry boxes for the sensor gp values.
static void update_gpconf_files (int button_id_)
 Used to write back values to the sensor gp conf files after saving changes.

Private Attributes

cb_time_t m_timer
 Used for getting current time.
double curr_time
 Used for storing current time.
world_state_t * m_world_state
 Used for getting queue data.
graphic_interface_tm_graphics
 Interface for graphical display.
GLUI * m_glui
 GLUI master handle.
bool display_fps
 Enable display of frames per second.
bool display_calibration_panel
 Enable display of sensor calibration panel.
double pause_speed
 Simulation speed.
int viz_mode
 Visualizer mode: simulation, bot, or playback.
double m_desired_speed
 Used for manual control of the vehicle.
std::string m_calibration_helper_script
 Path to helper script for writing conf values.
bool m_time_ok
 Time data is ok.
bool m_steering_ok
 Steering data is ok.
bool m_control_line_ok
 Control line data is ok.
bool m_sog_ok
 Speed over ground data is ok.
bool m_signal_line_ok
 Signal line data is ok.
bool m_waypt_ok
 Waypoint data is ok.
bool m_nav_ok
 Nav data is ok.
playback_control_data_t m_playback_control_data
 Data structure for corresponding queue data.
control_data_t m_control_data
 Data structure for corresponding queue data.
sim_time_data_t m_sim_time_data
 Data structure for corresponding queue data.
steering_data_t m_steering_data
 Data structure for corresponding queue data.
control_line_data_t m_control_line_data
 Data structure for corresponding queue data.
sog_data_t m_sog_data
 Data structure for corresponding queue data.
signal_line_data_t m_signal_line_data
 Data structure for corresponding queue data.
waypt_data_t m_waypt_data
 Data structure for corresponding queue data.
nav_data_t m_nav_data
 Data structure for corresponding queue data.
bool m_panels_open
 Are panels currently open or closed.
int * m_safety_siren
 Flags for display of GUI elements.
int * m_safety_lights
 Flags for display of GUI elements.
int * m_engine_starter
 Flags for display of GUI elements.
int * m_generator_starter
 Flags for display of GUI elements.
int * m_brake_lights
 Flags for display of GUI elements.
int * m_left_blinker
 Flags for display of GUI elements.
int * m_right_blinker
 Flags for display of GUI elements.
int * m_current_gear
 Flags for display of GUI elements.
int * m_signal_generator
 Flags for display of GUI elements.
int * m_signal_engine
 Flags for display of GUI elements.
int * m_signal_pause
 Flags for display of GUI elements.
int * m_signal_kill
 Flags for display of GUI elements.
std::vector< std::string > m_sensor_gp_conf
 Contains sensor_gp_conf filenames.
int * m_sensor_gp_conf_selection
 Currently selected sensor_gp_conf filename.
double * m_gpconf_pos [3]
 Position data for sensor_gp_conf file.
double * m_gpconf_orient [3]
 Orientation data for sensor_gp_conf file.
int * m_fps
 Current frame rate.
GLUI_Rollout * m_glui_time_and_steering_panel
 GUI element.
GLUI_EditText * m_glui_sim_time
 GUI element.
GLUI_EditText * m_glui_sim_time_ext
 GUI element.
GLUI_EditText * m_glui_sog
 GUI element.
GLUI_EditText * m_glui_throttle
 GUI element.
GLUI_EditText * m_glui_steering
 GUI element.
GLUI_Rollout * m_glui_control_line_panel
 GUI element.
GLUI_Checkbox * m_glui_safety_siren
 GUI element.
GLUI_Checkbox * m_glui_safety_lights
 GUI element.
GLUI_Checkbox * m_glui_engine_starter
 GUI element.
GLUI_Checkbox * m_glui_generator_starter
 GUI element.
GLUI_Checkbox * m_glui_brake_lights
 GUI element.
GLUI_Checkbox * m_glui_left_blinker
 GUI element.
GLUI_Checkbox * m_glui_right_blinker
 GUI element.
GLUI_Rollout * m_glui_current_gear_panel
 GUI element.
GLUI_RadioGroup * m_glui_current_gear_radio
 GUI element.
GLUI_Rollout * m_glui_signal_line_panel
 GUI element.
GLUI_Checkbox * m_glui_signal_generator
 GUI element.
GLUI_Checkbox * m_glui_signal_engine
 GUI element.
GLUI_Checkbox * m_glui_signal_pause
 GUI element.
GLUI_Checkbox * m_glui_signal_kill
 GUI element.
GLUI_Rollout * m_glui_simulation_control_panel
 GUI element.
GLUI_Button * m_glui_play
 GUI element.
GLUI_Button * m_glui_pause
 GUI element.
GLUI_Button * m_glui_speedup
 GUI element.
GLUI_Button * m_glui_slowdown
 GUI element.
GLUI_EditText * m_glui_sim_speed
 GUI element.
GLUI_Rollout * m_glui_calibration_panel
 GUI element.
GLUI_Listbox * m_glui_gp_driver_conf_listbox
 GUI element.
GLUI_Spinner * m_glui_gpconf_pos [3]
 GUI element.
GLUI_Spinner * m_glui_gpconf_orient [3]
 GUI element.
GLUI_Button * m_glui_gpconf_commit
 GUI element.
GLUI_Rollout * m_glui_fps_panel
 GUI element.
GLUI_EditText * m_glui_fps
 GUI element.

Static Private Attributes

static control_panel_window_tcontrol_panel_window_instance = NULL
 Control panel window singleton.

Detailed Description

Used for displaying statistics about the bots state.


Constructor & Destructor Documentation

control_panel_window_t::control_panel_window_t ( char const *  conf_filename,
int  visualizer_mode,
world_state_t *  ws_,
graphic_interface_t interface_ 
) [private]

Member Function Documentation

void control_panel_window_t::controlKey_callback ( int  key  ) 

Callback for control keys. Used to set manual override for bot steering controller.

Parameters:
key Key Id of key pressed.

References cajun::CBCK_F4, and m_control_data.

Referenced by cajun::simulation_draw_t::controlKey_callback().

control_panel_window_t * control_panel_window_t::create_window ( char const *  conf_filename,
int  viz_mode,
world_state_t *  ws_,
graphic_interface_t interface_ 
) [static]

Create a new control panel window for monitoring the bot.

Parameters:
conf_filename Filename to load configuration parameters from.
viz_mode Simulation, Playback, or Bot.
ws_ World state for reading queue data.
interface_ For GLUT interface.
Returns:
A new control panel window handle or the current one.

References control_panel_window_instance, and control_panel_window_t().

Referenced by cajun::simulation_draw_t::simulation_draw_t().

void control_panel_window_t::display (  ) 

Display function for secondary window.

Referenced by setup_glui_controls().

void control_panel_window_t::find_gp_driver_conf_files ( const char *  conf_dir_  )  [private]

Used to scan the bot configuration directory for gp sensor configuration files.

Parameters:
conf_dir_ The directory containing sensor gp configuration files.

References m_sensor_gp_conf, and cajun::progname.

Referenced by control_panel_window_t().

void control_panel_window_t::mouse_callback ( int  button,
int  state,
int  x,
int  y 
)

Callback for mouse clicks.

Parameters:
button The button pressed.
state The state of the button.
x The x location of the event.
y The y location of the event.

Referenced by cajun::simulation_draw_t::mousebutton_callback().

void control_panel_window_t::normalKey_callback ( int  key  ) 

Callback for normal keys. Used to control throttle and steering values.

Parameters:
key Id of key pressed.

References m_control_data, and pause_control().

Referenced by cajun::simulation_draw_t::normalKey_callback().

void control_panel_window_t::pause_control (  )  [private]

Send "pause" signal to simulation and write to the queue.

References m_glui_sim_speed, m_playback_control_data, pause_speed, write_control_data(), and write_playback_data().

Referenced by normalKey_callback(), and update_simulation().

void control_panel_window_t::read_queues (  )  [private]

Fetch latest data from the queues.

Sim time, steering, control line, sog, signal line, waypoint, nav.

References m_control_line_data, m_control_line_ok, m_nav_data, m_nav_ok, m_signal_line_data, m_signal_line_ok, m_sim_time_data, m_sog_data, m_sog_ok, m_steering_data, m_steering_ok, m_time_ok, m_waypt_data, m_waypt_ok, and m_world_state.

Referenced by update_data().

void control_panel_window_t::setup_glui_controls (  )  [private]
void control_panel_window_t::update_calibration ( int  which_  )  [static, private]

Used to populate the entry boxes for the sensor gp values.

Parameters:
which_ Index into which entry this belongs.

References control_panel_window_instance, m_glui_gp_driver_conf_listbox, m_glui_gpconf_orient, m_glui_gpconf_pos, and m_sensor_gp_conf.

Referenced by setup_glui_controls().

void control_panel_window_t::update_data (  ) 
void control_panel_window_t::update_fps ( unsigned  fps_  ) 

Used to update the frames per second display.

Parameters:
fps_ Frames per second value.

References m_fps.

Referenced by cajun::simulation_draw_t::draw().

void control_panel_window_t::update_gpconf_files ( int  button_id_  )  [static, private]

Used to write back values to the sensor gp conf files after saving changes.

Parameters:
button_id_ The button generating the callback.

References control_panel_window_instance, m_calibration_helper_script, m_glui_gp_driver_conf_listbox, m_glui_gpconf_orient, m_glui_gpconf_pos, m_sensor_gp_conf, and cajun::progname.

Referenced by setup_glui_controls().

void control_panel_window_t::update_simulation ( int  mode_  )  [static, private]

Callback for simulation control buttons.

Parameters:
mode_ An ID to know which button was clicked.

References control_panel_window_instance, m_glui_sim_speed, m_playback_control_data, pause_control(), pause_speed, write_control_data(), and write_playback_data().

Referenced by setup_glui_controls().

void control_panel_window_t::write_control_data (  )  [private]

Push control data onto the control queue with current time.

References m_control_data, m_timer, and m_world_state.

Referenced by control_panel_window_t(), pause_control(), update_data(), and update_simulation().

void control_panel_window_t::write_playback_data (  )  [private]

Push playback control data onto the playback control queue with current time.

References m_playback_control_data, m_timer, and m_world_state.

Referenced by control_panel_window_t(), pause_control(), update_data(), and update_simulation().


Member Data Documentation

Control panel window singleton.

Referenced by create_window(), update_calibration(), update_gpconf_files(), and update_simulation().

Used for storing current time.

Referenced by control_panel_window_t(), and update_data().

Enable display of sensor calibration panel.

Referenced by control_panel_window_t(), and setup_glui_controls().

Enable display of frames per second.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Path to helper script for writing conf values.

Referenced by control_panel_window_t(), and update_gpconf_files().

Data structure for corresponding queue data.

Referenced by control_panel_window_t(), controlKey_callback(), normalKey_callback(), update_data(), and write_control_data().

Data structure for corresponding queue data.

Referenced by read_queues(), and update_data().

Control line data is ok.

Referenced by read_queues(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Used for manual control of the vehicle.

Referenced by control_panel_window_t().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Current frame rate.

Referenced by control_panel_window_t(), setup_glui_controls(), update_data(), and update_fps().

Flags for display of GUI elements.

Referenced by control_panel_window_t().

GLUI master handle.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

GUI element.

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls(), and update_data().

GUI element.

Referenced by setup_glui_controls().

Orientation data for sensor_gp_conf file.

Referenced by control_panel_window_t(), and setup_glui_controls().

Position data for sensor_gp_conf file.

Referenced by control_panel_window_t(), and setup_glui_controls().

Interface for graphical display.

Referenced by control_panel_window_t(), and setup_glui_controls().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Data structure for corresponding queue data.

Referenced by read_queues().

Nav data is ok.

Referenced by read_queues().

Are panels currently open or closed.

Referenced by control_panel_window_t(), and setup_glui_controls().

playback_control_data_t cajun::control_panel_window_t::m_playback_control_data [private]

Data structure for corresponding queue data.

Referenced by control_panel_window_t(), pause_control(), update_data(), update_simulation(), and write_playback_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

std::vector<std::string> cajun::control_panel_window_t::m_sensor_gp_conf [private]

Contains sensor_gp_conf filenames.

Referenced by find_gp_driver_conf_files(), setup_glui_controls(), update_calibration(), and update_gpconf_files().

Currently selected sensor_gp_conf filename.

Referenced by control_panel_window_t(), and setup_glui_controls().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().

Data structure for corresponding queue data.

Referenced by read_queues(), and update_data().

Signal line data is ok.

Referenced by read_queues(), and update_data().

Flags for display of GUI elements.

Referenced by control_panel_window_t(), and setup_glui_controls().

Data structure for corresponding queue data.

Referenced by read_queues(), and update_data().

Data structure for corresponding queue data.

Referenced by read_queues(), and update_data().

Speed over ground data is ok.

Referenced by read_queues(), and update_data().

Data structure for corresponding queue data.

Referenced by read_queues(), and update_data().

Steering data is ok.

Referenced by read_queues(), and update_data().

Time data is ok.

Referenced by read_queues(), and update_data().

Used for getting current time.

Referenced by update_data(), write_control_data(), and write_playback_data().

Data structure for corresponding queue data.

Referenced by read_queues().

Waypoint data is ok.

Referenced by read_queues().

Simulation speed.

Referenced by control_panel_window_t(), pause_control(), and update_simulation().

Visualizer mode: simulation, bot, or playback.

Referenced by control_panel_window_t(), setup_glui_controls(), and update_data().


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

Generated on Fri Apr 9 10:45:18 2010 for Visualizer by  doxygen 1.6.1