0

Suppose that my rigid body plant is generated from a URDF file and represents a manipulator such as the Kuka arm in the examples. I have two questions:

1.) Are the generalized positions and velocities from state_output_port() and state_derivative_output_port() the same as the ones I could obtain from the KinematicsResult object that can be obtained from kinematics_results_output_port()?

2.) What is the recommended way to obtain the joint accelerations from a rigid body plant/tree?

Felix Crazzolara
  • 982
  • 9
  • 24

1 Answers1

1

RigidBodyPlant is on the way out (not officially deprecated yet, but very soon). Please look at the MultibodyPlant toolchain instead? examples/manipulation_station is roughly replacing the examples/kuka_iiwa_arm directory.

Russ Tedrake
  • 4,703
  • 1
  • 7
  • 10
  • Hi Russ, thank you for your response. I had a look at MultibodysPlant. I'm still not sure how to access the accelerations. More specifically, I'm interested in the joint accelerations d^2/dt^2q that is qdotdot. – Felix Crazzolara Oct 12 '19 at 17:01
  • It's true that the accelerations are not available through an output port, but you can call [`EvalTimeDerivatives`](https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_system.html#ae38625e953699a0433249142972eef52) to (re-)evaluate (with caching to avoid duplicate computation) the derivatives given a pointer to the MBP. You'll need to be a little careful -- we typically use a discrete-time (time-stepping) MBP for simulation if there are contact dynamics, but you will need to have a continuous-time version for the call to `EvalTimeDerivatives` to be meaningful. Does that help? – Russ Tedrake Oct 14 '19 at 01:22
  • Hi Russ. Yes that helps! I ended up adding an output to the MultibodyPlant class that uses `EvalGeneralizedAccelerations`. – Felix Crazzolara Oct 17 '19 at 22:18