russtedrake PRO
Roboticist at MIT and TRI
MIT 6.4210/2: Robotic Manipulation
Fall 2022, Lecture 4
Follow live at https://slides.com/d/auj49nI/live
(or later at https://slides.com/russtedrake/fall22-lec04)
generalized positions
pose of body (or frame) \(B\)
plant = MultibodyPlant(time_step = 0.0)
Parser(plant).AddModelFromFile(FindResourceOrThrow(
"drake/examples/manipulation_station/models/061_foam_brick.sdf"))
plant.Finalize()
brick = plant.GetBodyByName("base_link")
context = plant.CreateDefaultContext()
What is \(X^B\) ?
X_B = plant.EvalBodyPoseInWorld(brick, context)
What is \(q\) ?
q = plant.GetPositions(context)
Kinematic "Jacobian"
angular velocity
translational velocity
Q: How do we represent angular velocity, \(\omega^B\)??
A: Unlike 3D rotations, here 3 numbers are sufficient and efficient; so we use the same representation everywhere.
note the typesetting
plant = MultibodyPlant(time_step = 0.0)
Parser(plant).AddModelFromFile(FindResourceOrThrow(
"drake/examples/manipulation_station/models/061_foam_brick.sdf"))
plant.Finalize()
brick = plant.GetBodyByName("base_link")
context = plant.CreateDefaultContext()
What is \(v\) ?
v = plant.GetVelocities(context)
What is \(q\) ?
q = plant.GetPositions(context)
v = plant.MapQDotToVelocity(context, qdot)
qdot = plant.MapVelocityToQDot(context, v)
For any MultibodyPlant (not just a single body):
plant.SetPositions(plant_context, iiwa, q)
J_G = plant.CalcJacobianSpatialVelocity(
plant_context, JacobianWrtVariable.kQDot,
G, [0,0,0], self._W, self._W)
J_G = J_G[:,0:7] # Ignore gripper terms
V_G_desired = np.array([0, # rotation about x
-.1, # rotation about y
0, # rotation about z
0, # x
-.05, # y
-.1]) # z
v_iiwa = np.linalg.pinv(J_G).dot(V_G_desired)
prog = MathematicalProgram()
x = prog.NewContinuousVariables(2)
prog.AddConstraint(x[0] + x[1] == 1)
prog.AddConstraint(x[0] <= x[1])
prog.AddCost(x[0] ** 2 + x[1] ** 2)
result = Solve(prog)
By russtedrake
MIT Robotic Manipulation Fall 2022 http://manipulation.csail.mit.edu