Xml_writeOSIM.m and muscles

Provides tools for using different aspects of Opensim within the Matlab environment, including command line pipelines as well as accessing the Opensim API directly.
POST REPLY
User avatar
Pierre PUCHAUD
Posts: 6
Joined: Sun Oct 04, 2015 6:13 am

Xml_writeOSIM.m and muscles

Post by Pierre PUCHAUD » Thu Mar 09, 2017 2:50 am

Hello,

I'm editing an OSIM model trough Matlab 2016b using the Matlab function Xml_writeOSIM.m . The muscles Pathpoints are composed of three types of Points : PathPoint, MovingPathPoint or ConditionalPathPoint.

When i'm rewriting a model trough the function the order of the points is changed. And the order of the pathpoints in OpenSim is also changed. So, the definition of the muscle paths is then wrong.

Is there a way to read right the osim model in OpenSim ? Or is there a way to write better the muscles (in the right order) with the matlab function ?

Best Regards,

Pierre


BEFORE :

Code: Select all

                                                <PathPointSet>
							<objects>
								<PathPoint name="PT-P1">
									<location> 0.0036 -0.2759 -0.0365</location>
									<body>humerus</body>
								</PathPoint>
								<PathPoint name="PT-P2">
									<location> 0.00846 -0.03373 -0.01432</location>
									<body>ulna</body>
								</PathPoint>
								<MovingPathPoint name="PT-P3">
									<location> 0.01219 -0.06516 -0.00219</location>
									<body>ulna</body>
									<x_location>
										<PiecewiseLinearFunction>
											<x> -1.5708 1.5708</x>
											<y> 0.01884 0.00554</y>
										</PiecewiseLinearFunction>
									</x_location>
									<x_coordinate>pro_sup</x_coordinate>
									<y_location>
										<SimmSpline>
											<x> -1.5708 1.5708</x>
											<y> -0.06086 -0.06946</y>
										</SimmSpline>
									</y_location>
									<y_coordinate>pro_sup</y_coordinate>
									<z_location>
										<SimmSpline>
											<x> -1.5708 1.5708</x>
											<y> 0.00506 -0.00944</y>
										</SimmSpline>
									</z_location>
									<z_coordinate>pro_sup</z_coordinate>
								</MovingPathPoint>
								<ConditionalPathPoint name="PT-P4">
									<location> 0.0236 -0.0934 0.0094</location>
									<body>radius</body>
									<range> -1.5708 0.509636</range>
									<coordinate>pro_sup</coordinate>
								</ConditionalPathPoint>
								<PathPoint name="PT-P5">
									<location> 0.0254 -0.1088 0.0198</location>
									<body>radius</body>
								</PathPoint>
							</objects>
							<groups />
						</PathPointSet>

AFTER :

Code: Select all

                        <PathPointSet>
                            <objects>
                                <PathPoint name="PT_r-P1">
                                    <location>0.0036 -0.2759 -0.0365</location>
                                    <body>humerus_r</body>
                                </PathPoint>
                                <PathPoint name="PT_r-P2">
                                    <location>0.00846 -0.03373 -0.01432</location>
                                    <body>ulna_r</body>
                                </PathPoint>
                                <PathPoint name="PT_r-P5">
                                    <location>0.0254 -0.1088 0.0198</location>
                                    <body>radius_r</body>
                                </PathPoint>
                                <MovingPathPoint name="PT_r-P3">
                                    <location>0.01219 -0.06516 -0.00219</location>
                                    <body>ulna_r</body>
                                    <x_location>
                                    <PiecewiseLinearFunction>
                                    <x>-1.5708 1.5708</x>
                                    <y>0.01884 0.00554</y>
                                    </PiecewiseLinearFunction>
                                    </x_location>
                                    <x_coordinate>pro_sup_r</x_coordinate>
                                    <y_location>
                                    <SimmSpline>
                                    <x>-1.5708 1.5708</x>
                                    <y>-0.06086 -0.06946</y>
                                    </SimmSpline>
                                    </y_location>
                                    <y_coordinate>pro_sup_r</y_coordinate>
                                    <z_location>
                                    <SimmSpline>
                                    <x>-1.5708 1.5708</x>
                                    <y>0.00506 -0.00944</y>
                                    </SimmSpline>
                                    </z_location>
                                    <z_coordinate>pro_sup_r</z_coordinate>
                                </MovingPathPoint>
                                <ConditionalPathPoint name="PT_r-P4">
                                    <location>0.0236 -0.0934 0.0094</location>
                                    <body>radius_r</body>
                                    <range>-1.5708 0.50964</range>
                                    <coordinate>pro_sup_r</coordinate>
                                </ConditionalPathPoint>
                            </objects>
                            <groups/>
                        </PathPointSet>

POST REPLY