Robotics StackExchange | Archived questions

Kobuki/Turtlebot doesn't move when given velocity commands in Gazebo 5

I'm using ROS Indigo with Gazebo 5 and kobuki_desktop compiled from source. The Kobuki shows up and can be moved when given a force on its wheel_left_joint and wheel_right_joint but does not move when libgazebo_ros_kobuki.so set SetVelocity commands. I can see that the wheels ALSO spins in this case, but there isn't forward movement aside from some jittering.

In Gazebo 2, this used to work fabulously. Does anyone know what in particular changed between these Gazebo 2 & 5 that is breaking it?

World Used: empty.world

URDF Used: kobuki.urdf.xacro

Asked by haidai on 2015-04-02 20:21:10 UTC

Comments

I think I know why this happened, and I think it's related to a change in gazebo to enable Coulomb joint friction. Let me see if I can fix it...

Asked by scpeters on 2015-04-03 19:32:37 UTC

Answers

For gazebo5, we decided to add Coulomb joint friction using the ODE joint motors (see pull request 1218 and pull request 1221). This raised a conflict with the SetVelocity and SetMaxForce API, which was also using the ODE joint motors. However, not all physics engines have joint motors (such as simbody), so we changed the meaning of SetVelocity to refer to setting the velocity state (like an initial condition), but not turning on a persistent motor controller.

The ODE joint motors are still available using the Joint::SetParam API:


joint->SetVelocity(index, velocity);
// becomes
joint->SetParam("vel", index, velocity);

and


joint->SetMaxForce(index, maxForce);
// becomes
joint->SetParam("max_force", index, maxForce);

I had also changed the behavior of the some of the gazebo plugins, which was probably a bad idea. I've restored their functionality in branch restore_max_force5. I'm guessing gazebo_ros_pkgs might need to be updated too.

Let me know if this is helping. If so, I'll make a gazebo_ros_pkgs pull request.

Asked by scpeters on 2015-04-03 19:55:30 UTC

Comments

I'm having a similar issue with gazebo6 but seem to get mixed behavior: SetParam("max_force"...) and SetVelocity(...) is the combination that gets my simulation to work. Here's the question I asked on it: http://robotics.stackexchange.com/questions/8893/gazebo-moving-joint-with-model-plugin

Asked by raequin on 2016-01-14 20:05:01 UTC

Ahh that makes sense. As when I comment out the calls to SetMaxForce in kobuki_gazebo_plugins, the robot seems to behave similarly to how it did in Gazebo 2 (gazebo_ros_kobuki_updates.cpp line 181).

Asked by haidai on 2015-04-03 23:59:40 UTC

Comments

Have you tried using SetParam instead? If it works, we should make a pull request to gazebo_ros_pkgs

Asked by scpeters on 2015-04-06 19:19:56 UTC

It works fine for me with SkidSterring plugin in gazebo_ros_pkgs. I am willing to make the pull request, but first I wanted to ask if SetParam works with Gazebo versions <5.0, otherwise a compile time check is neeeded

Asked by clynamen on 2015-04-14 09:19:30 UTC