Public Member Functions | Private Member Functions | Private Attributes | List of all members
gazebo::GazeboRosKobuki Class Reference

#include <gazebo_ros_kobuki.h>

Inheritance diagram for gazebo::GazeboRosKobuki:
Inheritance graph
[legend]

Public Member Functions

 GazeboRosKobuki ()
 Constructor. More...
 
void Load (physics::ModelPtr parent, sdf::ElementPtr sdf)
 Called when plugin is loaded. More...
 
void OnUpdate ()
 Called by the world update start event. More...
 
 ~GazeboRosKobuki ()
 Destructor. More...
 

Private Member Functions

void cmdVelCB (const geometry_msgs::TwistConstPtr &msg)
 Callback for incoming velocity commands. More...
 
void motorPowerCB (const kobuki_msgs::MotorPowerPtr &msg)
 Callback for incoming velocity commands. More...
 
bool prepareBumper ()
 
bool prepareCliffSensor ()
 
bool prepareIMU ()
 
bool prepareJointState ()
 
void prepareMotorPower ()
 
void prepareOdom ()
 
void preparePublishTf ()
 
bool prepareVelocityCommand ()
 
bool prepareWheelAndTorque ()
 
void propagateVelocityCommands ()
 
void resetOdomCB (const std_msgs::EmptyConstPtr &msg)
 Callback for resetting the odometry data. More...
 
void setupRosApi (std::string &model_name)
 
void spin ()
 Spin method for the spinner thread. More...
 
void updateBumper ()
 
void updateCliffSensor ()
 
void updateIMU ()
 
void updateJointState ()
 
void updateOdometry (common::Time &step_time)
 

Private Attributes

sensors::ContactSensorPtr bumper_
 Pointer to bumper sensor simulating Kobuki's left, centre and right bumper sensors. More...
 
bool bumper_center_is_pressed_
 Flag for left bumper's current state. More...
 
bool bumper_center_was_pressed_
 Flag for center bumper's last state. More...
 
kobuki_msgs::BumperEvent bumper_event_
 Kobuki ROS message for bumper event. More...
 
ros::Publisher bumper_event_pub_
 ROS publisher for bumper events. More...
 
bool bumper_left_is_pressed_
 Flag for left bumper's current state. More...
 
bool bumper_left_was_pressed_
 Flag for left bumper's last state. More...
 
bool bumper_right_is_pressed_
 Flag for left bumper's current state. More...
 
bool bumper_right_was_pressed_
 Flag for right bumper's last state. More...
 
bool cliff_detected_center_
 Cliff flag for the center sensor. More...
 
bool cliff_detected_left_
 Cliff flag for the left sensor. More...
 
bool cliff_detected_right_
 Cliff flag for the right sensor. More...
 
float cliff_detection_threshold_
 measured distance in meter for detecting a cliff More...
 
kobuki_msgs::CliffEvent cliff_event_
 Kobuki ROS message for cliff event. More...
 
ros::Publisher cliff_event_pub_
 ROS publisher for cliff detection events. More...
 
sensors::RaySensorPtr cliff_sensor_center_
 Pointer to frontal cliff sensor. More...
 
sensors::RaySensorPtr cliff_sensor_left_
 Pointer to left cliff sensor. More...
 
sensors::RaySensorPtr cliff_sensor_right_
 Pointer to left right sensor. More...
 
ros::Subscriber cmd_vel_sub_
 ROS subscriber for velocity commands. More...
 
double cmd_vel_timeout_
 Time out for velocity commands in seconds. More...
 
int floot_dist_
 Maximum distance to floor. More...
 
GazeboRosPtr gazebo_ros_
 pointer to the gazebo ros node More...
 
sensors::ImuSensorPtr imu_
 Pointer to IMU sensor model. More...
 
sensor_msgs::Imu imu_msg_
 ROS message for publishing IMU data. More...
 
ros::Publisher imu_pub_
 ROS publisher for IMU data. More...
 
sensor_msgs::JointState joint_state_
 ROS message for joint sates. More...
 
