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

Highlight selected links in publishRobotState() + improved collision visualization #45

Merged

Conversation

henningkayser
Copy link
Member

@henningkayser henningkayser commented Mar 27, 2019

The current implementation of publishRobotState() allows coloring all links with a specific color.
This PR adds an optional argument highlight_links for specifying only a set of link names that should be highlighted with the given color. One example scenario would be to highligh links if they are in collision.

I'm also thinking of adding another function visualizeCollisionResult() or even checkCollision() that runs a collision check and then highlights the colliding links and publishes contact points using publishContactPoints().

UPDATE - I extended this PR

  • adds checkAndPublishCollision() for performing collision checks and highlighting the results
  • adds publishContactPoints() that allows passing CollisionResult::ContactMap which allows visualizing contact points for already performed collision checks

include/moveit_visual_tools/moveit_visual_tools.h Outdated Show resolved Hide resolved
src/moveit_visual_tools.cpp Outdated Show resolved Hide resolved
const std::vector<const moveit::core::LinkModel*>& link_names =
robot_state.getRobotModel()->getLinkModelsWithCollisionGeometry();
const std::vector<std::string>& link_names =
highlight_links.empty() ? robot_state.getRobotModel()->getLinkModelNamesWithCollisionGeometry() :
Copy link
Member

Choose a reason for hiding this comment

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

getLinkModelNamesWithCollisionGeometry() may limit you... there is visual geometry that you might want to highlight that isn't listed in collision geometry. can we make this more generic?

Copy link
Member

Choose a reason for hiding this comment

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

ah i realize this was my previous behavior. now im wondering if it makes sense, but its a bit off topic i guess

Copy link
Member Author

Choose a reason for hiding this comment

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

I think using this function is perfectly fine. Links where there is only a visual defined use the underlying geometry as collision shape. I tested this and the function really highlights all links even though there are only visual shapes defined in the urdf.

Improve documentation

Co-Authored-By: henningkayser <henningkayser@picknik.ai>
@henningkayser henningkayser changed the title Highlight only selected links in publishRobotState() Highlight selected links in publishRobotState() + improved collision visualization Apr 2, 2019
@henningkayser
Copy link
Member Author

@davetcoleman I extended this PR with improved collision visualization functions since the code is closely related.

@davetcoleman
Copy link
Member

Travis is failing on master, unrelated to this PR. I've attempted to fix here: #47

Merging this now so we can continue to contribute to open source on a client project.

@davetcoleman davetcoleman merged commit 66215ea into moveit:melodic-devel Apr 22, 2019
davetcoleman pushed a commit that referenced this pull request Apr 22, 2019
…visualization (#45)

* Highlight only selected links in publishRobotState()

* Apply suggestions from code review

Improve documentation

Co-Authored-By: henningkayser <henningkayser@picknik.ai>

* Check for and visualize collisions with checkAndPublishCollision()
@davetcoleman
Copy link
Member

Cherry picked to master.

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.

None yet

3 participants