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

New API #3

Merged
merged 7 commits into from
Feb 28, 2018
Merged

New API #3

merged 7 commits into from
Feb 28, 2018

Conversation

rdeits
Copy link
Collaborator

@rdeits rdeits commented Feb 28, 2018

@tkoolen this diverges a bit from the way RigidBodyTreeInspector.jl worked, but I think it's for the better. This package now exports a MechanismVisualizer type which holds a MechanismState. So to visualize a robot, you do:

mvis = MechanismVisualizer(robot, ...)

and to draw it in a configuration, you just use RigidBodyDynamics.set_configuration!:

set_configuration!(mvis, q)  # or (mvis, joint, qi) as in RBD.jl

This should alleviate the annoyance of always having to make a new state just for the visualizer.

I've also turned on animation and the OdeIntegrators sink. I haven't made the demo as nice as before, but most of the important features should be in.

@codecov-io
Copy link

codecov-io commented Feb 28, 2018

Codecov Report

Merging #3 into master will decrease coverage by 0.64%.
The diff coverage is 88.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
- Coverage    88.8%   88.16%   -0.65%     
==========================================
  Files           1        4       +3     
  Lines         134      169      +35     
==========================================
+ Hits          119      149      +30     
- Misses         15       20       +5
Impacted Files Coverage Δ
src/ode_callback.jl 100% <100%> (ø)
src/animate.jl 78.26% <78.26%> (ø)
src/parse_urdf.jl 86.73% <86.73%> (ø)
src/visualizer.jl 95% <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 caeac58...75e0bb7. Read the comment docs.

@rdeits rdeits merged commit 03b5cdd into master Feb 28, 2018
@rdeits rdeits deleted the new-api branch February 28, 2018 06:18
Copy link
Contributor

@tkoolen tkoolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be awesome!

Base.one(::Type{InterpolatableArray{A}}) where {A} = 1
Base.:*(n::Number, a::InterpolatableArray) = n * a.data

rbd.normalize_configuration!(joint_type::JointType, q) = nothing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are unused now, right? Since you're using RigidBodyDynamics.normalize_configuration! below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I'll fix that in #4

tree = mechanism.tree # TODO: tree accessor?
for vertex in rbd.Graphs.vertices(tree)
body = vertex
body_ancestors = rbd.Graphs.ancestors(vertex, tree)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, glad to see the RBD.Graphs stuff coming in handy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it's great!

settransform!(vis, to_affine_map(transform_to_root(state, body)))
else
body_ancestors = rbd.Graphs.ancestors(vertex, tree)
path = Symbol.(string.(reverse(body_ancestors)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nice to just store these in a Dict in MechanismVisualizer maybe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good idea; #5. The conversion to Symbol is also unnecessary, so I'll remove that in #4

This was referenced Feb 28, 2018
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.

3 participants