ros::Publisher joint_state_pub_
 ROS publisher for joint state messages. More...
 
physics::JointPtr joints_ [2]
 Pointers to Gazebo's joints. More...
 
common::Time last_cmd_vel_time_
 Simulation time of the last velocity command (used for time out) More...
 
std::string left_wheel_joint_name_
 Left wheel's joint name. More...
 
physics::ModelPtr model_
 pointer to the model More...
 
ros::Subscriber motor_power_sub_
 ROS subscriber for motor power commands. More...
 
bool motors_enabled_
 Flag indicating if the motors are turned on or not. More...
 
ros::NodeHandle nh_
 ROS node handles (relative & private) More...
 
ros::NodeHandle nh_priv_
 
std::string node_name_
 node name More...
 
nav_msgs::Odometry odom_
 ROS message for odometry data. More...
 
double odom_pose_ [3]
 Vector for pose. More...
 
ros::Publisher odom_pub_
 ROS publisher for odometry messages. More...
 
ros::Subscriber odom_reset_sub_
 ROS subscriber for reseting the odometry data. More...
 
geometry_msgs::TransformStamped odom_tf_
 TF transform for the odom frame. More...
 
double odom_vel_ [3]
 Vector for velocity. More...
 
double * pose_cov_ [36]
 Pointer to pose covariance matrix. More...
 
common::Time prev_update_time_
 Simulation time on previous update. More...
 
bool publish_tf_
 Flag for (not) publish tf transform for odom -> robot. More...
 
std::string right_wheel_joint_name_
 Right wheel's joint name. More...
 
sdf::ElementPtr sdf_
 
bool shutdown_requested_
 extra thread for triggering ROS callbacks More...
 
tf::TransformBroadcaster tf_broadcaster_
 TF transform publisher for the odom frame. More...
 
std::string tf_prefix_
 TF Prefix. More...
 
double torque_
 Max. torque applied to the wheels. More...
 
double * twist_cov_ [36]
 Pointer to twist covariance matrix. More...
 
event::ConnectionPtr update_connection_
 pointer to the update event connection (triggers the OnUpdate callback when event update event is received) More...
 
math::Vector3 vel_angular_
 Storage for the angular velocity reported by the IMU. More...
 
double wheel_diam_
 Diameter of the wheels. More...
 
double wheel_sep_
 Separation between the wheels. More...
 
double wheel_speed_cmd_ [2]
 Speeds of the wheels. More...
 
physics::WorldPtr world_
 pointer to simulated world More...
 

Detailed Description

Definition at line 77 of file gazebo_ros_kobuki.h.

Constructor & Destructor Documentation

gazebo::GazeboRosKobuki::GazeboRosKobuki ( )

Constructor.

Definition at line 20 of file gazebo_ros_kobuki.cpp.

gazebo::GazeboRosKobuki::~GazeboRosKobuki ( )

Destructor.

Definition at line 30 of file gazebo_ros_kobuki.cpp.

Member Function Documentation

void gazebo::GazeboRosKobuki::cmdVelCB ( const geometry_msgs::TwistConstPtr &  msg)
private

Callback for incoming velocity commands.

Definition at line 151 of file gazebo_ros_kobuki.cpp.

void gazebo::GazeboRosKobuki::Load ( physics::ModelPtr  parent,
sdf::ElementPtr  sdf 
)

Called when plugin is loaded.

Definition at line 41 of file gazebo_ros_kobuki.cpp.

void gazebo::GazeboRosKobuki::motorPowerCB ( const kobuki_msgs::MotorPowerPtr &  msg)
private

Callback for incoming velocity commands.

Definition at line 137 of file gazebo_ros_kobuki.cpp.

void gazebo::GazeboRosKobuki::OnUpdate ( )

Called by the world update start event.

Definition at line 100 of file gazebo_ros_kobuki.cpp.

bool gazebo::GazeboRosKobuki::prepareBumper ( )
private

Definition at line 261 of file gazebo_ros_kobuki_loads.cpp.

