#include <sim_world.H>
Public Member Functions | |
sim_world_t (char const *obj_file, char const *rndf_file, bool no_sleep, proj_t *proj, char const *lane_dir_, bool pub_pt_, bool pub_obj_) | |
~sim_world_t () | |
void | start_world () |
Private Member Functions | |
void | read_object_file (char const *filename) |
Load object file into simulator. | |
bool | read_object_file_v1 (char const *filename) |
Load object file version 1 into simulator. | |
bool | read_object_file_v2 (char const *filename) |
Load object file version 2 into simulator. | |
void | add_object (object_info_t *obj_info) |
double | get_avg_step_time () |
void | check_collisions () |
void | remove_collision_joints () |
Static Private Member Functions | |
static void | collision_callback (void *data, dGeomID o1, dGeomID o2) |
Private Attributes | |
sim_world_object_t * | m_sim_object |
std::vector< sim_world_object_t * > | m_objects |
char const * | m_object_file |
double | m_step_increment |
double | m_step_hist [STEP_HIST_SIZE] |
unsigned | m_step_hist_counter |
double | m_current_time |
unsigned | m_sleep_time |
double | m_prev_time |
double | m_play_value |
bool | m_no_sleep |
sim_time_data_t | m_sim_time |
std::vector< obstacle_data_t > * | obstacle_data_list |
std::vector < obstacle_points_data_t > * | obstacle_point_list |
access_data_t * | m_access_data |
playback_control_data_t | m_playback_control_data |
dGeomID | m_ground |
dSpaceID | m_world_space |
rndf_tool_t * | m_rndf_tool |
rndf_t * | m_rndf |
char const * | m_lane_dir |
bool | m_publish_points |
bool | m_publish_objects |
Static Private Attributes | |
static dJointGroupID | m_contact_group |
static dWorldID | m_world_body |
sim_world_t::sim_world_t | ( | char const * | obj_file, | |
char const * | rndf_file, | |||
bool | no_sleep, | |||
proj_t * | proj, | |||
char const * | lane_dir_, | |||
bool | pub_pt_, | |||
bool | pub_obj_ | |||
) |
References m_access_data, m_contact_group, m_current_time, m_ground, m_lane_dir, m_no_sleep, m_object_file, m_play_value, m_prev_time, m_publish_objects, m_publish_points, m_rndf, m_rndf_tool, m_sim_object, m_sim_time, m_sleep_time, m_step_hist, m_step_hist_counter, m_step_increment, m_world_body, m_world_space, and read_object_file().
sim_world_t::~sim_world_t | ( | ) |
References m_sim_object.
void sim_world_t::add_object | ( | object_info_t * | obj_info | ) | [private] |
References cajun::DYN_NO_SIM, cajun::DYN_SIM, m_access_data, m_ground, m_lane_dir, cajun::object_info_t::m_object, m_objects, m_rndf, m_rndf_tool, m_sim_object, m_world_body, m_world_space, cajun::MESH, and cajun::STATIC.
Referenced by read_object_file_v1(), and read_object_file_v2().
void sim_world_t::check_collisions | ( | ) | [private] |
References collision_callback(), and m_world_space.
Referenced by start_world().
void sim_world_t::collision_callback | ( | void * | data, | |
dGeomID | o1, | |||
dGeomID | o2 | |||
) | [static, private] |
References cajun::sim_world_object_t::collided(), cajun::cbsim_utils_t::log(), m_contact_group, m_world_body, and cajun::sim_world_object_t::obj_id().
Referenced by check_collisions().
double sim_world_t::get_avg_step_time | ( | ) | [private] |
References m_step_hist, and STEP_HIST_SIZE.
Referenced by start_world().
void sim_world_t::read_object_file | ( | char const * | filename | ) | [private] |
Load object file into simulator.
Will test for xml object file format and attempt to load it, otherwise it will attempt to load older version of object file.
filename | Object file provided, either old *.obj or newer *xml |
References progname, read_object_file_v1(), and read_object_file_v2().
Referenced by sim_world_t().
bool sim_world_t::read_object_file_v1 | ( | char const * | filename | ) | [private] |
Load object file version 1 into simulator.
Will load original object file format into simulator.
filename | Object file provided, in simulator's .obj format. |
References add_object(), cajun::goal_t::angle, cajun::goal_t::distance, cajun::DYN_SIM, cajun::mesh_object_info_t::indices_file_is_full_path, cajun::waypoint_data_t::initial_pause, cajun::rndf_goal_t::lane, cajun::object_info_t::m_controller, cajun::object_info_t::m_dyn_sim_data, cajun::object_info_t::m_lane_id, cajun::object_info_t::m_mesh_object, cajun::object_info_t::m_num_objects, cajun::object_info_t::m_num_sensors, cajun::object_info_t::m_object, cajun::object_info_t::m_object_id, cajun::object_info_t::m_orient_x, cajun::object_info_t::m_orient_y, cajun::object_info_t::m_orient_z, cajun::object_info_t::m_pos_x, cajun::object_info_t::m_pos_y, cajun::object_info_t::m_pos_z, cajun::object_info_t::m_script_data, cajun::object_info_t::m_segment_id, cajun::object_info_t::m_sensor, cajun::object_info_t::m_shape, cajun::object_info_t::m_size_x, cajun::object_info_t::m_size_y, cajun::object_info_t::m_size_z, cajun::object_info_t::m_waypoint_data, cajun::object_info_t::m_wp_id, cajun::MESH, cajun::rndf_goal_t::pause, cajun::goal_t::pause, progname, cajun::SCRIPT, cajun::rndf_goal_t::segment, cajun::sensor_object_t::sensor, cajun::sensor_object_t::sensor_filename, cajun::rndf_goal_t::sog, cajun::goal_t::sog, cajun::STATIC, cajun::mesh_object_info_t::vertices_file_is_full_path, cajun::rndf_goal_t::waypoint, and cajun::WAYPOINT.
Referenced by read_object_file().
bool sim_world_t::read_object_file_v2 | ( | char const * | filename | ) | [private] |
Load object file version 2 into simulator.
Will load XML-based object file format into simulator.
filename | Object file provided, in the newer XML-based format. |
References add_object(), cajun::DYN_NO_SIM, cajun::DYN_SIM, cajun::mesh_object_info_t::indices_file, cajun::mesh_object_info_t::indices_file_is_full_path, cajun::waypoint_data_t::initial_pause, cajun::rndf_goal_t::lane, cajun::dyn_sim_object_t::lever_rate, cajun::object_info_t::m_controller, cajun::object_info_t::m_dyn_sim_data, cajun::object_info_t::m_lane_id, cajun::object_info_t::m_mesh_object, cajun::object_info_t::m_num_sensors, cajun::object_info_t::m_object, cajun::object_info_t::m_object_id, cajun::object_info_t::m_orient_x, cajun::object_info_t::m_orient_y, cajun::object_info_t::m_orient_z, cajun::object_info_t::m_pos_x, cajun::object_info_t::m_pos_y, cajun::object_info_t::m_pos_z, m_rndf, cajun::object_info_t::m_segment_id, cajun::object_info_t::m_sensor, cajun::object_info_t::m_shape, cajun::object_info_t::m_size_x, cajun::object_info_t::m_size_y, cajun::object_info_t::m_size_z, cajun::object_info_t::m_waypoint_data, cajun::object_info_t::m_wp_id, cajun::MESH, cajun::waypoint_data_t::num_goals, cajun::rndf_goal_t::pause, progname, cajun::rndf_goal_t::segment, cajun::sensor_object_t::sensor, cajun::SENSOR, cajun::sensor_object_t::sensor_filename, cajun::rndf_goal_t::sog, cajun::STATIC, cajun::dyn_sim_object_t::throttle_rate, cajun::mesh_object_info_t::vertices_file, cajun::mesh_object_info_t::vertices_file_is_full_path, cajun::rndf_goal_t::waypoint, cajun::WAYPOINT, cajun::waypoint_data_t::waypoint_goals, cajun::dyn_sim_object_t::wheel, cajun::dyn_sim_object_t::wheel_height, and cajun::dyn_sim_object_t::wheel_width.
Referenced by read_object_file().
void sim_world_t::remove_collision_joints | ( | ) | [private] |
References m_contact_group.
Referenced by start_world().
void sim_world_t::start_world | ( | ) |
References check_collisions(), DELAY_ODE_UPDATE, get_avg_step_time(), m_access_data, m_current_time, m_no_sleep, m_objects, m_play_value, m_playback_control_data, m_prev_time, m_publish_objects, m_publish_points, m_sim_time, m_sleep_time, m_step_hist, m_step_hist_counter, m_world_body, obstacle_data_list, obstacle_point_list, remove_collision_joints(), and STEP_HIST_SIZE.
Referenced by main().
access_data_t* cajun::sim_world_t::m_access_data [private] |
Referenced by add_object(), sim_world_t(), and start_world().
dJointGroupID sim_world_t::m_contact_group [static, private] |
Referenced by collision_callback(), remove_collision_joints(), and sim_world_t().
double cajun::sim_world_t::m_current_time [private] |
Referenced by sim_world_t(), and start_world().
dGeomID cajun::sim_world_t::m_ground [private] |
Referenced by add_object(), and sim_world_t().
char const* cajun::sim_world_t::m_lane_dir [private] |
Referenced by add_object(), and sim_world_t().
bool cajun::sim_world_t::m_no_sleep [private] |
Referenced by sim_world_t(), and start_world().
char const* cajun::sim_world_t::m_object_file [private] |
Referenced by sim_world_t().
std::vector<sim_world_object_t *> cajun::sim_world_t::m_objects [private] |
Referenced by add_object(), and start_world().
double cajun::sim_world_t::m_play_value [private] |
Referenced by sim_world_t(), and start_world().
playback_control_data_t cajun::sim_world_t::m_playback_control_data [private] |
Referenced by start_world().
double cajun::sim_world_t::m_prev_time [private] |
Referenced by sim_world_t(), and start_world().
bool cajun::sim_world_t::m_publish_objects [private] |
Referenced by sim_world_t(), and start_world().
bool cajun::sim_world_t::m_publish_points [private] |
Referenced by sim_world_t(), and start_world().
rndf_t* cajun::sim_world_t::m_rndf [private] |
Referenced by add_object(), read_object_file_v2(), and sim_world_t().
rndf_tool_t* cajun::sim_world_t::m_rndf_tool [private] |
Referenced by add_object(), and sim_world_t().
Referenced by add_object(), sim_world_t(), and ~sim_world_t().
sim_time_data_t cajun::sim_world_t::m_sim_time [private] |
Referenced by sim_world_t(), and start_world().
unsigned cajun::sim_world_t::m_sleep_time [private] |
Referenced by sim_world_t(), and start_world().
double cajun::sim_world_t::m_step_hist[STEP_HIST_SIZE] [private] |
Referenced by get_avg_step_time(), sim_world_t(), and start_world().
unsigned cajun::sim_world_t::m_step_hist_counter [private] |
Referenced by sim_world_t(), and start_world().
double cajun::sim_world_t::m_step_increment [private] |
Referenced by sim_world_t().
dWorldID sim_world_t::m_world_body [static, private] |
Referenced by add_object(), collision_callback(), sim_world_t(), and start_world().
dSpaceID cajun::sim_world_t::m_world_space [private] |
Referenced by add_object(), check_collisions(), and sim_world_t().
std::vector<obstacle_data_t>* cajun::sim_world_t::obstacle_data_list [private] |
Referenced by start_world().
std::vector<obstacle_points_data_t>* cajun::sim_world_t::obstacle_point_list [private] |
Referenced by start_world().