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

Update GZBridge to be able to use gazebo airspeed. Add quadtailsitter. #23455

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

jmackay2
Copy link
Contributor

Solved Problem

When adding a gz tailsitter, I found out that the current airspeed simulation is hard-coded to use the body velocity in the x direction. This doesn't work for the tailsitter, where the airspeed sensor needs to be rotated by 90 degrees to work correctly in fixed-wing flight.

Solution

This uncomments the gazebo airspeed integrations in the GZBridge and adds minor fixes to work correctly. This also adds a gazebo quadtailsitter configuration.

Changelog Entry

For release notes:

Feature: Adds the capability to use the Gazebo airspeed sensor and adds a Gazebo quadtailsitter.

Test coverage

  • Simulation of the standard_vtol model in gazebo.
  • Simulation of the quadtailsitter. The quadtailsitter in fixed-wing is very fast and probably needs a little more modifications to be more realistic.

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

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

LGTM!

@Jaeyoung-Lim
Copy link
Member

@jmackay2 Could you rebase the PR so we can see if the SITL failures are real?

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

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

Thanks!

@Jaeyoung-Lim Jaeyoung-Lim merged commit 7e45f49 into PX4:main Aug 19, 2024
92 checks passed
@daeyeonk
Copy link

daeyeonk commented Aug 19, 2024

Is this causing "make px4_sitl" to fail?

In file included from /root/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.cpp:34:
/root/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.hpp:105:47: error: 'AirSpeed' in namespace 'gz::msgs' does not name a type
105 | void airspeedCallback(const gz::msgs::AirSpeed &air_speed);
| ^~~~~~~~
compilation terminated due to -Wfatal-errors.
[1025/1038] Building CXX object src/modules/mavlink/CMakeFiles/modules__mavlink.dir/mavlink_messages.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl] Error 1

@jmackay2 jmackay2 deleted the gz_airspeed_tailsitter branch August 19, 2024 10:39
@jmackay2
Copy link
Contributor Author

Is this causing "make px4_sitl" to fail?

In file included from /root/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.cpp:34: /root/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.hpp:105:47: error: 'AirSpeed' in namespace 'gz::msgs' does not name a type 105 | void airspeedCallback(const gz::msgs::AirSpeed &air_speed); | ^~~~~~~~ compilation terminated due to -Wfatal-errors. [1025/1038] Building CXX object src/modules/mavlink/CMakeFiles/modules__mavlink.dir/mavlink_messages.cpp.o ninja: build stopped: subcommand failed. make: *** [Makefile:232: px4_sitl] Error 1

It certainly sounds like it. What version of Gazebo are you using and what version of gz-sensors and gz-msgs do you have? Airspeed should have come into gz sensors and msgs about a year ago.

I see the air-speed library in gz-sensors in the latest gz versions: 7.3.0, and 8.2.0. I do not see it in gz-sensors 6 though.

@daeyeonk
Copy link

daeyeonk commented Aug 20, 2024

It certainly sounds like it. What version of Gazebo are you using and what version of gz-sensors and gz-msgs do you have? Airspeed should have come into gz sensors and msgs about a year ago.

I see the air-speed library in gz-sensors in the latest gz versions: 7.3.0, and 8.2.0. I do not see it in gz-sensors 6 though.

I am using bash ./PX4-Autopilot/Tools/setup/ubuntu.sh for 22.04

@dagar
Copy link
Member

dagar commented Aug 20, 2024

We need to do something to keep builds working on 22.04.

@hamishwillee
Copy link
Contributor

So this didn't go in? Worth still fixing the tiny bug:

image

Jaeyoung-Lim pushed a commit that referenced this pull request Aug 21, 2024
Jaeyoung-Lim added a commit that referenced this pull request Aug 21, 2024
@jmackay2
Copy link
Contributor Author

Sorry about breaking the 22.04 build. I am on 22.04, but I am running with gz-harmonic. I should have done more testing with the default 22.04 gz-garden to make sure it worked. I assumed there were airspeed was in gz::msgs since it was in gz::sensors, but I guess not.

The quickest fix that I tried was to change ./PX4-Autopilot/Tools/setup.ubuntu.sh for 22.04 to install gz-harmonic instead of gz-garden. This allowed the build to work successfully. I have been using gz-harmonic with PX4 and ROS in 22.04 for a while, so I think this would be fine, but maybe there are other points I'm not considering.

@jmackay2
Copy link
Contributor Author

So this didn't go in? Worth still fixing the tiny bug:
image

Thanks @hamishwillee for the reminder that I slipped that bug fix in. I'll make a small PR for it.

@Jaeyoung-Lim
Copy link
Member

We should probably switch to harmonic since that is the LTS. However, this would mean that we explicitly state that we are going to make a breaking change.

vertiq-jordan pushed a commit to iq-motion-control/PX4-Autopilot that referenced this pull request Aug 21, 2024
PX4#23455)

* Update GZBridge to be able to use gazebo airspeed. Add gz quadtailsitter.

* Fix formatting

---------

Co-authored-by: jmackay2 <[email protected]>
vertiq-jordan pushed a commit to iq-motion-control/PX4-Autopilot that referenced this pull request Aug 21, 2024
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.

5 participants