Gazebo | Ignition | Community
Ask Your Question

Robot is moving even if gravity is turned off

asked 2021-01-23 11:10:54 -0600

th123 gravatar image

updated 2021-01-25 05:12:33 -0600


I am quite new working with ROS and gazebo. I am trying to get the Franka Emika Panda working in gazebo. I am using the offical franka_ros repository: I modified the urdf files where I got inspired from the repository of erdalpekel:

I am facing the following problem: I start an empty world in gazebo in paused mode and spawn the robot. I don't have any controllers added for this. Now I manually change the gravity value in the gazebo gui to 0.0. Then I start the simulation. What happens is that my robot starts moving around like crazy. I guess it should be completely stable when gravity isn't applied.

I am using revolute and prismatic joints and integrated the gazebo_ros_control plugin. I already made the following investigation:

When the safety_controller-tag is commented out and the values for limit effort and velocity are higher than the orginal (from franka_ros repository), the robot is almost stable. The finger joints are moving and all the other joints are moving a tiny little bit, but it's almost not noticable. I have no idea why these parameters are affecting the movement of the robot when gravity is turned off.

I am battling this issue for quite a while now and don't have any ideas anymore. Maybe I am missing an important detail. So any kind of advice is much appreciated.


P.S. I am using Ubuntu 18.04 in VirtualBox, Ros Melodic and Gazebo 9.16.0

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2021-02-02 11:26:55 -0600

th123 gravatar image

I finally found a solution for my problem!

So, I defined the joint limits in my urdf file. By default Gazebo spawns the robot with inital joint positions of zero. But for one of the joints the lower limit is -3.0718 and the upper limit is -0.0698, so the initial joint position of zero isn't in that range. And that's the reason why the robot starts moving around even if gravity is turned off.

My solution was to add the following command to the spawn node in the launch file: -J [joint_name] [inital_joint_position_value] with a value that is within the range of the joint limits. Also the exact value of one of the limits didn't work, it has to be within the range of the limits! When the simulation starts, this joint "jumps" to the definied initial position and the robot remains stable. I don't know if that is the best solution for my problem, but it works for me right now.

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-param robot_description -urdf -model panda -J joint_4 -0.9" />
edit flag offensive delete link more

answered 2021-01-25 11:36:37 -0600

nkoenig gravatar image

I can offer some advice on how to debug your simulation, but it'll be difficult to give to a solution since I don't have reproducible steps.

  1. Check that there are actually no controller running.
  2. Check the inertia, collision, and joint values on your model. There are visualization tools built into Gazebo to help identify problem. For example, a link's interia visualization (a transparent purple box) should roughly match the size of the link.
  3. You could pin the robot to the world frame, rather than turning gravity off. Zero gravity is not very realistic, unless you are planning to operate in space.
edit flag offensive delete link more


Thank you for your reply.

  1. Yes, I am not loading any controllers. In my launch file I only spawn the robot in gazebo.
  2. I got the inertia values from the following paper: However, the purple boxes are quite bigger than the sizes of the links.
  3. Yes, I am doing this. The robot base link is pinned to the ground. The problem is that all the other joints are moving.
th123 gravatar imageth123 ( 2021-01-26 08:07:43 -0600 )edit

I realized one more thing: As I said, I am not loading any controllers, but I do have the gazebo_ros_control plugin and the transmission tags for all joints included in my urdf file. For the hardware_interface I am using the EffortJointInterface. However, when I change it to PositionJointInterface the joints of the robot are stable in gazebo. Why is it not working with the EffortJointInterface?

th123 gravatar imageth123 ( 2021-01-26 08:15:10 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-01-23 11:10:54 -0600

Seen: 143 times

Last updated: Feb 02