#include <gazebo_ros_kobuki.h>
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... | |
Definition at line 77 of file gazebo_ros_kobuki.h.
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.
|
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.
|
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.
|
private |
Definition at line 261 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 183 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 288 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 51 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 44 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 153 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 96 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 163 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 118 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Definition at line 223 of file gazebo_ros_kobuki_updates.cpp.
|
private |
Callback for resetting the odometry data.
Definition at line 163 of file gazebo_ros_kobuki.cpp.
|
private |
Definition at line 318 of file gazebo_ros_kobuki_loads.cpp.
|
private |
Spin method for the spinner thread.
Definition at line 128 of file gazebo_ros_kobuki.cpp.
|
private |
Definition at line 313 of file gazebo_ros_kobuki_updates.cpp.
|
private |
Definition at line 238 of file gazebo_ros_kobuki_updates.cpp.
|
private |
Definition at line 165 of file gazebo_ros_kobuki_updates.cpp.
|
private |
Definition at line 42 of file gazebo_ros_kobuki_updates.cpp.
|
private |
Definition at line 69 of file gazebo_ros_kobuki_updates.cpp.
|
private |
Pointer to bumper sensor simulating Kobuki's left, centre and right bumper sensors.
Definition at line 217 of file gazebo_ros_kobuki.h.
|
private |
Flag for left bumper's current state.
Definition at line 231 of file gazebo_ros_kobuki.h.
|
private |
Flag for center bumper's last state.
Definition at line 225 of file gazebo_ros_kobuki.h.
|
private |
Kobuki ROS message for bumper event.
Definition at line 221 of file gazebo_ros_kobuki.h.
|
private |
ROS publisher for bumper events.
Definition at line 219 of file gazebo_ros_kobuki.h.
|
private |
Flag for left bumper's current state.
Definition at line 229 of file gazebo_ros_kobuki.h.
|
private |
Flag for left bumper's last state.
Definition at line 223 of file gazebo_ros_kobuki.h.
|
private |
Flag for left bumper's current state.
Definition at line 233 of file gazebo_ros_kobuki.h.
|
private |
Flag for right bumper's last state.
Definition at line 227 of file gazebo_ros_kobuki.h.
|
private |
Cliff flag for the center sensor.
Definition at line 209 of file gazebo_ros_kobuki.h.
|
private |
Cliff flag for the left sensor.
Definition at line 207 of file gazebo_ros_kobuki.h.
|
private |
Cliff flag for the right sensor.
Definition at line 211 of file gazebo_ros_kobuki.h.
|
private |
measured distance in meter for detecting a cliff
Definition at line 213 of file gazebo_ros_kobuki.h.
|
private |
Kobuki ROS message for cliff event.
Definition at line 205 of file gazebo_ros_kobuki.h.
|
private |
ROS publisher for cliff detection events.
Definition at line 203 of file gazebo_ros_kobuki.h.
|
private |
Pointer to frontal cliff sensor.
Definition at line 199 of file gazebo_ros_kobuki.h.
|
private |
Pointer to left cliff sensor.
Definition at line 197 of file gazebo_ros_kobuki.h.
|
private |
Pointer to left right sensor.
Definition at line 201 of file gazebo_ros_kobuki.h.
|
private |
ROS subscriber for velocity commands.
Definition at line 165 of file gazebo_ros_kobuki.h.
|
private |
Time out for velocity commands in seconds.
Definition at line 169 of file gazebo_ros_kobuki.h.
|
private |
Maximum distance to floor.
Definition at line 215 of file gazebo_ros_kobuki.h.
|
private |
pointer to the gazebo ros node
Definition at line 142 of file gazebo_ros_kobuki.h.
|
private |
Pointer to IMU sensor model.
Definition at line 235 of file gazebo_ros_kobuki.h.
|
private |
ROS message for publishing IMU data.
Definition at line 247 of file gazebo_ros_kobuki.h.
|
private |
ROS publisher for IMU data.
Definition at line 245 of file gazebo_ros_kobuki.h.
|
private |
ROS message for joint sates.
Definition at line 163 of file gazebo_ros_kobuki.h.
|
private |
ROS publisher for joint state messages.
Definition at line 161 of file gazebo_ros_kobuki.h.
|
private |
Pointers to Gazebo's joints.
Definition at line 155 of file gazebo_ros_kobuki.h.
|
private |
Simulation time of the last velocity command (used for time out)
Definition at line 167 of file gazebo_ros_kobuki.h.
|
private |
Left wheel's joint name.
Definition at line 157 of file gazebo_ros_kobuki.h.
|
private |
pointer to the model
Definition at line 140 of file gazebo_ros_kobuki.h.
|
private |
ROS subscriber for motor power commands.
Definition at line 151 of file gazebo_ros_kobuki.h.
|
private |
Flag indicating if the motors are turned on or not.
Definition at line 153 of file gazebo_ros_kobuki.h.
|
private |
ROS node handles (relative & private)
Definition at line 129 of file gazebo_ros_kobuki.h.
|
private |
Definition at line 129 of file gazebo_ros_kobuki.h.
|
private |
node name
Definition at line 131 of file gazebo_ros_kobuki.h.
|
private |
ROS message for odometry data.
Definition at line 189 of file gazebo_ros_kobuki.h.
|
private |
Vector for pose.
Definition at line 179 of file gazebo_ros_kobuki.h.
|
private |
ROS publisher for odometry messages.
Definition at line 187 of file gazebo_ros_kobuki.h.
|
private |
ROS subscriber for reseting the odometry data.
Definition at line 249 of file gazebo_ros_kobuki.h.
|
private |
TF transform for the odom frame.
Definition at line 195 of file gazebo_ros_kobuki.h.
|
private |
Vector for velocity.
Definition at line 181 of file gazebo_ros_kobuki.h.
|
private |
Pointer to pose covariance matrix.
Definition at line 183 of file gazebo_ros_kobuki.h.
|
private |
Simulation time on previous update.
Definition at line 149 of file gazebo_ros_kobuki.h.
|
private |
Flag for (not) publish tf transform for odom -> robot.
Definition at line 191 of file gazebo_ros_kobuki.h.
|
private |
Right wheel's joint name.
Definition at line 159 of file gazebo_ros_kobuki.h.
|
private |
Definition at line 143 of file gazebo_ros_kobuki.h.
|
private |
extra thread for triggering ROS callbacks
flag for shutting down the spinner thread
Definition at line 138 of file gazebo_ros_kobuki.h.
|
private |
TF transform publisher for the odom frame.
Definition at line 193 of file gazebo_ros_kobuki.h.
|
private |
TF Prefix.
Definition at line 134 of file gazebo_ros_kobuki.h.
|
private |
Max. torque applied to the wheels.
Definition at line 173 of file gazebo_ros_kobuki.h.
|
private |
Pointer to twist covariance matrix.
Definition at line 185 of file gazebo_ros_kobuki.h.
|
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.
|
private |
Storage for the angular velocity reported by the IMU.
Definition at line 241 of file gazebo_ros_kobuki.h.
|
private |
Diameter of the wheels.
Definition at line 177 of file gazebo_ros_kobuki.h.
|
private |
Separation between the wheels.
Definition at line 175 of file gazebo_ros_kobuki.h.
|
private |
Speeds of the wheels.
Definition at line 171 of file gazebo_ros_kobuki.h.
|
private |
pointer to simulated world
Definition at line 145 of file gazebo_ros_kobuki.h.