How to define the coordinates under TransformAxis?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
ruoshi wen
Posts: 32
Joined: Sat Jun 17, 2017 7:44 pm

How to define the coordinates under TransformAxis?

Post by ruoshi wen » Mon Jul 24, 2017 6:33 pm

Hi, all!
I am trying to define a custom joint using OpenSim API 3.3 and create a similar arm to Arm26 which is one of your offical models.
In the arm26.osim file, I noticed that under TransformAxis, there is something called coordinates.
I wonder how to define it using api(I am scripting in C++ to create the arm).
Part of the arm26.osim is as follows.

Code: Select all

<Joint>
						<CustomJoint name="r_shoulder">
							<!--Defines how the child body moves with respect to the parent as a function of the generalized coordinates.-->
							<SpatialTransform>
								<!--3 Axes for rotations are listed first.-->
								<TransformAxis name="rotation1">
									<!--Names of the coordinates that serve as the independent variables         of the transform function.-->
									<coordinates>r_shoulder_elev</coordinates>
									<!--Rotation or translation axis for the transform.-->
Thanks a lot for your help!

User avatar
ruoshi wen
Posts: 32
Joined: Sat Jun 17, 2017 7:44 pm

Re: How to define the coordinates under TransformAxis?

Post by ruoshi wen » Mon Jul 24, 2017 6:50 pm

I just find the answer.

Code: Select all

		OpenSim::SpatialTransform shoulderST;
		shoulderST.updTransformAxis(0).setAxis(Vec3(-0.05889802, 0.0023, 0.99826136));
		shoulderST.updTransformAxis(0).setCoordinateNames(Array<std::string>("r_shoulder_elev", 1));

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: How to define the coordinates under TransformAxis?

Post by jimmy d » Mon Jul 24, 2017 6:54 pm

Here is the documentation for TransformAxis; https://simtk.org/api_docs/opensim/api_ ... mAxis.html

POST REPLY