bool gazebo::GazeboRosKobuki::prepareCliffSensor ( )
private

Definition at line 183 of file gazebo_ros_kobuki_loads.cpp.

bool gazebo::GazeboRosKobuki::prepareIMU ( )
private

Definition at line 288 of file gazebo_ros_kobuki_loads.cpp.

bool gazebo::GazeboRosKobuki::prepareJointState ( )
private

Definition at line 51 of file gazebo_ros_kobuki_loads.cpp.

void gazebo::GazeboRosKobuki::prepareMotorPower ( )
private

Definition at line 44 of file gazebo_ros_kobuki_loads.cpp.

void gazebo::GazeboRosKobuki::prepareOdom ( )
private

Definition at line 153 of file gazebo_ros_kobuki_loads.cpp.

void gazebo::GazeboRosKobuki::preparePublishTf ( )
private

Definition at line 96 of file gazebo_ros_kobuki_loads.cpp.

bool gazebo::GazeboRosKobuki::prepareVelocityCommand ( )
private

Definition at line 163 of file gazebo_ros_kobuki_loads.cpp.

bool gazebo::GazeboRosKobuki::prepareWheelAndTorque ( )
private

Definition at line 118 of file gazebo_ros_kobuki_loads.cpp.

void gazebo::GazeboRosKobuki::propagateVelocityCommands ( )
private

Definition at line 223 of file gazebo_ros_kobuki_updates.cpp.

void gazebo::GazeboRosKobuki::resetOdomCB ( const std_msgs::EmptyConstPtr &  msg)
private

Callback for resetting the odometry data.

Definition at line 163 of file gazebo_ros_kobuki.cpp.

void gazebo::GazeboRosKobuki::setupRosApi ( std::string &  model_name)
private

Definition at line 318 of file gazebo_ros_kobuki_loads.cpp.

void gazebo::GazeboRosKobuki::spin ( )
private

Spin method for the spinner thread.

Definition at line 128 of file gazebo_ros_kobuki.cpp.

void gazebo::GazeboRosKobuki::updateBumper ( )
private

Definition at line 313 of file gazebo_ros_kobuki_updates.cpp.

void gazebo::GazeboRosKobuki::updateCliffSensor ( )
private

Definition at line 238 of file gazebo_ros_kobuki_updates.cpp.

void gazebo::GazeboRosKobuki::updateIMU ( )
private

Definition at line 165 of file gazebo_ros_kobuki_updates.cpp.

void gazebo::GazeboRosKobuki::updateJointState ( )
private

Definition at line 42 of file gazebo_ros_kobuki_updates.cpp.

void gazebo::GazeboRosKobuki::updateOdometry ( common::Time &  step_time)
private

Definition at line 69 of file gazebo_ros_kobuki_updates.cpp.

Member Data Documentation

sensors::ContactSensorPtr gazebo::GazeboRosKobuki::bumper_
private

Pointer to bumper sensor simulating Kobuki's left, centre and right bumper sensors.

Definition at line 217 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::bumper_center_is_pressed_
private

Flag for left bumper's current state.

Definition at line 231 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::bumper_center_was_pressed_
private

Flag for center bumper's last state.

Definition at line 225 of file gazebo_ros_kobuki.h.

kobuki_msgs::BumperEvent gazebo::GazeboRosKobuki::bumper_event_
private

Kobuki ROS message for bumper event.

Definition at line 221 of file gazebo_ros_kobuki.h.

ros::Publisher gazebo::GazeboRosKobuki::bumper_event_pub_
private

ROS publisher for bumper events.

Definition at line 219 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::bumper_left_is_pressed_
private

Flag for left bumper's current state.

Definition at line 229 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::bumper_left_was_pressed_
private

Flag for left bumper's last state.

Definition at line 223 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::bumper_right_is_pressed_
private

Flag for left bumper's current state.

Definition at line 233 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::bumper_right_was_pressed_
private

Flag for right bumper's last state.

Definition at line 227 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::cliff_detected_center_
private

Cliff flag for the center sensor.

