Skip to content
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

Merged
merged 34 commits into from
Jan 15, 2015
Merged

DegreeOfFreedom class #288

merged 34 commits into from
Jan 15, 2015

Conversation

mxgrey
Copy link
Member

@mxgrey mxgrey commented Dec 16, 2014

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?

@mxgrey
Copy link
Member Author

mxgrey commented Dec 16, 2014

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);
Copy link
Member

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?

@jslee02
Copy link
Member

jslee02 commented Jan 1, 2015

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.

@jslee02 jslee02 mentioned this pull request Jan 1, 2015
@jslee02 jslee02 added this to the Release DART 4.3 milestone Jan 1, 2015
@mxgrey
Copy link
Member Author

mxgrey commented Jan 3, 2015

The new commit contains two major changes:

  1. I've added a dof element into the skeleton file format. This allows skeleton files to specify things like name and position/velocity/acceleration limits for individual degrees of freedom in each joint. The format is agnostic to the type of joint. The old approach still works (i.e. using axis, axis2, axis3, etc. elements), but any information provided in the new dof element will override any information provided by the old format.

  2. The user now has the ability to lock-in their customized DOF names so that they will not automatically get overwritten. I found that having this feature was necessary in order to correctly parse DOF names in skeleton files, so now the user has access to this feature as well.

@mxgrey
Copy link
Member Author

mxgrey commented Jan 3, 2015

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.

@jslee02
Copy link
Member

jslee02 commented Jan 6, 2015

Waiting to make a decision to pick the terminology between "force" or "effort".

@mxgrey
Copy link
Member Author

mxgrey commented Jan 10, 2015

All uses of "Effort" have now been switched to "Force" to match the rest of DART's conventions.

@mxgrey
Copy link
Member Author

mxgrey commented Jan 14, 2015

Manually merged the master branch into here so that the pull request can be auto-merged

@jslee02
Copy link
Member

jslee02 commented Jan 14, 2015

+1

jslee02 added a commit that referenced this pull request Jan 15, 2015
@jslee02 jslee02 merged commit 31148ef into master Jan 15, 2015
@mxgrey mxgrey deleted the grey/features branch January 27, 2015 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants