Hide Ellipsoid Joint in GUI

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Colin Smith
Posts: 53
Joined: Fri Feb 24, 2012 11:50 am

Hide Ellipsoid Joint in GUI

Post by Colin Smith » Fri Feb 19, 2021 8:12 am

When I add an ellipsoid joint to a model, the corresponding ellipsoid is displayed (solid blue) in the gui. Is there a way to hide/change the display properties of this ellipsoid?

Tags:

User avatar
Ayman Habib
Posts: 2235
Joined: Fri Apr 01, 2005 12:24 pm

Re: Hide Ellipsoid Joint in GUI

Post by Ayman Habib » Fri Feb 19, 2021 10:01 am

Hi Colin,

The Ellipsoid Joint was not part of our distribution of version 4.1, it was a plugin. Assuming it followed the standard workflow of adding components and implemented the right interfaces in 4.1 (e.g. generate-decorations etc.), you should be able to right click on the corresponding object or geometry in the navigator and hide it. It would be good to try that in 4.2 Beta to check the behavior and let us know.

Thank you,
-Ayman

User avatar
Colin Smith
Posts: 53
Joined: Fri Feb 24, 2012 11:50 am

Re: Hide Ellipsoid Joint in GUI

Post by Colin Smith » Mon Feb 22, 2021 1:52 am

Thanks for the info Ayman.

I have attached a screen shot from the 4.2 beta

If I right click on "Joints" there is a hide/show option for all joints. But this does not affect the ellipsoid visualization though. Under the EllipsoidJoint "trunk_to_scapula", there are not any options to control the visualization.

It looks like the ellipsoid display parameters are hard coded into the C++ code.
https://github.com/opensim-org/opensim- ... t.cpp#L167

In the XML Browser for the component I dont see any controls either:

<EllipsoidJoint name="default">
<!--List of components that this component owns and serializes.-->
<components />
<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The parent frame for the joint.).-->
<socket_parent_frame></socket_parent_frame>
<!--Path to a Component that satisfies the Socket 'child_frame' of type PhysicalFrame (description: The child frame for the joint.).-->
<socket_child_frame></socket_child_frame>
<!--List containing the generalized coordinates (q's) that parameterize this joint.-->
<coordinates>
<Coordinate name="_coord_0">
<!--List of components that this component owns and serializes.-->
<components />
<!--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>-10 10</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>
<!--Flag identifies whether or not this coordinate can change freely when posing the model to satisfy kinematic constraints. When true, the coordinate's initial or specified value is ignored when considering constraints. This allows values for important coordinates, which have this flag set to false, to dictate the value of unimportant coordinates if they are linked via constraints.-->
<is_free_to_satisfy_constraints>false</is_free_to_satisfy_constraints>
</Coordinate>
<Coordinate name="_coord_1">
<!--List of components that this component owns and serializes.-->
<components />
<!--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>-10 10</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>
<!--Flag identifies whether or not this coordinate can change freely when posing the model to satisfy kinematic constraints. When true, the coordinate's initial or specified value is ignored when considering constraints. This allows values for important coordinates, which have this flag set to false, to dictate the value of unimportant coordinates if they are linked via constraints.-->
<is_free_to_satisfy_constraints>false</is_free_to_satisfy_constraints>
</Coordinate>
<Coordinate name="_coord_2">
<!--List of components that this component owns and serializes.-->
<components />
<!--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>-10 10</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>
<!--Flag identifies whether or not this coordinate can change freely when posing the model to satisfy kinematic constraints. When true, the coordinate's initial or specified value is ignored when considering constraints. This allows values for important coordinates, which have this flag set to false, to dictate the value of unimportant coordinates if they are linked via constraints.-->
<is_free_to_satisfy_constraints>false</is_free_to_satisfy_constraints>
</Coordinate>
</coordinates>
<!--Physical offset frames owned by the Joint that are typically used to satisfy the owning Joint's parent and child frame connections (sockets). PhysicalOffsetFrames are often used to describe the fixed transformation from a Body's origin to another location of interest on the Body (e.g., the joint center). When the joint is deleted, so are the PhysicalOffsetFrame components in this list.-->
<frames />
<!--Radii of the ellipsoid fixed to the parent frame, specified as a Vec3(rX, rY, rZ).-->
<radii_x_y_z>NaN NaN NaN</radii_x_y_z>
</EllipsoidJoint>

User avatar
Colin Smith
Posts: 53
Joined: Fri Feb 24, 2012 11:50 am

Re: Hide Ellipsoid Joint in GUI

Post by Colin Smith » Mon Feb 22, 2021 1:55 am

OpenSim 4.2 GUI image now attached
Attachments
ellpsoid_joint_4.2.PNG
ellpsoid_joint_4.2.PNG (387.39 KiB) Viewed 318 times

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

Re: Hide Ellipsoid Joint in GUI

Post by Thomas Uchida » Mon Feb 22, 2021 7:04 pm

I encountered the same issue in 4.0. Here's my workaround:
  • in the model file, set the radii of the EllipsoidJoint to, e.g., 1/100 of their desired values
  • save the model
  • open the model in the GUI (the cyan ellipsoid will still be rendered when the model is opened but it will be tiny)
  • run a GUI script that restores the radii to their original values
Here's the script:

Code: Select all

print 'Starting script...'
model = getCurrentModel()
js = model.updJointSet()
for i in range(js.getSize()):
    if (js.get(i).getConcreteClassName() == 'EllipsoidJoint'):
        print '- updating joint ', js.get(i).getName()
        joint = modeling.EllipsoidJoint.safeDownCast(js.get(i))
        oldRadii = joint.get_radii_x_y_z()
        newRadii = modeling.Vec3( oldRadii.get(0)*100.0, oldRadii.get(1)*100.0, oldRadii.get(2)*100.0 )
        joint.set_radii_x_y_z(newRadii)
model.initSystem()
print 'Script complete'
In 4.0, the cyan ellipsoid is not redrawn when the joint's radii are changed.

POST REPLY