Hi,
I have a 3D point, and I want to express it wrt a new frame:
I want to learn how to do it with OpenSim API. I can create two PhysicalOffsetFrame objects (one for the origin and one for the new frame), update their orientations (set_orientation) and translations (set_translation), and use findStationLocationInAnotherFrame. The problem is that this method requires State as argument, but I don't have any Model to call initSystem.
I also checked Transform class, but couldn't find any spevific method; perhaps the operators???
I wonder if this could be possible in OpenSim API without building a model. Any help would be greatly appreciated.
Transform a point into a new frame
- Mohammadreza Rezaie
- Posts: 418
- Joined: Fri Nov 24, 2017 12:48 am
- Mohammadreza Rezaie
- Posts: 418
- Joined: Fri Nov 24, 2017 12:48 am
Re: Transform a point into a new frame
***UPDATE***
Transform::shiftBaseStationToFrame did it. I'm posting the solution here:
Transform::shiftBaseStationToFrame did it. I'm posting the solution here:
Code: Select all
import opensim as osim
point = osim.Vec3(...)
rotMat = osim.Rotation()
rotMat.setRotationToBodyFixedXYZ( osim.Vec3(...) )
location = osim.Vec3(...)
transMat = osim.Transform(rotMat, location)
transMat.shiftBaseStationToFrame(point)