I have a MultibodyPlant
containing a 6-dof robot, and a stationary 2-dof obstacle. The plant's positions vector is 8-dimensional [object_x_offset, object_y_offset, robot_joint_1, ..., robot_joint_6]
.
This is very convenient for something like IrisInConfigurationSpace
where I can now generate collision free regions around an obstacle, whose pose I can leave undetermined until runtime. When I localize the obstacle, I can simply take each 8-dimensional convex region down 6-dimensions by slicing it at the known [object_x, object_y]
coordinates.
However, this is inconvenient for using Drake's trajectory planning algorithms, which will assume that the [object_x, object_y]
coordinates can be controlled. I find myself manually adding linear constraints into the MathematicalProgram
to fix these coordinates.
Instead, I would like a way to create a related MultibodyPlant
, whose .num_positions() == 6
that calls down to my original plant with the first two coordinates fixed to some numbers of my choosing.
Is there an easy way to do this?