Modifying DefaultRobotHWSim for realistic wheel encoders

asked 2017-01-17 22:16:53 -0500

Skydes gravatar image

Hello,

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...

edit retag flag offensive close merge delete

Comments

Did you manage to implement DiffDriveController in Gazebo using RobotHWSim or DefaultRobotHWSim?

Toma Tacescu gravatar imageToma Tacescu ( 2017-12-06 01:05:16 -0500 )edit