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

Add Hydroelastic Collision System #25

Closed

Conversation

gbalke
Copy link

@gbalke gbalke commented Nov 2, 2021

Builds off of #23. Adds hydroelastic collision visualization. The textures are not coming through on current rolling as 8.7.0 was released right before I added the textures. I can bump rviz maintainers to make a release soon if we want this in ASAP.


This change is Reviewable

sloretz and others added 13 commits August 25, 2021 15:24
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Includes Drake C++ systems for tf2 broadcasting.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Greg Balke <greg@openrobotics.org>
Signed-off-by: Greg Balke <greg@openrobotics.org>
Signed-off-by: Greg Balke <greg@openrobotics.org>
Signed-off-by: Greg Balke <greg@openrobotics.org>
@IanTheEngineer
Copy link
Member

@gbalke can you retarget this PR at develop please?

@gbalke gbalke changed the base branch from main to develop November 9, 2021 19:40
@gbalke
Copy link
Author

gbalke commented Nov 9, 2021

To note, there is a big diff from bringing in lodepng which does the raw bitmap to image conversion before transmission to ROS. It's a pretty big file but it is a copy/paste. I don't know how you handle 3rd party libraries so that might be a point of discussion.

@gbalke
Copy link
Author

gbalke commented Nov 9, 2021

To run the whole setup, I'm using my drake-ros docker image https://github.com/gbalke/docker-drake-ros2-opengl

After following setup instructions, make a ros workspace with drake-ros in it inside of the dev folder. Build this inside of the container bash environment. Next, run the following to bring up the visualizers:

# Run this from within the docker container. In this case, my colcon ws is in dev/ros2/
rviz2 rviz2 -d dev/ros2/src/drake-ros/drake_ros_viz/examples/hydroelastic_collisions/hydroelastic_collisions.rviz

# Run this from the drake-ros-docker project folder
./drake_viz.sh

Finally, source the built workspace from within the docker bash environment and run:

ros2 run drake_ros_viz hydroelastic_collisions

You should now see the following:
image

Texture color will be added with the next rviz release. This is what it looks like when compiling rviz from source (ros2 branch):
image

@gbalke
Copy link
Author

gbalke commented Nov 12, 2021

@IanTheEngineer I'm updating my docker-drake-ros2-opengl repo to docker-ros2-opengl. I'm going to instead maintain branches with add-ins so the branch https://github.com/gbalke/docker-ros2-opengl/tree/ros2-drake will have the ros2-drake integration and the ros2 branch will just have ros2 (rolling). This way the work can be re-used for other integration projects.

@sloretz
Copy link
Collaborator

sloretz commented Sep 13, 2022

Closing and continuing in #133

@sloretz sloretz closed this Sep 13, 2022
sloretz added a commit that referenced this pull request Apr 12, 2023
* Copy files from example

Signed-off-by: Greg Balke <greg@openrobotics.org>

* Matching adjusted drake-ros

Signed-off-by: Greg Balke <greg@openrobotics.org>

* Update changes to drake geometry API

Signed-off-by: Greg Balke <greg@openrobotics.org>

* Format with clang

Signed-off-by: Greg Balke <greg@openrobotics.org>

* .cpp/.hpp -> .cc/.h

* Ressurect hydroelastic collisions demo

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Move to drake_ros_examples

* Hydroelastic collisions separate from rviz visualizer

* Remove unneeded variable

* tf2_eigen dep is solely in drake_ros_viz

* Strip drake visualizer stuff for now

* Example is now a ball rolling down a hill

* Follow rolling sphere

* Marker namespace from body names

* ConnectContactResultsToRviz and demo is now a slow super big ball

* Namespace cleanup

* Tweak resolution and timestep for faster demo

* Misc cleanup

* Get contact results from plant instead of scene graph

* Add missing CMakeLists.txt

* Two balls and Hydroelastic with fallback

* Return of the body_names_

* Don't need Shapereifier interface

* Visualize point contacts in RViz too

* Make example about collisions, not just hydroelastic ones

* General collisions example

* Generic example for both point and hydroelastic contacts

* Clang-format

* drake_ros_viz linters pass

* drake_ros_examples linters pass

* Move lodpng.h

* Depend on libgflags-dev

* Set timestamp on markers and drop Pt| prefix

* Default publish rate of 32Hz

* Change view to avoid ros2/rviz#906

* Lifetime changes, file naming, drake-visualizer use

* Separate function for color conversion

* Clearer code creating line segment for visualizing point contacts

* Misc fixes

* Use drake_ros_core geometry conversions

* lint fixes

* get_graph_query_port -> get_graph_query_input_port

* Fix code style

* Use Geometry conversions

* Fix linter

* Merge branch 'main' into sloretz__gbalke__drake_ros_viz_hydroelastic

* build and tests pass

* Hash to tag

* Examples builds and passes tests

* Rename to hydroelastic

* Bazelize hydroelastic example

* Add bazel hydroelastic test

* Remove copyright notice

* Use sdformat file for defining scene (works with Bazel, untested with CMake)

* Remove unused resolution_hint flag

* Fix CMake build

* Put code into a namespace

* drake-visualizer -> meshcat

* Document how to enable meshcat

* Add TODO to make convert_color a public API

* Add LeafSystem doxygen tags

* Linting

* Remove copyright notice and lint

* Remove copyright notice

* Fix copy/paste error in comment

* Remove unnecessary public visibility

* Add TODO for Python example

* Removed copy/pasted parameters

* Don't set maximum step size

* Remove newline

* xmllint --pretty 1

* Added TODO for making all geometries compliant

* Use SimulatorConfig

* Remove unused stuff

* VTK instead of lodepng

* GenerateHeatmapPng()

* VisualizationConfig

* Linter

* depend on libvtk

* libvtk9-dev

* Merge branch 'main' into sloretz__gbalke__drake_ros_viz_hydroelastic

* Update drake_ros namespace usage

* Fix linters

* Add ament_index_share_files

* lint

* clang-format

* Clarify note about runfiles_manifest

* Comment why using ament_index_share_files

* Add note about overriding

* Merge branch 'main' into sloretz__gbalke__drake_ros_viz_hydroelastic

* Update comment

Co-Authored-By: Greg Balke <greg@openrobotics.org>
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.

4 participants