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 sitl viewer to use ArduPilot FDM #91

Closed
wants to merge 3 commits into from

Conversation

Ryanf55
Copy link
Contributor

@Ryanf55 Ryanf55 commented Apr 20, 2024

Purpose

Add a basic program to show how to update the gazebo UI through the protobuf interface with data from ROS.

Looking for feedback. I kept it as a separate package because it depends on rclcpp and the gazebo transport.

This allows you to use gazebo to show the Ardupilot SITL FDM state, but add other things in gazebo.
It's useful if you don't want to write all your own physics in gazebo and don't care much about accurate flight dynamics.

I took the protobuf approach because I didn't want to write a plugin. A plugin seems like overkill.

Run Instructions

  • Check out this PR in your workspace too: Add SITL viewer model ardupilot_gz#51
  • Run ArduPilot SITL with ROS: https://ardupilot.org/dev/docs/ros2-sitl.html#ros-2-with-sitl
  • Build the workspace with colcon
  • Start gazebo gz sim iris_viewer.sdf, click run. There's a little black box, which is the "vehicle", which is a NavSat sensor and NavSat-named box entity. The NavSat sensor will fall due to gravity. No worries!
  • Run the ardupilot gazebo sitl viewer ros2 run ardupilot_gazebo_sitl_viewer SitlViewerNode
    • Now, the SitlViewerNode will convert NavSatFix fromArduPilot's DDS interface to set the global position of the little NavSat box.
  • Echo the navsat data from gazebo: gz topic -e -t /navsat, which is updated by the ArduPilot FDM

Issue

Relates to #90

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
@Ryanf55 Ryanf55 changed the title Add sitl viewer to use ArduPilot Add sitl viewer to use ArduPilot FDM Apr 20, 2024
@Ryanf55 Ryanf55 marked this pull request as draft April 20, 2024 03:01
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
@srmainwaring
Copy link
Collaborator

@Ryanf55, this adds a build dependency on ROS, and this repo is intentionally ROS independent. Perhaps we could move the feature to the ardupilot_gz repo?

@srmainwaring srmainwaring self-requested a review April 20, 2024 09:00
@srmainwaring srmainwaring self-assigned this Apr 20, 2024
@srmainwaring srmainwaring added the enhancement New feature or request label Apr 20, 2024
@Ryanf55
Copy link
Contributor Author

Ryanf55 commented Apr 20, 2024

@Ryanf55, this adds a build dependency on ROS, and this repo is intentionally ROS independent. Perhaps we could move the feature to the ardupilot_gz repo?

Done! I wasn't sure if the design intent here was to have the repo independent, or just the package independent. The reason I PR'd it here was the high level purpose of each package is connecting gazebo and ArduPilot through some transport was the same, but you could skip ROS by using CMake directly in ardupilot_gazebo, or with --packages-up-to.

Please take a look at the linked PR in ardupilot_gazebo now. I'll close this.

@Ryanf55 Ryanf55 closed this Apr 20, 2024
@Ryanf55 Ryanf55 deleted the add-sitl-viewer branch April 20, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants