1

Say I have a simple pendulum attached to a quadrotor defined in an sdf file.

When I load this sdf file into a MultibodyTree, the default continuous state vector is of size 4 (quaternion) + 3 (x, y, z) + 1 (joint connecting quadrotor to pendulum) = 8 as indicated by this answer.

By default, the urdf/sdf parser adds the system with a quaternion-based floating base.

My question is, how do I know where this 4 (quaternion) + 3 (x, y, z) frame is attached?

And how do I control where it is attached to? Say my equations of motion are w.r.t. to the tip of the pendulum, and I want this 4 + 3 quaternion floating base to be attached to the tip of my pendulum, how would I define that?

Rufus
  • 5,111
  • 4
  • 28
  • 45

2 Answers2

2

I think I understand now. Our SDF parser still has some limitations and in order to achieve what you want you need to understand them. Right now the "parent"/"child" specification of the links in a <joint> element ends up directly defining the tree relationship between links. If you make your pendulum body to be the "parent" and the quadrotor the "child", then MBP will assign the quaternion to the pendulum instead, which I believe is what you want. When doing that you'll have to also pay attention to <joint>/<pose>, please refer to this tutorial for details, which includes a nice schematic on joint frames and conventions.

Alejandro
  • 1,064
  • 1
  • 8
  • 22
0

I am not sure I understand what you mean with "where this quaternion-based floating base is attached to". If what you are asking is how to set the pose of a body that you know from your sdf/urdf is floating, then the answer is that you can do that with MultibodyPlant::SetFreeBodyPose(). Hopefully that helps.

Alejandro
  • 1,064
  • 1
  • 8
  • 22
  • I think Rufus wants to know how they can change the frame that the floating base coordinates are measured in / relative to; however, I'm not sure if they just want to put an offset in the existing frame (so it's attached to the same body), or if they want to change which body the frame is attached to as well? (The workflow that I think would be enabled by the more physical topology settings at construction, per some of our f2f convos?) – eacousineau Jun 07 '19 at 12:49