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

Framework to view the buoy on RViz #50

Merged
merged 28 commits into from
Jul 6, 2022
Merged

Framework to view the buoy on RViz #50

merged 28 commits into from
Jul 6, 2022

Conversation

quarkytale
Copy link
Contributor

@quarkytale quarkytale commented May 25, 2022

Requires


Tailored our SDF model and brought up upstream support for viewing the WEC on RViz.

Usage

Launch Arguments (pass arguments as '<name>:=<value>'):

'world_file':
    Gazebo world filename.sdf
    (default: 'mbari_wec.sdf')

'world_name':
    Gazebo <world name>
    (default: 'world_demo')

'rviz':
    Open RViz.
    (default: 'false')

Run with launch arguments set:

ros2 launch buoy_gazebo mbari_wec.launch.py rviz:=True world_file:=buoy_playground.sdf world_name:=playground

Note: Ignore the RViz warning [rviz2-5] Warning: Invalid frame ID "MBARI_WEC/odom" passed to canTransform argument target_frame - frame does not exist

Snapshots

buoy_gazebo_rviz

buoy_on_rviz.mp4

Progress log

Breaking it down into smaller issues:

  • sdformat version should be 1.7 See comment
  • Sensors in the model are not supported by URDF
  • Unsupported joint types: ball, universal, screw, revolute2, gearbox sdformat_urdf PR #13
  • Cannot have multiple root links, all links (except one root link) should have a parent
  • Publishing tfs vis ros_ign

For more details on limitations of the parser see README in the sdformat_urdf package

Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@quarkytale quarkytale self-assigned this May 25, 2022
@quarkytale quarkytale linked an issue May 25, 2022 that may be closed by this pull request
3 tasks
@quarkytale quarkytale changed the title Framework to View the buoy on RViz Framework to view the buoy on RViz May 25, 2022
@quarkytale quarkytale marked this pull request as draft May 25, 2022 03:08
@quarkytale quarkytale requested a review from chapulina May 25, 2022 03:17
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@chapulina
Copy link
Contributor

I'm able to load the meshes prefixed by package:// on both RViz and Gazebo with this change:

diff --git a/buoy_description/hooks/buoy_description.dsv.in b/buoy_description/hooks/buoy_description.dsv.in
index 54beeea..c0ae662 100644
--- a/buoy_description/hooks/buoy_description.dsv.in
+++ b/buoy_description/hooks/buoy_description.dsv.in
@@ -1 +1 @@
-prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/models
+prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share

What Gazebo does is strip everything up to :// and try prefixing the rest of the URL with all paths in the IGN_GAZEBO_RESOURCE_PATH environment variable.

For example, with that change, after sourcing my colcon workspace, I see these values for the environment variable:

$ env | grep RES
IGN_GAZEBO_RESOURCE_PATH=/home/chapulina/dev_focal/ws_fortress/install/share/buoy_gazebo/worlds:/home/chapulina/dev_focal/ws_fortress/install/share

So consider a URI like this:

https://github.com/osrf/buoy_sim/blob/ff2f498a5afda06bf0a42d4188fc3d7bf6c582b4/buoy_gazebo/worlds/test_mbari_wec_model.sdf#L22

Gazebo will try:

  1. /home/chapulina/dev_focal/ws_fortress/install/share/buoy_gazebo/worlds/buoy_description/models/mbari_wec/meshes/buoy_float.stl - that doesn't exist, continue
  2. /home/chapulina/dev_focal/ws_fortress/install/share/buoy_description/models/mbari_wec/meshes/buoy_float.stl - that exists!

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Just gave it a quick try

…d fixed alph order

Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@@ -47,7 +47,7 @@ tether_bottom_link_cylinder.set_mat(Material(tether_density))
tether_bottom_link_mm = MassMatrix3d()
tether_bottom_link_cylinder.mass_matrix(tether_bottom_link_mm)
}@
<sdf version="1.8">
<sdf version="1.7">
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 we should be able to keep 1.8 once we start using Fortress in sdformat_urdf, see

Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@quarkytale quarkytale marked this pull request as ready for review June 7, 2022 23:40
@quarkytale
Copy link
Contributor Author

Though the functionality is still incomplete (tfs aren't being published, wip on ros_ign), this should be clear now to be merged as its won't affect simulating using gazebo!

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Just checking, with this PR as is, the buoy doesn't show on RViz, right? We need TF for it?

Also note that there are linter errors.

@quarkytale
Copy link
Contributor Author

Just checking, with this PR as is, the buoy doesn't show on RViz, right? We need TF for it?
No the buoy would still be visible, only it can't translate movement in rviz as seen in gazebo.

I think I found the issue with the transforms. Seems like coming from here or its ros2 equivalent https://github.com/ros/kdl_parser/blob/a1ba6dfffc9c95b30d8a099f8785db4cf5c0342f/kdl_parser/src/kdl_parser.cpp#L103. Not sure what this library does but missing universal joint support.

Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@quarkytale quarkytale requested a review from chapulina June 13, 2022 19:20
chapulina and others added 4 commits June 13, 2022 13:11
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
SDF to URDF: topics and remappings
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
quarkytale and others added 2 commits June 13, 2022 15:30
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Great work! I just have some smaller comments, and we should wait for ros/sdformat_urdf#13 to be merged before merging this one.

Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@chapulina chapulina self-requested a review June 17, 2022 16:48
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
@quarkytale
Copy link
Contributor Author

Support from sdformat_urdf and upstream Gazebo is all merged! This is ready for a final review.

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

LGTM! The only things missing before merging:

chapulina and others added 4 commits June 20, 2022 20:09
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Publish tf_static with transient_local durability
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Works great! All necessary releases are out, this is good to go!

@chapulina chapulina merged commit 0bb9112 into main Jul 6, 2022
@chapulina chapulina deleted the quarkytale/rviz branch July 6, 2022 22:26
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.

View the buoy on RViz
2 participants