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

Stop using canonicalize_graph! in MechanismState ctor (and write_urdf). #525

Merged
merged 1 commit into from
Jan 11, 2019

Conversation

tkoolen
Copy link
Collaborator

@tkoolen tkoolen commented Jan 2, 2019

Using canonicalize_graph! in the MechanismState constructor was necessary
because removing a tree joint can make it so that the indices of the
tree joints are no longer ordered and contiguous. However, it made it so
that constructing MechanismStates was not thread-safe. In addition, it
was perhaps an unexpected (although harmless) behavior to have
the Mechanism be modified in any way upon MechanismState construction or
in write_urdf.

Instead, just canonicalize the graph in remove_joint! and remove_fixed_tree_joints!.

This is covered by the reattach test set.

Also some random minor changes in related code that I should have separate out, but OK.

@codecov-io
Copy link

codecov-io commented Jan 11, 2019

Codecov Report

Merging #525 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #525      +/-   ##
==========================================
+ Coverage   99.53%   99.53%   +<.01%     
==========================================
  Files          42       42              
  Lines        2787     2795       +8     
==========================================
+ Hits         2774     2782       +8     
  Misses         13       13
Impacted Files Coverage Δ
src/urdf/URDF.jl 100% <ø> (ø) ⬆️
src/mechanism_state.jl 100% <100%> (ø) ⬆️
src/urdf/write.jl 100% <100%> (ø) ⬆️
src/graphs/spanning_tree.jl 100% <100%> (ø) ⬆️
src/graphs/tree_path.jl 100% <100%> (ø) ⬆️
src/mechanism_modification.jl 97.76% <100%> (+0.12%) ⬆️

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 cc92e99...c66609b. Read the comment docs.

Using canocalize_graph! in the MechanismState constructor was necessary
because removing a tree joint can make it so that the indices of the
tree joints are no longer ordered and contiguous. However, it made it so
that constructing MechanismStates was not thread-safe. In addition, it
was perhaps an unexpected (although mostly harmless) behavior to have
the Mechanism be modified in any way upon MechanismState construction or
in write_urdf.

Instead, canonicalize the graph in remove_joint! and
remove_fixed_tree_joints!.
@tkoolen tkoolen merged commit 3dc4e49 into master Jan 11, 2019
@tkoolen tkoolen deleted the tk/redo-canonicalize-graph branch January 11, 2019 22:54
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