Definition at line 209 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::cliff_detected_left_
private

Cliff flag for the left sensor.

Definition at line 207 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::cliff_detected_right_
private

Cliff flag for the right sensor.

Definition at line 211 of file gazebo_ros_kobuki.h.

float gazebo::GazeboRosKobuki::cliff_detection_threshold_
private

measured distance in meter for detecting a cliff

Definition at line 213 of file gazebo_ros_kobuki.h.

kobuki_msgs::CliffEvent gazebo::GazeboRosKobuki::cliff_event_
private

Kobuki ROS message for cliff event.

Definition at line 205 of file gazebo_ros_kobuki.h.

ros::Publisher gazebo::GazeboRosKobuki::cliff_event_pub_
private

ROS publisher for cliff detection events.

Definition at line 203 of file gazebo_ros_kobuki.h.

sensors::RaySensorPtr gazebo::GazeboRosKobuki::cliff_sensor_center_
private

Pointer to frontal cliff sensor.

Definition at line 199 of file gazebo_ros_kobuki.h.

sensors::RaySensorPtr gazebo::GazeboRosKobuki::cliff_sensor_left_
private

Pointer to left cliff sensor.

Definition at line 197 of file gazebo_ros_kobuki.h.

sensors::RaySensorPtr gazebo::GazeboRosKobuki::cliff_sensor_right_
private

Pointer to left right sensor.

Definition at line 201 of file gazebo_ros_kobuki.h.

ros::Subscriber gazebo::GazeboRosKobuki::cmd_vel_sub_
private

ROS subscriber for velocity commands.

Definition at line 165 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::cmd_vel_timeout_
private

Time out for velocity commands in seconds.

Definition at line 169 of file gazebo_ros_kobuki.h.

int gazebo::GazeboRosKobuki::floot_dist_
private

Maximum distance to floor.

Definition at line 215 of file gazebo_ros_kobuki.h.

GazeboRosPtr gazebo::GazeboRosKobuki::gazebo_ros_
private

pointer to the gazebo ros node

Definition at line 142 of file gazebo_ros_kobuki.h.

sensors::ImuSensorPtr gazebo::GazeboRosKobuki::imu_
private

Pointer to IMU sensor model.

Definition at line 235 of file gazebo_ros_kobuki.h.

sensor_msgs::Imu gazebo::GazeboRosKobuki::imu_msg_
private

ROS message for publishing IMU data.

Definition at line 247 of file gazebo_ros_kobuki.h.

ros::Publisher gazebo::GazeboRosKobuki::imu_pub_
private

ROS publisher for IMU data.

Definition at line 245 of file gazebo_ros_kobuki.h.

sensor_msgs::JointState gazebo::GazeboRosKobuki::joint_state_
private

ROS message for joint sates.

Definition at line 163 of file gazebo_ros_kobuki.h.

ros::Publisher gazebo::GazeboRosKobuki::joint_state_pub_
private

ROS publisher for joint state messages.

Definition at line 161 of file gazebo_ros_kobuki.h.

physics::JointPtr gazebo::GazeboRosKobuki::joints_[2]
private

Pointers to Gazebo's joints.

Definition at line 155 of file gazebo_ros_kobuki.h.

common::Time gazebo::GazeboRosKobuki::last_cmd_vel_time_
private

Simulation time of the last velocity command (used for time out)

Definition at line 167 of file gazebo_ros_kobuki.h.

std::string gazebo::GazeboRosKobuki::left_wheel_joint_name_
private

Left wheel's joint name.

Definition at line 157 of file gazebo_ros_kobuki.h.

physics::ModelPtr gazebo::GazeboRosKobuki::model_
private

pointer to the model

Definition at line 140 of file gazebo_ros_kobuki.h.

ros::Subscriber gazebo::GazeboRosKobuki::motor_power_sub_
private

ROS subscriber for motor power commands.

Definition at line 151 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::motors_enabled_
private

Flag indicating if the motors are turned on or not.

Definition at line 153 of file gazebo_ros_kobuki.h.

