ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

# spawning a simple_box in gazebo, box oscillates

This post is a wiki. Anyone with karma >75 is welcome to improve it.

With electric running on Ubuntu 11.10, if I run the following two commands

roslaunch gazebo_worlds empty_world.launch
roslaunch gazebo_worlds simple_box.launch


I would expect to get a 5cm by 5m by 10cm box spawned at position (1,0,2). Effectively, that is what happens. But then the box starts oscillating around (0,0,2), moving from (1,0,2) to (-1,0,2). I don't understand why this is happening. Is there something I'm missing here?

Thanks,

-J

edit retag close merge delete

Yes ! it oscillates as a pendulum !

( 2012-04-25 19:53:30 -0500 )edit

Sort by ยป oldest newest most voted

This post is a wiki. Anyone with karma >75 is welcome to improve it.

looking my simple_box.urdf I've got:

  <joint name="my_box_joint" type="continuous" >
<!-- axis is in the parent link frame coordintates -->
<axis xyz="0 1 0" />
<!-- initial pose of my_box joint/link in the parent frame coordiantes -->
<origin xyz="0 0 2" rpy="0 0 0" />
</joint>


So looking at the rest of the urdf: the joint is at (0 0 2) and the mass is centered at (1 0 2). So the mass should pivot around (0 0 2) since gravity is acting on the box.

more

This post is a wiki. Anyone with karma >75 is welcome to improve it.

If you want to stop it from oscillating then look close to the end of the simple_box.urdf file;

<turnGravityOff>false</turnGravityOff>


make the false into true. Gravity will stop acting and oscillations will stop.

Have a look at the following screenshot, simple_box_1 is stationary while simple_box is oscillating.

more