-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DegreeOfFreedom class #288
Conversation
I'm resolving the merge conflict right now. I'm not clear on why appveyor failed. |
|
||
protected: | ||
/// Register a joint with the Skeleton. Internal use only. | ||
void registerJoint(dart::dynamics::Joint* _newJoint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skeleton and Joint are in the same namespace. Why the full namespace is specified here?
Added some commits for style fixes, more comments, and adapting to your (todo) comment in the code, and also made some line notes. Regarding the flag to prevent possible wiping out custom names, I'm not sure what's the best. We may need more discussion on the DegreeOfFreedom name management. Let's leave it as an issue for now. |
The new commit contains two major changes:
|
In the latest changes, if a user calls the "DegreeOfFreedom::setName(string)" function and leaves the second argument as default, it will preserve the custom name that they gave to that DegreeOfFreedom. Related to this, if a custom name is specified in the skel file, it will have that name be preserved. Preserving a name prevents DART from automatically changing the name when its joint properties change. Error checking for the dof element in skel parsing has been improved. If an attribute has the wrong type, it will be reported. Also, the local_index attribute is required for dof elements belonging to multi-dof joints. |
Waiting to make a decision to pick the terminology between "force" or "effort". |
All uses of "Effort" have now been switched to "Force" to match the rest of DART's conventions. |
Manually merged the master branch into here so that the pull request can be auto-merged |
+1 |
This pull request introduces the DegreeOfFreedom class which serves as a proxy class for getting/setting the data (e.g. position, velocity, acceleration, force, limits, etc) of individual generalized coordinates (aka degrees of freedom). This pull request also gives names to each degree of freedom and allows each degree of freedom to be accessed by name. The name of each degree of freedom in a given Skeleton is kept unique by the NameManager class.
By default, each degree of freedom is given a name based on the name of the joint it belongs to. For SingleDofJoints, their single dof is just given the same name as the joint itself. For MultiDofJoints, the dof is given a name with the pattern "<joint_name>_" where "<joint_name>" is simple the name of its joint, and "" indicates its role in the joint. For example, a TranslationalJoint named "joint1" will be given degrees of freedom with the following names: "joint1_x", "joint1_y", and "joint1_z".
The user can rename any DegreeOfFreedom at any time, however names that match already existing DOF names will be altered by the NameManager to prevent a lookup conflict.
When the user changes a joint name using Joint::setName(~), they are given the option of whether or not to have the joint's degrees of freedom automatically renamed as well (default is true).
Something to consider: Currently, if the Skeleton's Joint NameManager needs to change a joint's name to prevent a naming conflict, it will also rename that Joint's DegreesOfFreedom to match the new name. This could potentially wipe out custom names that the user might have given to that Joint's DegreesOfFreedom. Should we have a flag that the user can set to prevent this behavior?