OpenSim model with 3 DOF at knee joint

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
siavash shirvanipour
Posts: 5
Joined: Fri Nov 02, 2018 4:20 am

OpenSim model with 3 DOF at knee joint

Post by siavash shirvanipour » Fri Nov 09, 2018 1:17 am

Hello all, I need to an OpenSim model with 3 DOF at knee joint. how can I add extra DOF to knee joint? could you help me with that? may you send me this model if you have??
Best Regards
siavash

Tags:

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: OpenSim model with 3 DOF at knee joint

Post by Dimitar Stanev » Fri Nov 09, 2018 3:00 am

Hi

Please see the definition of the knee joint below

Code: Select all

				<Body name="tibia_r">
					<mass>3.57280619084912</mass>
					<mass_center> 0 -0.184557 0</mass_center>
					<inertia_xx>0.0474605090484552</inertia_xx>
					<inertia_yy>0.00480255151085559</inertia_yy>
					<inertia_zz>0.0481196827852393</inertia_zz>
					<inertia_xy>0</inertia_xy>
					<inertia_xz>0</inertia_xz>
					<inertia_yz>0</inertia_yz>
					<!--Joint that connects this body with the parent body.-->
					<Joint>
						<CustomJoint name="knee_r">
							<!--Name of the parent body to which this joint connects its owner body.-->
							<parent_body>femur_r</parent_body>
							<!--Location of the joint in the parent body specified in the parent reference frame. Default is (0,0,0).-->
							<location_in_parent>0 0 0</location_in_parent>
							<!--Orientation of the joint in the parent body specified in the parent reference frame. Euler XYZ body-fixed rotation angles are used to express the orientation. Default is (0,0,0).-->
							<orientation_in_parent>0 0 0</orientation_in_parent>
							<!--Location of the joint in the child body specified in the child reference frame. For SIMM models, this vector is always the zero vector (i.e., the body reference frame coincides with the joint). -->
							<location>0 0 0</location>
							<!--Orientation of the joint in the owing body specified in the owning body reference frame.  Euler XYZ body-fixed rotation angles are used to express the orientation. -->
							<orientation>0 0 0</orientation>
							<!--Set holding the generalized coordinates (q's) that parmeterize this joint.-->
							<CoordinateSet>
								<objects>
									<Coordinate name="knee_angle_r">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The speed value of this coordinate before any value has been set. Rotational coordinate value is in rad/s and Translational in m/s.-->
										<default_speed_value>0</default_speed_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-2.0943951 0.17453293</range>
										<!--Flag indicating whether or not the values of the coordinates should be limited to the range, above.-->
										<clamped>false</clamped>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>false</locked>
										<!--If specified, the coordinate can be prescribed by a function of time. It can be any OpenSim Function with valid second order derivatives.-->
										<prescribed_function />
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="knee_adduction_r">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-0.400462306211595 0.400462306211595</range>
									</Coordinate>
									<Coordinate name="knee_rotation_r">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-0.200231153105797 0.200231153105797</range>
									</Coordinate>
								</objects>
								<groups />
							</CoordinateSet>
							<!--Whether the joint transform defines parent->child or child->parent.-->
							<reverse>false</reverse>
							<!--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>knee_angle_r</coordinates>
									<!--Rotation or translation axis for the transform.-->
									<axis>0 0 1</axis>
									<!--Transform function of the generalized coordinates used to        represent the amount of transformation along a specified axis.-->
									<function>
										<LinearFunction>
											<coefficients> 1 0</coefficients>
										</LinearFunction>
									</function>
								</TransformAxis>
								<TransformAxis name="rotation2">
									<!--Names of the coordinates that serve as the independent variables         of the transform function.-->
									<coordinates>knee_adduction_r</coordinates>
									<!--Rotation or translation axis for the transform.-->
									<axis>0 1 0</axis>
								</TransformAxis>
								<TransformAxis name="rotation3">
									<!--Names of the coordinates that serve as the independent variables         of the transform function.-->
									<coordinates>knee_rotation_r</coordinates>
									<!--Rotation or translation axis for the transform.-->
									<axis>1 0 0</axis>
								</TransformAxis>
								<!--3 Axes for translations are listed next.-->
								<TransformAxis name="translation1">
									<!--Names of the coordinates that serve as the independent variables         of the transform function.-->
									<coordinates>knee_angle_r</coordinates>
									<!--Rotation or translation axis for the transform.-->
									<axis>1 0 0</axis>
									<!--Transform function of the generalized coordinates used to        represent the amount of transformation along a specified axis.-->
									<function>
										<MultiplierFunction>
											<function>
												<SimmSpline>
													<x> -2.0944 -1.74533 -1.39626 -1.0472 -0.698132 -0.349066 -0.174533 0.197344 0.337395 0.490178 1.52146 2.0944</x>
													<y> -0.0032 0.00179 0.00411 0.0041 0.00212 -0.001 -0.0031 -0.005227 -0.005435 -0.005574 -0.005435 -0.00525</y>
												</SimmSpline>
											</function>
											<scale>1.14724</scale>
										</MultiplierFunction>
									</function>
								</TransformAxis>
								<TransformAxis name="translation2">
									<!--Names of the coordinates that serve as the independent variables         of the transform function.-->
									<coordinates>knee_angle_r</coordinates>
									<!--Rotation or translation axis for the transform.-->
									<axis>0 1 0</axis>
									<!--Transform function of the generalized coordinates used to        represent the amount of transformation along a specified axis.-->
									<function>
										<MultiplierFunction>
											<function>
												<SimmSpline>
													<x> -2.0944 -1.22173 -0.523599 -0.349066 -0.174533 0.159149 2.0944</x>
													<y> -0.4226 -0.4082 -0.399 -0.3976 -0.3966 -0.395264 -0.396</y>
												</SimmSpline>
											</function>
											<scale>1.14724</scale>
										</MultiplierFunction>
									</function>
								</TransformAxis>
								<TransformAxis name="translation3">
									<!--Names of the coordinates that serve as the independent variables         of the transform function.-->
									<coordinates></coordinates>
									<!--Rotation or translation axis for the transform.-->
									<axis>0 0 1</axis>
									<!--Transform function of the generalized coordinates used to        represent the amount of transformation along a specified axis.-->
									<function>
										<MultiplierFunction>
											<function>
												<Constant>
													<value>0</value>
												</Constant>
											</function>
											<scale>1.14724</scale>
										</MultiplierFunction>
									</function>
								</TransformAxis>
							</SpatialTransform>
						</CustomJoint>
					</Joint>
					<VisibleObject>
						<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
						<GeometrySet>
							<objects>
								<DisplayGeometry>
									<!--Name of geometry file .vtp, .stl, .obj-->
									<geometry_file>tibia.vtp</geometry_file>
									<!--Color used to display the geometry when visible-->
									<color> 1 1 1</color>
									<!--Name of texture file .jpg, .bmp-->
									<texture_file />
									<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> -0 0 -0 0 0 0</transform>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
									<display_preference>4</display_preference>
									<!--Display opacity between 0.0 and 1.0-->
									<opacity>1</opacity>
								</DisplayGeometry>
								<DisplayGeometry>
									<!--Name of geometry file .vtp, .stl, .obj-->
									<geometry_file>fibula.vtp</geometry_file>
									<!--Color used to display the geometry when visible-->
									<color> 1 1 1</color>
									<!--Name of texture file .jpg, .bmp-->
									<texture_file />
									<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> -0 0 -0 0 0 0</transform>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
									<display_preference>4</display_preference>
									<!--Display opacity between 0.0 and 1.0-->
									<opacity>1</opacity>
								</DisplayGeometry>
							</objects>
							<groups />
						</GeometrySet>
						<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
						<scale_factors> 0.988523 0.988523 0.988523</scale_factors>
						<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
						<transform> -0 0 -0 0 0 0</transform>
						<!--Whether to show a coordinate frame-->
						<show_axes>false</show_axes>
						<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
						<display_preference>4</display_preference>
					</VisibleObject>
					<WrapObjectSet>
						<objects />
						<groups />
					</WrapObjectSet>
				</Body>
			

User avatar
siavash shirvanipour
Posts: 5
Joined: Fri Nov 02, 2018 4:20 am

Re: OpenSim model with 3 DOF at knee joint

Post by siavash shirvanipour » Wed Nov 14, 2018 10:12 am

thank you very much for your response. how can I use that on OpenSim? May you explain its process? I think I have to use Notepad++

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: OpenSim model with 3 DOF at knee joint

Post by Thomas Uchida » Sat Nov 17, 2018 7:39 pm

You have indicated that you are using OpenSim 3.3. Please see the "Example - Model Editing" page in the Confluence documentation for OpenSim 3.3: https://simtk-confluence.stanford.edu:8 ... el+Editing.

POST REPLY