Search code examples
drake

Adding simple point robots in drake


I have been following the point_finger.ipynb tutorial to add a point finger robot in my own simulation. The idea of adding joints between the finger and the world and then actuating these joints makes complete sense. However, I have been struggling with understanding the purpose of the false_body1 in the code. I am pasting in relevant bit here

def AddPointFinger(plant):
    finger = AddShape(plant, Sphere(0.01), "finger", color=[0.9, 0.5, 0.5, 1.0])
    false_body1 = plant.AddRigidBody(
        "false_body1",
        finger,
        SpatialInertia(0, [0, 0, 0], UnitInertia(0, 0, 0)),
    )
    finger_x = plant.AddJoint(
        PrismaticJoint(
            "finger_x",
            plant.world_frame(),
            plant.GetFrameByName("false_body1"),
            [1, 0, 0],
            -0.3,
            0.3,
        )
    )
    plant.AddJointActuator("finger_x", finger_x)
    finger_z = plant.AddJoint(
        PrismaticJoint(
            "finger_z",
            plant.GetFrameByName("false_body1"),
            plant.GetFrameByName("finger"),
            [0, 0, 1],
            0.0,
            0.5,
        )
    )
    finger_z.set_default_translation(0.25)
    plant.AddJointActuator("finger_z", finger_z)

    return finger

Maybe I am not understanding something here, but what do both prismatic joints have different parent frames?

Thank you for help and instruction.


Solution

  • The key is the nature of actuation that Drake's MultibodyPlant currently affords. You can only actuate 1-dof joints. You'll note that the joint between false_body1 and world has its axis in the Wx direction and the joint between false_body1 and fingers has its axis in the Wz direction. This gives you two degrees of freedom for the finger: in the Wx and Wz directions.

    If you wanted to actuate complete 6-dof robot, you'd continue the pattern by adding more intermediate, massless bodies joined with a third prismatic joint and three revolute joints.