kobuki base keeps shaking in gazebo > v2

asked 2016-06-23 13:11:20 -0600

m4k gravatar image

updated 2016-08-11 15:39:46 -0600

Whatever I try, my kobuki base keeps shaking, also often referred as "wobbling" behavior in gazebo > 2

Video: https://youtu.be/aBOjJyfX10M

My environment (where I want it to work)

ROS Indigo + osrf ros_gazebo5_pkgs + kobuki(from source)

Where it works: ROS Indigo either x32/x64 with gazebo2 (same sources of kobuki - just recompile..)

Where it doesn't work: ROS + gazebo > v2

Where I tried: ROS Jade + gazebo5 ROS Indigo x32/x64 + gazebo4/gazebo5

manual compile:

  • gazebo7 -> no compile (too many errors to fix)
  • gazebo6 -> no compile (too many errors to fix)
  • gazebo5 -> compiles
  • gazebo4 -> compiles

    Fixes tried:

I found and tried several solutions, most point to the deprecated velocity /force commands.:

For me its currently unclear what's correct fmax or max_force however just commenting out should also work.

The problem in Code:


// deprecated

  joints_[LEFT]->SetVelocity(0, wheel_speed_cmd_[LEFT] / (wheel_diam_ / 2.0));
  joints_[RIGHT]->SetVelocity(0, wheel_speed_cmd_[RIGHT] / (wheel_diam_ / 2.0));

 // some suggest just comment SetMaxForce (the following)

  joints_[LEFT]->SetMaxForce(0, torque_);
  joints_[RIGHT]->SetMaxForce(0, torque_);

// some suggest this as alternative code to SetMaxForce, but max_force seems wrong, it should be fmax

  joints_[LEFT]->SetParam("max_force",0, torque_);
  joints_[RIGHT]->SetParam("max_force",0, torque_);


 // my best solution (that still didnt work)

  joints_[LEFT]->SetParam("vel",0, wheel_speed_cmd_[LEFT] / (wheel_diam_ / 2.0));
  joints_[RIGHT]->SetParam("vel",0, wheel_speed_cmd_[RIGHT] / (wheel_diam_ / 2.0));
  joints_[LEFT]->SetParam("fmax",0, torque_);
  joints_[RIGHT]->SetParam("fmax",0, torque_);


I tried various versions of this.. including just commenting everything. Yes I cleaned and recompiled everytime..

Note: Without Gravity -> no problems, but.. no gravity is not a solution

So what could also happen? damper? weight? I played with kp,kd,mu1/2, mass, inertia nothing helped.

Others had the same issue and for them it worked.. https://github.com/mayfieldrobotics/k... from forum http://answers.ros.org/question/20912... and even used for a "jade" branch https://github.com/yujinrobot/kobuki_... its officially applied..

but its not working (for me)

according to Javier it should work in gazebo4

I have tested the same code in Gazebo4.1.3 and it works like a charm, so it is a Gazebo5 problem. Javier V. Gómez (May 13 '15)

From http://answers.ros.org/question/209126/kobuki-strange-behaviour-in-gazebo/

I tried, it didn’t.. (for me..)

-> the error happens already in gazebo4

something in the migration from gazebo2 to gazebo4?

migration https://bitbucket.org/osrf/gazebo/src... and changelog https://bitbucket.org/osrf/gazebo/src...

PS: Yes I also tested the execution of my changes by messaging the ROS_INFO_STREAM

what magic ingredient am I missing?

edit retag flag offensive close merge delete


There might be a solution for kinetic: https://github.com/rohbotics/kobuki_desktop/tree/kinetic

m4k gravatar imagem4k ( 2016-08-12 12:13:15 -0600 )edit