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

Initial closed-loop mechanism implementation #149

Merged
merged 13 commits into from
Feb 2, 2017
Merged

Conversation

tkoolen
Copy link
Collaborator

@tkoolen tkoolen commented Feb 2, 2017

Initial support for closed-loop mechanisms (see #85).

The attach! function now figures out whether the predecessor and successor are already part of the Mechanism, and if so, creates a NonTreeEdge instead of adding a new vertex and edge to the tree.

Also adds a maximal_coordinates function that takes a Mechanism and creates an equivalent Mechanism with all RigidBodys attached directly to the world using a QuaternionFloating joint, while adding all of the joints of the input Mechanism as NonTreeEdges (i.e. loop constraints). A test verifies that doing dynamics for a random Mechanism and its corresponding maximal_coordinates version gives the same result.

For now, Mechanism manipulation functions like submechanism, reattach!, etc. don't support Mechanisms with NonTreeEdges (they throw an error when such edges are present).

Long-term, I'd like to switch to a proper graph structure for the Joint/RigidBody graph in a Mechanism (perhaps Graph from Graphs.jl).

Still need to implement constraint projection in the integrator.

Also fix some minor type issues.

…bian, to be used for constraint Jacobian as well
Adds maximal_coordinates, which takes a mechanism and turns it into a
height-one tree with floating joints at the tree edges, while the joints
of the input mechanism become non-tree edges in the
maximal-coordinates-mechanism.

Also fixes a bug in the constraint bias computation.

Test asserts that doing dynamics for a random Mechanism and for a
maximal-coordinates version of that Mechanism results in the same
spatial accelerations.
@tkoolen tkoolen changed the title Closed loop solve Initial closed-loop mechanism implementation Feb 2, 2017
@codecov-io
Copy link

codecov-io commented Feb 2, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@aa5c651). Click here to learn what that means.

@@            Coverage Diff            @@
##             master     #149   +/-   ##
=========================================
  Coverage          ?   91.56%           
=========================================
  Files             ?       16           
  Lines             ?     1695           
  Branches          ?        0           
=========================================
  Hits              ?     1552           
  Misses            ?      143           
  Partials          ?        0
Impacted Files Coverage Δ
src/mechanism_algorithms.jl 100% <100%> (ø)
src/spatial.jl 89.41% <100%> (ø)
src/mechanism_state.jl 93.89% <100%> (ø)
src/dynamics_result.jl 100% <100%> (ø)
src/joint.jl 92.59% <100%> (ø)
src/joint_types.jl 92.17% <72.72%> (ø)
src/mechanism.jl 96.49% <97.95%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa5c651...cdfd98c. Read the comment docs.

@tkoolen tkoolen merged commit 6760f08 into master Feb 2, 2017
@tkoolen tkoolen deleted the closed-loop-solve branch February 2, 2017 23:23
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