MobilizedBody::Custom to off-the-shelf solution?
Posted: Fri Dec 13, 2024 6:56 am
Hello Sherm,
In the past, I had to deal with a special system requiring a MobilizedBody::Custom. In particular, the rotation of the body is a function of the generalized coordinates. Let's say, for example, that the mobilizer has 3 generalized coordinates (x,y,z) representing a 3D translation, and that the body rotation is a function of these, let's write Rotation=f(x,y,z).
I first tried finding scalar functions for each Euler angle (unwrapped to avoid jumps) and use a MobilizedBody::FunctionBased, but the rotation of the body can be any, so the interpolator was not good near singularities. Instead, I created a MobilizedBody::Custom, where f(x,y,z) actually defines a rotation matrix. That worked very well, but I am wondering if there is a "native" way of doing this with the supplied mobilized bodies, ideally without using constraints. At least, I have not found any!
Again, I am just asking out of curiosity. The ability of creating a custom mobilized body is immensely helpful.
Thank you very much for your insights!
Best regards,
Simone
In the past, I had to deal with a special system requiring a MobilizedBody::Custom. In particular, the rotation of the body is a function of the generalized coordinates. Let's say, for example, that the mobilizer has 3 generalized coordinates (x,y,z) representing a 3D translation, and that the body rotation is a function of these, let's write Rotation=f(x,y,z).
I first tried finding scalar functions for each Euler angle (unwrapped to avoid jumps) and use a MobilizedBody::FunctionBased, but the rotation of the body can be any, so the interpolator was not good near singularities. Instead, I created a MobilizedBody::Custom, where f(x,y,z) actually defines a rotation matrix. That worked very well, but I am wondering if there is a "native" way of doing this with the supplied mobilized bodies, ideally without using constraints. At least, I have not found any!
Again, I am just asking out of curiosity. The ability of creating a custom mobilized body is immensely helpful.
Thank you very much for your insights!
Best regards,
Simone