Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Modifying DefaultRobotHWSim for realistic wheel encoders


I am trying to add realistic wheel encoders to my Gazebo simulation. I use ros_control's DiffDriveController, which sends velocity commands and reads the JointStates topic published my Gazebo.

Using the DefaultRobotHWSim interface, the perfect wheel positions and velocities are published by the plugin and used by the controller. I would like to modify these values (discretization, step miss, noise...) to simulate a real controller or to use them for odometry. I thus do not want to create a new topic, but instead to change the values of JointStates.

From the documentation, I should create my own hardware interface that inherits from RobotHWSim and pass it to gazebo_ros_control_plugin through the robotSimType field. This however does not allow me to pass arguments to the hardware interface (for example step size, step miss probability), since there seem to be no mechanism for gazebo_ros_control_plugin to transmit values to RobotHWSim, and this one can only read the .urdf and not the .sdf file (and the convention states that Gazebo-specific parameters should stay in the .sdf).

Hence my question: should I write my own gazebo_ros_control_plugin ? This seems to totally break the modular approach of ROS and Gazebo, and am thus looking for a cleaner and more efficient way...