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

Hybrid dynamics #298

Merged
merged 38 commits into from
Jan 8, 2015
Merged

Hybrid dynamics #298

merged 38 commits into from
Jan 8, 2015

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Jan 7, 2015

This pull request adds hybrid dynamics. In the hybrid dynamics problem, we are given either joint force or joint acceleration at each joint, and the task is to calculate the unknown accelerations and forces. In effect, hybrid dynamics is like performing forward dynamics at some of the joints and inverse dynamics at the rest. Hybrid dynamics is used to introduce prescribed motions into a rigid-body system. [1]

This pull request also introduces joint actuator types: force, passive, acceleration, and velocity (servo is not implemented yet). The hybrid dynamics performs forward dynamics for force and passive types, and inverse dynamics for acceleration and velocity types. Here is description on the command input and the output for each actuator types. The command can be set by calling Joint::setCommand() or Skeleton::setCommand().

  • FORCE: The command input is joint force, and the output is joint acceleration. If the command is always set to zero, then the force joint is identical to passive joint.
  • PASSIVE: The command input is joint force and always zero (ignore command from the user), and the output is joint acceleration.
  • ACCELERATION: The command input is joint acceleration, and the output is joint force.
  • VELOCITY: The command input is joint velocity, and the output is joint force.
  • LOCKED: Locked joint always set the velocity and acceleration to zero so that the joint doesn't move from the current position (locked), and the output is joint force.

The joint actuator type can be specified by calling Joint::setActuatorType(). The default type is FORCE for backward compatibility.

We define FORCE/PASSIVE/SERVO joints are dynamic joints while ACCELERATION/VELOCITY/LOCKED joints are kinematic joints. (see also: Joint::isKinematic() and Joint::isDynamic())

Example app, hybridDyanmics is added, and basic unit tests are added as well. SkelParser can parse the actuator type as an optional attribute of <joint>. If it is not specified, force type is used as default. The description of the updated skel file format can be found at wiki. Here is an example of specifying joint actuator type:

<joint type="revolute" name="joint1" actuator="force">
    <parent>link 1</parent>
    <child>link 2</child>
</joint>

Minor changes:

  • Enabled JAVADOC_AUTOBRIEF option of doxygen
  • Deprecated Joint::mWrench
  • Deprecated castUIntToInt()

[1] Roy Featherstone, Rigid Body Dynamics Algorithms, Springer, New York, 2008.

jslee02 added 30 commits January 3, 2015 01:43
@jslee02 jslee02 added this to the Release DART 4.3 milestone Jan 7, 2015
@jslee02 jslee02 added Comp: Dynamics priority: medium should be resolved before the next release tag: feature request Indicates new feature requests labels Jan 7, 2015
@jslee02
Copy link
Member Author

jslee02 commented Jan 7, 2015

I found two things to be done:

  • Joint position limit should be ignored when the actuator type is ACCELERATION or VELOCITY
  • Check routine is needed to determine that a body is responsive to impulse depending on the actuator type of its parent joint.

@jslee02
Copy link
Member Author

jslee02 commented Jan 8, 2015

The last commit contains following changes:

  • It defines motion-prescribed joint, which means the joint takes prescribed motion as command input. ACCELERATION/VELOCITY joints are the prescribed joint. Joint::isMotionPrescribed() returns whether the joint is prescribed.
  • If the joint is motion-prescribed joint then the constraint solver ignore joint position limit.
  • If two bodies are colliding whose all the ancestor joints are motion-prescribed joints, then constraint solver ignore the contact constraint as well because the bodies are not reactive to contact impulse.

Waiting to pass build tests of Travis-CI and Appveyor.

@jslee02
Copy link
Member Author

jslee02 commented Jan 8, 2015

  • Added "locked" actuator type whose velocity and acceleration are always zero so that the joint doesn't move at all from the current position.
  • Renamed Joint::isMotionPrescribed() to Joint::isKinematic(), and added Joint::isDynamic().

@jslee02
Copy link
Member Author

jslee02 commented Jan 8, 2015

Ready to merge
+1

jslee02 added a commit that referenced this pull request Jan 8, 2015
@jslee02 jslee02 merged commit a394956 into master Jan 8, 2015
@jslee02 jslee02 deleted the hybrid_dynamics branch January 15, 2015 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium should be resolved before the next release tag: feature request Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant