I have created custom joint (1DOF) between ground and a point mass using the following workflow:
Coordinate-----(coordinate name)---->TransformAxis----->Spatial Transform ------>Custom Joint
|
|-----------(append_coordinate)------>Custom Joint
Is the Joint supposed to take the ownership of coordinates?
Are we supposed to use some other method than append_coordinate() ?
Kind regards
Vinay
Code
https://github.com/vinaym815/OpenSimExa ... c/main.cpp
Custom Joint Query
Re: Custom Joint Query
Perhaps try instantiating the SpatialTransform first since it holds a set of six coordinates, edit each coordinate in the SpatialTransform, then construct the CustomJoint using this constructor. There seems to be a good example of this in one of the CustomJoint tests here.
Re: Custom Joint Query
This previous post may also be useful; viewtopicPhpbb.php?f=91&t=9061&p=0&start=0&view=
- Vinay Kumar
- Posts: 34
- Joined: Thu Nov 08, 2018 6:50 am
Re: Custom Joint Query
Thank you for your reply. However, I still require some clarification.jimmy wrote: ↑Sun Jul 28, 2019 11:44 amPerhaps try instantiating the SpatialTransform first since it holds a set of six coordinates, edit each coordinate in the SpatialTransform, then construct the CustomJoint using this constructor. There seems to be a good example of this in one of the CustomJoint tests here.
If I create the custom joint as explained in the example here, the API creates a template coordinate named "knee_r" and assigns it to the knee joint. Now, if I desire to put some constraints on the "knee_r" coordinate, like a default value or a range, I am required to acquire it's handle from the joint definition using an upd command. However, I was hoping for a simpler solution which avoids the instantiation of the template "knee_r" joint. I found this this code to work as I desire but it requires the use of command append_coordinates, which I find worrying as I think the methods with "_" in their name are not supposed to be called by the user.
Also If I wish to use a single coordinate for two different joints, so that they mimic each other's motion, will this work i.e. Can different joints share the same coordinate? To rephrase it, Is the coordinate definition owned by that of the joint?
Re: Custom Joint Query
The contributing guide doesn't indicate that methods with underscores are supposed to be not called by the user (see below) so you should be fine to use .append_coordinates()
As far as I am aware, joints own the coordinates so coordinates can't be shared.Naming conventions
Please follow the convention that property, input, and output names use the lower_case_with_underscores convention, while class names use UpperCamelCaseWithoutUnderscores. This ensures no conflicts with XML tag names and makes it easy to tell a property name from a class name
- Thomas Uchida
- Posts: 1803
- Joined: Wed May 16, 2012 11:40 am
Re: Custom Joint Query
You could try using a CoordinateCouplerConstraint (https://simtk.org/api_docs/opensim/api_ ... raint.html) so that one Coordinate follows the other.If I wish to use a single coordinate for two different joints, so that they mimic each other's motion, will this work i.e. Can different joints share the same coordinate?
- Vinay Kumar
- Posts: 34
- Joined: Thu Nov 08, 2018 6:50 am
Re: Custom Joint Query
Thank You @James Dunne and @Thomas Uchida for your replies.