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

[GSOC-95] Custom ros_gz bridge for DVL plugin #14

Merged
merged 14 commits into from
Aug 19, 2024
Merged

[GSOC-95] Custom ros_gz bridge for DVL plugin #14

merged 14 commits into from
Aug 19, 2024

Conversation

rakeshv24
Copy link
Collaborator

@rakeshv24 rakeshv24 commented Aug 18, 2024

This PR introduces the following features and improvements:

  1. Developed a custom bridge to subscribe to Gazebo DVL messages and publish them to a ROS 2 topic using custom message types. This plugin can be integrated at the model level for added flexibility.

  2. Added the corresponding custom ROS 2 messages to the dave_interfaces package, and developed the plugin in the dave_ros_gz_plugins package.

  3. Integrated the gz::sim::systems::DopplerVelocityLogSystem plugin into the dvl_world.sdf file for testing purposes.

  4. Included multiple DVL sensor models in the dave_sensor_models package.

  5. Updated the launch files in the dave_demos package to improve generalization and flexibility.

Please find the documentation here.

Note: The water tracking mode has not yet been tested. It will be verified once the ocean current plugin is available.

@rakeshv24 rakeshv24 self-assigned this Aug 18, 2024
@rakeshv24 rakeshv24 changed the title Custom ros_gz bridge for DVL plugin [GSoC-95] Custom ros_gz bridge for DVL plugin Aug 18, 2024
@rakeshv24 rakeshv24 changed the title [GSoC-95] Custom ros_gz bridge for DVL plugin [GSOC-95] Custom ros_gz bridge for DVL plugin Aug 18, 2024
Copy link

@woensug-choi woensug-choi left a comment

Choose a reason for hiding this comment

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

ros2 launch dave_demos dave_sensor.launch.py namespace:=nortek_dvl500_300 world_name:=dvl_world paused:=false headless:=true
[INFO] [launch]: All log files can be found below /Users/woensug/.ros/log/2024-08-19-10-17-28-813507-MBP.local-78177
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ruby $(which gz) sim-1]: process started with pid [78183]
[INFO] [create-2]: process started with pid [78184]
[ruby $(which gz) sim-1] Ignoring ffi-1.16.3 because its extensions are not built. Try: gem pristine ffi --version 1.16.3
[create-2] [INFO] [1724030251.959774000] [ros_gz_sim]: Requesting list of world names.
[create-2] [INFO] [1724030252.181646000] [ros_gz_sim]: Requested creation of entity.
[create-2] [INFO] [1724030252.181670000] [ros_gz_sim]: OK creation of entity.
[create-2] [ERROR] [1724030252.292380000] [rclcpp]: unhandled exception in ~Context(): mutex lock failed: Invalid argument
[INFO] [create-2]: process has finished cleanly [pid 78184]
[INFO] [launch.user]: Sensor Model Uploaded

Hmm... errror while parsing launch arguments?

BTW, thank you so much for thoughtful changes in the launching structures of dave_demo

"x": x,
"y": y,
"z": z,
"roll": roll,

Choose a reason for hiding this comment

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

I've just found out that the launch argument roll, pitch ,yaw does not work. It has to be R, P, Y. We should modify from line 80-82, 20-22, and any other launch.py that uses this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@woensug-choi I just tried launching with all the arguements and seems to work fine. I used the following command:

ros2 launch dave_demos dave_sensor.launch.py namespace:=nortek_dvl500_300 world_name:=dvl_world paused:=false x:=0 y:=1.2 z:=-20 roll:=1.57 pitch:=0.0 yaw:=0.0 headless:=false gui:=true verbose:=true paused:=false

roll, pitch, and yaw are in radians.

I'm not sure why it does not work for you.

Choose a reason for hiding this comment

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

If it worked for you. never mind for this PR (as it is not critically related to this)

Copy link
Collaborator Author

@rakeshv24 rakeshv24 Aug 19, 2024

Choose a reason for hiding this comment

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

Actually, you are right. It should be R, R, Y.

I'll make the changes! Thanks for pointing that out!

Choose a reason for hiding this comment

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

Strange! ros2 launch dave_demos dave_sensor.launch.py namespace:=nortek_dvl500_300 world_name:=dvl_world paused:=false x:=0 y:=1.2 z:=-20 roll:=1.57 pitch:=0.0 yaw:=0.0 headless:=false gui:=true verbose:=true paused:=false works find on ubuntu native install machine but causes context error in Mac. (again, if it's only mac problem. ignore for sake of this PR).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Strange! It works fine for me both on ubuntu native and mac.

@woensug-choi do you think the problem could be coming from here?

I have committed some changes. Please check if the error still occurs.

Choose a reason for hiding this comment

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

@rakeshv24 Yes it seems... but don't know why...!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@woensug-choi it seems that the problem can be resolved by properly shutting down the node. But since this actually does not hinder with the functionality of the code, we can maybe resolve it later. What do you think?

Copy link

@woensug-choi woensug-choi left a comment

Choose a reason for hiding this comment

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

Saw some warnings in the DVL types. Suggested some fixes. Need to check whether it works alright.

gazebo/dave_ros_gz_plugins/src/DVLBridge.cc Outdated Show resolved Hide resolved
gazebo/dave_ros_gz_plugins/src/DVLBridge.cc Outdated Show resolved Hide resolved
gazebo/dave_ros_gz_plugins/src/DVLBridge.cc Outdated Show resolved Hide resolved
@woensug-choi
Copy link

The DVL sensor falls down as it starts. Could we keep it fixed at a position few meters above ground with <static> at SDF?

@rakeshv24 rakeshv24 requested a review from woensug-choi August 19, 2024 02:20
@rakeshv24
Copy link
Collaborator Author

@woensug-choi I have incorporated all your suggestions. Hope it works fine now!

Copy link

@woensug-choi woensug-choi left a comment

Choose a reason for hiding this comment

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

Everything works as described in the documentation here

I've made a minor mod to adjust initial camera position at the dvl_world

P.S. I still get [create-2] [ERROR] [1724048769.870106000] [rclcpp]: unhandled exception in ~Context(): mutex lock failed: Invalid argument error on Native installed Mac OS though.

@rakeshv24
Copy link
Collaborator Author

@woensug-choi okay great! In that case, can I merge this?

@woensug-choi
Copy link

@rakeshv24 Yes Please!

@rakeshv24 rakeshv24 merged commit 98d4849 into ros2 Aug 19, 2024
1 check passed
@rakeshv24 rakeshv24 deleted the dvl branch August 19, 2024 08:39
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