3. Simple Robot

If you are building a robot from scratch like we are in this tutorial, or if you are importing parts from CAD, the collection of rigid bodies will not move like a robot without joints and articulations. If you are importing robots from Onshape or URDF, which we have specialized importers for, the joint information should be available upon import. However it might still be useful to screen the imported articulation and joint drives for correctness. In this tutorial, we will rig a simple “robot” with three links and two revolute joints to introduce the basics concepts of joints and articulations.

3.1. Learning Objectives

This tutorial details how to rig a two-wheel mobile robot. We will cover how to

  • Organize stage tree hierarchy

  • Add joints between two rigid bodies

  • Add joint drives and joint properties

  • Add articulations

3.2. Getting Started

Prerequisites

  • Please complete all previous tutorials in the GUI Tutorials series.

Now that we are connecting the rigid bodies to make a robot, it is helpful to put them in an organized hierarchical structure and give them meaningful names. We will put all the links to the robot under a single Prim.

  1. Right click inside the Stage tab, select Create > Xform. Rename the newly added Xform to mock_robot.

  2. Move the Cube, both Cylinders, Physics Material, and Looks folder under mock_robot by drag and drop.

  3. Rename the Cube and Cylinders to body, wheel_left, and wheel_right.

3.3. Add Joints

  1. To add an joint between two bodies, first click on the body that will be the child, and then the parent body. For our mock robot, we will first select wheel_left, then while holding Ctrl + Shift, select body. With both body highlighted, Create > Physics > Joints > Revolute. A RevoluteJoint will appear under body on the stage tree. Rename it to wheel_joint_left.

  2. Double check in the Property tab that body0 is the cube, and body1 is the cylinder.

  3. Change the Axis of the joint to Y.

  4. If you look closely, the joint’s two local frames are misaligned. To correct it, go to Local Rotation 1 and make x = -90 degrees.

  5. Repeat steps 1-4 for the right wheel joint.

Before the joints were added, the three rigid bodies fall to the ground separately after pressing Play. Now that there are joints attached, the bodies will fall as if they are connected. You can drag the robot around by holding down the Shift key and click and drag on any part of the robot in the viewport, and you can see that they move together like they are connected via revolute joints.

3.4. Add Joint Drive

Adding the joint is only adding the mechanical connection. To be able to control and drive the joints, we need to add joint drive API. Select both joints and click the + Add button in the Property tab, and select Physics > Angular Drive to add drive to both joints simultaneously.


  • Position Control: for position controlled joints, set a high stiffness and relatively low or zero damping.

  • Velocity Control: for velocity controller joints, set a high damping and zero stiffness.

For joints on a wheel, it makes more sense to be velocity controlled, so let’s set both wheels’ Damping to 1e4, and Target Velocity to 2000.

If you are working with joints with limited range, those can be set in the Property tab, under the Raw USD Properties > Lower (Upper) Limit.

Press Play to see our mock mobile robot drive off.

3.5. Add Articulation

Even though directly driving the joints can move the robot, it is not the most computationally efficient way. Making things into articulations can achieve higher simulation fidelity, less joint errors, and can handle larger mass ratios between the jointed bodies. You can read more regarding the physics simulation behind it in Physics Core: Articulation.

To turn a series of connected rigid bodies and joints into articulation, we need to set an articulation root to anchor the articulation tree. According to instructions on defining articulation trees in Physics Core: Articulation :

For a fixed-base articulation, add the Articulation Root Component either to: 1) the fixed joint that connects the articulation base to the world, or 2) an ancestor of the fixed joint in the USD hierarchy. The second option allows creating multiple articulations from a single root component added to the scene: Each descendant fixed joint will be defining an articulation base link.

For a floating-base articulation, add the Articulation Root Component either to: 1) the root rigid-body link or 2) an ancestor of the root link in the USD hierarchy.

In our case, we will add the articulation root to the robot body. Select body on the tree, open + Add in the Property tab, and add Physics > Articulation Root.

3.6. Summary

In this tutorial, we covered how to connect rigid bodies using joints, add joint drive to control the joints, as well as turning a chain of joints into an articulation.

3.6.1. Next Steps

Continue on to Add Camera to learn how to add a camera to the car.

3.6.2. Further Reading

Please read Physics Core for more details regarding joints and articulations.