Nikasha P
Nikasha P

Reputation: 13

Matching Joint Actuator Input Dimensions with PID Controller Output Dimensions [Drake]

I am trying to wire a PID controller's output to the input of a Joint Actuator. For context (pun intended), I'm able to wire together the continuous state output port of my platform model, which is just a revolute joint, to the PID controller's input because the dimensions are both size 2. I think I'm conceptually misunderstanding something about the actual data types my ports return. Here's a picture of my diagram context and the associated code:

Diagram context visualized

Code screenshot pt 1

Code screenshot pt 2 with the error

Plant context pt 1

Plant context pt 2 with some more info

Any help is greatly appreciated! The error is in the commented-out line 58 of screenshot 2. The dimensions of controller.get_out_port_control() = 1 (which makes sense), but the dimensions of the input to the actuation input port must be 2 (which I don't understand).

Upvotes: 1

Views: 75

Answers (1)

Russ Tedrake
Russ Tedrake

Reputation: 5533

I can't be sure without seeing the sdf files, but when you parse an SDF, you will automatically get a joint actuator for any joint that does not have an effort limit = 0. I suspect that you are getting another actuator that way?

Upvotes: 1

Related Questions