Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To answer the first question, the box turns over because of friction coefficient, which has a default value of 1. Update your collision to below to prevent rolling:

    <collision name="collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
      <surface>
        <friction>
          <ode>
            <mu>0</mu>
            <mu2>0</mu2>
          </ode>
        </friction>
      </surface>
    </collision>

And remember, even though the tutorial moves the block with Model::SetLinearVel, which forces CG's linear motion in a straight line, physics dictates that there is still a downward gravity force, and there is still an upward normal contact force and its corresponding tangential friction forces. Ultimately, the combination of forces imparts a rolling moment about CG of the box, causing it to tumble.