#include <gazebo_ros_kobuki.h>
Public Member Functions | |
GazeboRosKobuki () | |
Constructor. | |
void | Load (physics::ModelPtr parent, sdf::ElementPtr sdf) |
Called when plugin is loaded. | |
void | OnUpdate () |
Called by the world update start event. | |
~GazeboRosKobuki () | |
Destructor. | |
Private Member Functions | |
void | cmdVelCB (const geometry_msgs::TwistConstPtr &msg) |
Callback for incoming velocity commands. | |
void | motorPowerCB (const kobuki_msgs::MotorPowerPtr &msg) |
Callback for incoming velocity commands. | |
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. | |
void | setupRosApi (std::string &model_name) |
void | spin () |
Spin method for the spinner thread. | |
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. | |
bool | bumper_center_is_pressed_ |
Flag for left bumper's current state. | |
bool | bumper_center_was_pressed_ |
Flag for center bumper's last state. | |
kobuki_msgs::BumperEvent | bumper_event_ |
Kobuki ROS message for bumper event. | |
ros::Publisher | bumper_event_pub_ |
ROS publisher for bumper events. | |
bool | bumper_left_is_pressed_ |
Flag for left bumper's current state. | |
bool | bumper_left_was_pressed_ |
Flag for left bumper's last state. | |
bool | bumper_right_is_pressed_ |
Flag for left bumper's current state. | |
bool | bumper_right_was_pressed_ |
Flag for right bumper's last state. | |
bool | cliff_detected_center_ |
Cliff flag for the center sensor. | |
bool | cliff_detected_left_ |
Cliff flag for the left sensor. | |
bool | cliff_detected_right_ |
Cliff flag for the right sensor. | |
float | cliff_detection_threshold_ |
measured distance in meter for detecting a cliff | |
kobuki_msgs::CliffEvent | cliff_event_ |
Kobuki ROS message for cliff event. | |
ros::Publisher | cliff_event_pub_ |
ROS publisher for cliff detection events. | |
sensors::RaySensorPtr | cliff_sensor_center_ |
Pointer to frontal cliff sensor. | |
sensors::RaySensorPtr | cliff_sensor_left_ |
Pointer to left cliff sensor. | |
sensors::RaySensorPtr | cliff_sensor_right_ |
Pointer to left right sensor. | |
ros::Subscriber | cmd_vel_sub_ |
ROS subscriber for velocity commands. | |
double | cmd_vel_timeout_ |
Time out for velocity commands in seconds. | |
int | floot_dist_ |
Maximum distance to floor. | |
GazeboRosPtr | gazebo_ros_ |
pointer to the gazebo ros node | |
sensors::ImuSensorPtr | imu_ |
Pointer to IMU sensor model. | |
sensor_msgs::Imu | imu_msg_ |
ROS message for publishing IMU data. | |
ros::Publisher | imu_pub_ |
ROS publisher for IMU data. | |
sensor_msgs::JointState | joint_state_ |
ROS message for joint sates. | |
ros::Publisher | joint_state_pub_ |
ROS publisher for joint state messages. | |
physics::JointPtr | joints_ [2] |
Pointers to Gazebo's joints. | |
common::Time | last_cmd_vel_time_ |
Simulation time of the last velocity command (used for time out) | |
std::string | left_wheel_joint_name_ |
Left wheel's joint name. | |
physics::ModelPtr | model_ |
pointer to the model | |
ros::Subscriber | motor_power_sub_ |
ROS subscriber for motor power commands. | |
bool | motors_enabled_ |
Flag indicating if the motors are turned on or not. | |
ros::NodeHandle | nh_ |
ROS node handles (relative & private) | |
ros::NodeHandle | nh_priv_ |
std::string | node_name_ |
node name | |
nav_msgs::Odometry | odom_ |
ROS message for odometry data. | |
double | odom_pose_ [3] |
Vector for pose. | |
ros::Publisher | odom_pub_ |
ROS publisher for odometry messages. | |
ros::Subscriber | odom_reset_sub_ |
ROS subscriber for reseting the odometry data. | |
geometry_msgs::TransformStamped | odom_tf_ |
TF transform for the odom frame. | |
double | odom_vel_ [3] |
Vector for velocity. | |
double * | pose_cov_ [36] |
Pointer to pose covariance matrix. | |
common::Time | prev_update_time_ |
Simulation time on previous update. | |
bool | publish_tf_ |
Flag for (not) publish tf transform for odom -> robot. | |
std::string | right_wheel_joint_name_ |
Right wheel's joint name. | |
sdf::ElementPtr | sdf_ |
bool | shutdown_requested_ |
extra thread for triggering ROS callbacks | |
tf::TransformBroadcaster | tf_broadcaster_ |
TF transform publisher for the odom frame. | |
std::string | tf_prefix_ |
TF Prefix. | |
double | torque_ |
Max. torque applied to the wheels. | |
double * | twist_cov_ [36] |
Pointer to twist covariance matrix. | |
event::ConnectionPtr | update_connection_ |
pointer to the update event connection (triggers the OnUpdate callback when event update event is received) | |
math::Vector3 | vel_angular_ |
Storage for the angular velocity reported by the IMU. | |
double | wheel_diam_ |
Diameter of the wheels. | |
double | wheel_sep_ |
Separation between the wheels. | |
double | wheel_speed_cmd_ [2] |
Speeds of the wheels. | |
physics::WorldPtr | world_ |
pointer to simulated world |
Definition at line 71 of file gazebo_ros_kobuki.h.
Constructor.
Definition at line 14 of file gazebo_ros_kobuki.cpp.
Destructor.
Definition at line 24 of file gazebo_ros_kobuki.cpp.
void gazebo::GazeboRosKobuki::cmdVelCB | ( | const geometry_msgs::TwistConstPtr & | msg | ) | [private] |
Callback for incoming velocity commands.
Definition at line 133 of file gazebo_ros_kobuki.cpp.
void gazebo::GazeboRosKobuki::Load | ( | physics::ModelPtr | parent, |
sdf::ElementPtr | sdf | ||
) |
Called when plugin is loaded.
Definition at line 35 of file gazebo_ros_kobuki.cpp.
void gazebo::GazeboRosKobuki::motorPowerCB | ( | const kobuki_msgs::MotorPowerPtr & | msg | ) | [private] |
Callback for incoming velocity commands.
Definition at line 119 of file gazebo_ros_kobuki.cpp.
void gazebo::GazeboRosKobuki::OnUpdate | ( | ) |
Called by the world update start event.
Definition at line 88 of file gazebo_ros_kobuki.cpp.
bool gazebo::GazeboRosKobuki::prepareBumper | ( | ) | [private] |
Definition at line 257 of file gazebo_ros_kobuki_loads.cpp.
bool gazebo::GazeboRosKobuki::prepareCliffSensor | ( | ) | [private] |
Definition at line 179 of file gazebo_ros_kobuki_loads.cpp.
bool gazebo::GazeboRosKobuki::prepareIMU | ( | ) | [private] |
Definition at line 284 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 172 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 140 of file gazebo_ros_kobuki.cpp.
void gazebo::GazeboRosKobuki::setupRosApi | ( | std::string & | model_name | ) | [private] |
Definition at line 308 of file gazebo_ros_kobuki_loads.cpp.
void gazebo::GazeboRosKobuki::spin | ( | ) | [private] |
Spin method for the spinner thread.
Definition at line 110 of file gazebo_ros_kobuki.cpp.
void gazebo::GazeboRosKobuki::updateBumper | ( | ) | [private] |
Definition at line 264 of file gazebo_ros_kobuki_updates.cpp.
void gazebo::GazeboRosKobuki::updateCliffSensor | ( | ) | [private] |
Definition at line 189 of file gazebo_ros_kobuki_updates.cpp.
void gazebo::GazeboRosKobuki::updateIMU | ( | ) | [private] |
Definition at line 144 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 60 of file gazebo_ros_kobuki_updates.cpp.
sensors::ContactSensorPtr gazebo::GazeboRosKobuki::bumper_ [private] |
Pointer to bumper sensor simulating Kobuki's left, centre and right bumper sensors.
Definition at line 211 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::bumper_center_is_pressed_ [private] |
Flag for left bumper's current state.
Definition at line 225 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::bumper_center_was_pressed_ [private] |
Flag for center bumper's last state.
Definition at line 219 of file gazebo_ros_kobuki.h.
kobuki_msgs::BumperEvent gazebo::GazeboRosKobuki::bumper_event_ [private] |
Kobuki ROS message for bumper event.
Definition at line 215 of file gazebo_ros_kobuki.h.
ROS publisher for bumper events.
Definition at line 213 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::bumper_left_is_pressed_ [private] |
Flag for left bumper's current state.
Definition at line 223 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::bumper_left_was_pressed_ [private] |
Flag for left bumper's last state.
Definition at line 217 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::bumper_right_is_pressed_ [private] |
Flag for left bumper's current state.
Definition at line 227 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::bumper_right_was_pressed_ [private] |
Flag for right bumper's last state.
Definition at line 221 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::cliff_detected_center_ [private] |
Cliff flag for the center sensor.
Definition at line 203 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::cliff_detected_left_ [private] |
Cliff flag for the left sensor.
Definition at line 201 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::cliff_detected_right_ [private] |
Cliff flag for the right sensor.
Definition at line 205 of file gazebo_ros_kobuki.h.
float gazebo::GazeboRosKobuki::cliff_detection_threshold_ [private] |
measured distance in meter for detecting a cliff
Definition at line 207 of file gazebo_ros_kobuki.h.
kobuki_msgs::CliffEvent gazebo::GazeboRosKobuki::cliff_event_ [private] |
Kobuki ROS message for cliff event.
Definition at line 199 of file gazebo_ros_kobuki.h.
ROS publisher for cliff detection events.
Definition at line 197 of file gazebo_ros_kobuki.h.
sensors::RaySensorPtr gazebo::GazeboRosKobuki::cliff_sensor_center_ [private] |
Pointer to frontal cliff sensor.
Definition at line 193 of file gazebo_ros_kobuki.h.
sensors::RaySensorPtr gazebo::GazeboRosKobuki::cliff_sensor_left_ [private] |
Pointer to left cliff sensor.
Definition at line 191 of file gazebo_ros_kobuki.h.
sensors::RaySensorPtr gazebo::GazeboRosKobuki::cliff_sensor_right_ [private] |
Pointer to left right sensor.
Definition at line 195 of file gazebo_ros_kobuki.h.
ROS subscriber for velocity commands.
Definition at line 159 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::cmd_vel_timeout_ [private] |
Time out for velocity commands in seconds.
Definition at line 163 of file gazebo_ros_kobuki.h.
int gazebo::GazeboRosKobuki::floot_dist_ [private] |
Maximum distance to floor.
Definition at line 209 of file gazebo_ros_kobuki.h.
pointer to the gazebo ros node
Definition at line 136 of file gazebo_ros_kobuki.h.
sensors::ImuSensorPtr gazebo::GazeboRosKobuki::imu_ [private] |
Pointer to IMU sensor model.
Definition at line 229 of file gazebo_ros_kobuki.h.
sensor_msgs::Imu gazebo::GazeboRosKobuki::imu_msg_ [private] |
ROS message for publishing IMU data.
Definition at line 235 of file gazebo_ros_kobuki.h.
ROS publisher for IMU data.
Definition at line 233 of file gazebo_ros_kobuki.h.
sensor_msgs::JointState gazebo::GazeboRosKobuki::joint_state_ [private] |
ROS message for joint sates.
Definition at line 157 of file gazebo_ros_kobuki.h.
ROS publisher for joint state messages.
Definition at line 155 of file gazebo_ros_kobuki.h.
physics::JointPtr gazebo::GazeboRosKobuki::joints_[2] [private] |
Pointers to Gazebo's joints.
Definition at line 149 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 161 of file gazebo_ros_kobuki.h.
Left wheel's joint name.
Definition at line 151 of file gazebo_ros_kobuki.h.
physics::ModelPtr gazebo::GazeboRosKobuki::model_ [private] |
pointer to the model
Definition at line 134 of file gazebo_ros_kobuki.h.
ROS subscriber for motor power commands.
Definition at line 145 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 147 of file gazebo_ros_kobuki.h.
ros::NodeHandle gazebo::GazeboRosKobuki::nh_ [private] |
ROS node handles (relative & private)
Definition at line 123 of file gazebo_ros_kobuki.h.
Definition at line 123 of file gazebo_ros_kobuki.h.
node name
Definition at line 125 of file gazebo_ros_kobuki.h.
nav_msgs::Odometry gazebo::GazeboRosKobuki::odom_ [private] |
ROS message for odometry data.
Definition at line 183 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::odom_pose_[3] [private] |
Vector for pose.
Definition at line 173 of file gazebo_ros_kobuki.h.
ROS publisher for odometry messages.
Definition at line 181 of file gazebo_ros_kobuki.h.
ROS subscriber for reseting the odometry data.
Definition at line 237 of file gazebo_ros_kobuki.h.
geometry_msgs::TransformStamped gazebo::GazeboRosKobuki::odom_tf_ [private] |
TF transform for the odom frame.
Definition at line 189 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::odom_vel_[3] [private] |
Vector for velocity.
Definition at line 175 of file gazebo_ros_kobuki.h.
double* gazebo::GazeboRosKobuki::pose_cov_[36] [private] |
Pointer to pose covariance matrix.
Definition at line 177 of file gazebo_ros_kobuki.h.
common::Time gazebo::GazeboRosKobuki::prev_update_time_ [private] |
Simulation time on previous update.
Definition at line 143 of file gazebo_ros_kobuki.h.
bool gazebo::GazeboRosKobuki::publish_tf_ [private] |
Flag for (not) publish tf transform for odom -> robot.
Definition at line 185 of file gazebo_ros_kobuki.h.
Right wheel's joint name.
Definition at line 153 of file gazebo_ros_kobuki.h.
sdf::ElementPtr gazebo::GazeboRosKobuki::sdf_ [private] |
Definition at line 137 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 132 of file gazebo_ros_kobuki.h.
TF transform publisher for the odom frame.
Definition at line 187 of file gazebo_ros_kobuki.h.
TF Prefix.
Definition at line 128 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::torque_ [private] |
Max. torque applied to the wheels.
Definition at line 167 of file gazebo_ros_kobuki.h.
double* gazebo::GazeboRosKobuki::twist_cov_[36] [private] |
Pointer to twist covariance matrix.
Definition at line 179 of file gazebo_ros_kobuki.h.
pointer to the update event connection (triggers the OnUpdate callback when event update event is received)
Definition at line 141 of file gazebo_ros_kobuki.h.
Storage for the angular velocity reported by the IMU.
Definition at line 231 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::wheel_diam_ [private] |
Diameter of the wheels.
Definition at line 171 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::wheel_sep_ [private] |
Separation between the wheels.
Definition at line 169 of file gazebo_ros_kobuki.h.
double gazebo::GazeboRosKobuki::wheel_speed_cmd_[2] [private] |
Speeds of the wheels.
Definition at line 165 of file gazebo_ros_kobuki.h.
physics::WorldPtr gazebo::GazeboRosKobuki::world_ [private] |
pointer to simulated world
Definition at line 139 of file gazebo_ros_kobuki.h.