ros::NodeHandle gazebo::GazeboRosKobuki::nh_
private

ROS node handles (relative & private)

Definition at line 129 of file gazebo_ros_kobuki.h.

ros::NodeHandle gazebo::GazeboRosKobuki::nh_priv_
private

Definition at line 129 of file gazebo_ros_kobuki.h.

std::string gazebo::GazeboRosKobuki::node_name_
private

node name

Definition at line 131 of file gazebo_ros_kobuki.h.

nav_msgs::Odometry gazebo::GazeboRosKobuki::odom_
private

ROS message for odometry data.

Definition at line 189 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::odom_pose_[3]
private

Vector for pose.

Definition at line 179 of file gazebo_ros_kobuki.h.

ros::Publisher gazebo::GazeboRosKobuki::odom_pub_
private

ROS publisher for odometry messages.

Definition at line 187 of file gazebo_ros_kobuki.h.

ros::Subscriber gazebo::GazeboRosKobuki::odom_reset_sub_
private

ROS subscriber for reseting the odometry data.

Definition at line 249 of file gazebo_ros_kobuki.h.

geometry_msgs::TransformStamped gazebo::GazeboRosKobuki::odom_tf_
private

TF transform for the odom frame.

Definition at line 195 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::odom_vel_[3]
private

Vector for velocity.

Definition at line 181 of file gazebo_ros_kobuki.h.

double* gazebo::GazeboRosKobuki::pose_cov_[36]
private

Pointer to pose covariance matrix.

Definition at line 183 of file gazebo_ros_kobuki.h.

common::Time gazebo::GazeboRosKobuki::prev_update_time_
private

Simulation time on previous update.

Definition at line 149 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::publish_tf_
private

Flag for (not) publish tf transform for odom -> robot.

Definition at line 191 of file gazebo_ros_kobuki.h.

std::string gazebo::GazeboRosKobuki::right_wheel_joint_name_
private

Right wheel's joint name.

Definition at line 159 of file gazebo_ros_kobuki.h.

sdf::ElementPtr gazebo::GazeboRosKobuki::sdf_
private

Definition at line 143 of file gazebo_ros_kobuki.h.

bool gazebo::GazeboRosKobuki::shutdown_requested_
private

extra thread for triggering ROS callbacks

flag for shutting down the spinner thread

Definition at line 138 of file gazebo_ros_kobuki.h.

tf::TransformBroadcaster gazebo::GazeboRosKobuki::tf_broadcaster_
private

TF transform publisher for the odom frame.

Definition at line 193 of file gazebo_ros_kobuki.h.

std::string gazebo::GazeboRosKobuki::tf_prefix_
private

TF Prefix.

Definition at line 134 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::torque_
private

Max. torque applied to the wheels.

Definition at line 173 of file gazebo_ros_kobuki.h.

double* gazebo::GazeboRosKobuki::twist_cov_[36]
private

Pointer to twist covariance matrix.

Definition at line 185 of file gazebo_ros_kobuki.h.

event::ConnectionPtr gazebo::GazeboRosKobuki::update_connection_
private

pointer to the update event connection (triggers the OnUpdate callback when event update event is received)

Definition at line 147 of file gazebo_ros_kobuki.h.

math::Vector3 gazebo::GazeboRosKobuki::vel_angular_
private

Storage for the angular velocity reported by the IMU.

Definition at line 241 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::wheel_diam_
private

Diameter of the wheels.

Definition at line 177 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::wheel_sep_
private

Separation between the wheels.

Definition at line 175 of file gazebo_ros_kobuki.h.

double gazebo::GazeboRosKobuki::wheel_speed_cmd_[2]
private

Speeds of the wheels.

Definition at line 171 of file gazebo_ros_kobuki.h.

physics::WorldPtr gazebo::GazeboRosKobuki::world_
private

pointer to simulated world

Definition at line 145 of file gazebo_ros_kobuki.h.


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


kobuki_gazebo_plugins
Author(s): Marcus Liebhardt
autogenerated on Mon Jun 10 2019 13:52:55