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

Port px4vision airframe to gz environment #21409

Merged
merged 6 commits into from
Apr 12, 2023

Conversation

TheotimeBalaguer
Copy link
Contributor

@TheotimeBalaguer TheotimeBalaguer commented Mar 31, 2023

Solved Problem

"PX4 Vision" Airframe availability for simulation in Gazebo

Fixes #{Github issue ID}

Solution

  • Port the .sdf file from the model existing in gazebo-classic

Test coverage

  • Gazebo-Garden test : With the launch from the command-line and control with QGroundControl : no problem
  • Gazebo-Garden multidrone : I launched a simulation with 4 PX4Vision models and everything seems to work
  • No Unit/integration tests.

Context

Related links, screenshot before/after, video

@beniaminopozzan
Copy link
Member

Hi @TheotimeBalaguer , how did you start your simulations/tests? The usual

make px4_sitl gz_px4vision

doesn't work. Which is expected as you did not define an suitable airframe for that model.

Even spawning the model manually from the Gazebo GUI doesn't work:

Error [SDF.cc:154] Tried to use callback in sdf::findFile(), but the callback is empty.  Did you call sdf::setFindCallback()?
Error [parser.cc:748] Error finding file [/home/pozzan/git/PX4-Autopilot-gz/Tools/simulation/gz/models/px4vision/px4vision.sdf].

@junwoo091400 junwoo091400 added Simulation Sim: gazebo Gazebo simulator (gz) labels Apr 3, 2023
@junwoo091400 junwoo091400 changed the title Port px4vision to gz Port px4vision airframe to gz environment Apr 3, 2023
@TheotimeBalaguer
Copy link
Contributor Author

TheotimeBalaguer commented Apr 3, 2023

Thanks for the review @beniaminopozzan,
Actually, I directly launch the px4 binary with export PX4_GZ_MODEL=px4vision while Gazebo is running. 😄
I realized today that I was flying the px4vision model with the x500 airframe. 👼
I have to admit that I am a bit lost on the compilation workflow of the PX4 project, is there any existing docs about that ?

What I found : the targets for Gazebo simulation are defined in Tools/simulation/gz/gz_bridge/CMakeLists.txt based upon the airframes defined in ROMFS/px4fmu_common.
Thus, I created a file "4006_gz_px4vision" which is nothing more than a mix between ROMFS/px4fmu_common/init.d/airframes/4020_holybro_px4vision_v1_5 and ROMFS/px4fmu_common/init.d-posix/airframes/4001_gz_x500.
I gave the ID 4006 kind of randomly because it is the 6th model to be added to gz simulation, but also hesitated with 4020 as it is its ID in init.d...
@LorenzMeier could you please confirm I did nothing wrong with the naming ? (I think you are the one managing airframes).

Now, the command make px4_sitl gz_px4vision works, but I think a verification of the airframe is needed (file 4006_gz_px4vision), both for name and content. In particular, I commented some lines that were not recognized at the start of the PX4.

Thanks all for the help ! 👍

@Jaeyoung-Lim
Copy link
Member

@TheotimeBalaguer Since this contains mesh files and is redundant to the x500_depth model, Would it be possible to put this up on ignition fuel?

@TheotimeBalaguer
Copy link
Contributor Author

@TheotimeBalaguer Since this contains mesh files and is redundant to the x500_depth model, Would it be possible to put this up on ignition fuel?

Sure, but the best would be to upload it with the PX4 account on fuel, like the x500 model. I don't know who manages this kind of things.

@Jaeyoung-Lim
Copy link
Member

@TheotimeBalaguer If you can tell me your user name for Ignition Fuel, I can add you to the PX4 organization: https://app.gazebosim.org/PX4

@TheotimeBalaguer
Copy link
Contributor Author

@Jaeyoung-Lim my Ignition Fuel username is Tbalaguer. Thanks !

@Jaeyoung-Lim
Copy link
Member

@TheotimeBalaguer Done! Let me know if you can upload the model!
If this is done, we can link the model directly from this repo to the model

Thanks!

@TheotimeBalaguer
Copy link
Contributor Author

TheotimeBalaguer commented Apr 7, 2023

@Jaeyoung-Lim Thank you, I imported the px4vision model to Fuel (PX4 organization) and changed to a Fuel import in the .sdf file. I removed the meshes to reduce a bit the size of the PX4 project.

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, Thanks!

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-community-q-a-april-12-2023/31552/1

@Jaeyoung-Lim Jaeyoung-Lim merged commit 67d0346 into PX4:main Apr 12, 2023
@TheotimeBalaguer TheotimeBalaguer deleted the port-px4vision-to-gz branch July 4, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sim: gazebo Gazebo simulator (gz) Simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants