'PyDrake: PID Control of Free-Floating Simulation - Velocity & Positional Dimension Mismatch

|OS: Ubuntu 20.04|Py:3.7|Drake Stable Release:0.38.0| When I generate a free-floating body (conventional robotic arm not welded to world with n joints) I get the following:

Positional DOF: [[quaternion],x,y,z,j1,j2...], DOF # = n + 7 Velocity DOF: [roll,pitch,yaw,x,y,z,j1,j2...], DOF # = n + 6

This matrix mismatch prevents me from implementing PID control because the PidController class wants Kp,Ki, and Kd to be the same length, and it must be applied to the whole state context, even though for the sake of control the only nonzero gains would be for the joint values ji for i = 1-n.

Am I missing something?

Thanks --



Solution 1:[1]

The PidController system accepts state_projection and output_projection matrices precisely to support this sort of a workflow.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Russ Tedrake