ros-controls / ros_controllers

Generic robotic controllers to accompany ros_control
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
557 stars 527 forks source link

diff_drive_controller with 4-wheeled robot gives wrong odometry estimations #328

Open vbschettino opened 6 years ago

vbschettino commented 6 years ago

Hi,

I've noticed that when using diff_drive_controller with a 4-wheeled robot, or skid steer, the angular velocities obtained from the published odometry are halved.

A quick fix I'm using to mitigate the problem is to set wheel_separation_multiplier to 2 in the yaml configuration file. But I understand that this should actually be used to account for differences between the real robot and simulation.

So, is this a bug? Or am I missing something?

Thank you, Vinicius

bmagyar commented 6 years ago

@artivis ?

artivis commented 6 years ago

This is surprising as the unit-tests still passes.
@vbschettino Is it a problem you encountered after updating to the latest release ? Otherwise could you please try deploying the controller at commit https://github.com/ros-controls/ros_controllers/commit/e5a6c5a5f9f84756b6601961a5b03b7dffc5118c ? This commit is anterior to the latest changes.

vbschettino commented 6 years ago

I did not build from source, I was just using the standard binary version for Kinetic.

But I believe I made a mistake. I was actually testing this in simulation with Gazebo, using the gazebo_ros_control plugin. At first, I understood that this would load the same controllers as the one here, at ros_controllers, but now I understand that's not the case, right?. So I probably created the issue in the wrong repo. My apologies.

berkaydeniz commented 6 years ago

As someone going through this, correct me if I'm wrong, wheel separation multiplier is there since the model used for approximating the skid steer with a differential drive requires a virtual wheel separation that is a linear function of the actual value, especially when we apply the same velocity to both motors on the same side. For instance, in the skid steering example of the wiki page, this value is set to 1.5 for Jackal. My question: Is there an intuitive way to set this multiplier or is it something we need to tune?

daniel-s-ingram commented 5 years ago

@berkaydeniz, I got mine to work by counting the number of revolutions made on /tf for a single revolution of the model in Gazebo (2.25 in my case) and setting the wheel_separation parameter to that number. I'm not sure this is the best way to do it, but my odometry does match my robot much more closely now.

jorgemiar commented 4 years ago

Is there any new advice/good approach on how to set the wheel separation multiplier for a skid steer robot since this was posted?