Constraint Sets

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Connor Stapp
Posts: 18
Joined: Tue Jan 31, 2017 1:44 pm

Constraint Sets

Post by Connor Stapp » Fri Jun 23, 2017 9:26 am

I've been looking at constraint sets and when I was looking at different ways to write a constraint set, I found two different examples seen below:

Code: Select all

<ConstraintSet>
		<objects>
			<CoordinateCouplerConstraint name="sternoclavicular_r2_con">
				<isDisabled> false </isDisabled>
				<dependent_coordinate_name> sternoclavicular_r2 </dependent_coordinate_name>
				<independent_coordinate_names> shoulder_elv </independent_coordinate_names>
				<coupled_coordinates_function name="f0">
					<NaturalCubicSpline>
						<x> 0.000000000000 2.617993877991 </x>
						<y> 0.000000000000 -0.633554518474 </y>
					</NaturalCubicSpline>
				</coupled_coordinates_function>
			</CoordinateCouplerConstraint>

Code: Select all

<ConstraintSet>
		<objects>
			<PointOnLineConstraint name="lock_block_to_y_axis">
				<isDisabled>false</isDisabled>
				<line_body>ground</line_body>
				<line_direction_vec> 0 1 0</line_direction_vec>
				<point_on_line> 0 0 0</point_on_line>
				<follower_body>block</follower_body>
				<point_on_follower> 0 0 0</point_on_follower>
			</PointOnLineConstraint>
The first piece of code is from the MoBL_ARMS_Upper_Limb_Model_SIMM_0.osim model and the second piece of code is from the bouncing_block.osim. Could someone possibly explain the difference between the two and what each one means?

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

Re: Constraint Sets

Post by Thomas Uchida » Fri Jun 23, 2017 10:56 am


User avatar
Yanis AMMOUCHE
Posts: 23
Joined: Mon Apr 24, 2017 6:09 am

Re: Constraint Sets

Post by Yanis AMMOUCHE » Fri Jun 23, 2017 11:11 am

Hello

These are two different type of constraints :

the first one links two coordinates :

You can see that the independant_coordinate name is the shoulder_elv. The dependant coordinate is the sternoclavicular_r2.

That means the value of the shoulder_elv coordinate will constrain the value of the sternoclavicular_r2 and the coupled_coordinates_function will explicit this relation :

x represents the value of the shoulder elv coordinate and y the constrained value of the clavicular (which is a function of x).

The other constraint tell that the point at (0,0,0) attached to your follower body named block has to stay on the line determined by the position point_on_line and the axis line_direction_vec. That means you cannot translate the block along the x or z axis, only three rotation and one translation along the y axis are possible assuming you defined a free joint beetween the ground and the block at coordinate (0,0,0) of the block.

I hope this helps you.

POST REPLY