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 windy default world #22273

Merged
merged 3 commits into from
Nov 1, 2023
Merged

add windy default world #22273

merged 3 commits into from
Nov 1, 2023

Conversation

frede791
Copy link
Contributor

@frede791 frede791 commented Oct 30, 2023

Adds a windy default world to Gazebo. Changing the wind velocity only requires to modify the linear_velocity parameter near the bottom of the sdf file.

To run the world use: make px4_sitl gz_x500_windy in the PX4-Autopilot repo. You may run into an unknown target error. In this case first run make clean && make distclean before running the command.

Solved Problem

Adds a windy default world to Gazebo. Changing the wind velocity only requires to modify the linear_velocity parameter near the bottom of the sdf file.

Test coverage

https://review.px4.io/plot_app?log=b0969110-5339-4e60-8c22-30bb36020d4b

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.

Awesome!

Three questions

  • Is this already part of the available make targets?
  • Have you tried out vehicles in wind and checked if they actually influence the flight? Wind should influence the thrust of the motors, lift/drag of aerodynamics and the airspeed sensor values
  • Probably worth checking if the advanced liftdrag plugin also uses wind information?

@frede791
Copy link
Contributor Author

  • No, not currently, but I wasn't aware that there is a Cmake file for Gazebo worlds (if so, can you point me to its location?)
  • Yes, i have tried the x500, noticing a significant slant in the position of the vehicle in mid-air (to make it even more pronounced set the linear velocity value to 100 100 100 and you will see the vehicle getting blown off the map)
  • Advanced Lift Drag currently does not use it, but I already have it on my todo list once the regular plugin gets merged.

@Jaeyoung-Lim
Copy link
Member

Jaeyoung-Lim commented Oct 30, 2023

No, not currently, but I wasn't aware that there is a Cmake file for Gazebo worlds (if so, can you point me to its location?)

If so, how is someone expected to run the windy world? Could you include this in the PR description?

Yes, i have tried the x500, noticing a significant slant in the position of the vehicle in mid-air (to make it even more pronounced set the linear velocity value to 100 100 100 and you will see the vehicle getting blown off the map)

I am more curious the actual behavior -> whether if it is close to what we expect on the real vehicle, or if it is just applying some wrench force on the joints to look like some force is being applied. Do you have a flight log from the tests?

It would be great if you could keep the PR template and fill in the relevant information, so that we don't need to go back and forth.

Please also check with the airspeed sensors and liftdrag plugins.

Advanced Lift Drag currently does not use it, but I already have it on my todo list once the regular plugin gets merged.

Awesome!

@frede791
Copy link
Contributor Author

Updated the description to explain how to run the world and also provided a flightreview. I am not sure how to interpret the data to see whether the model behaves as we want it to.

@frede791
Copy link
Contributor Author

The way I understand wind, it can be enabled for individual links or the whole model, depending on what parameters are set. By only setting the enable_wind flag for the world and not disabling it for any of the individual links, I believe that wind affects all necessary links. The way in which they are affected depends on the respective plugins. In the x500 for example, wind only affects the motormodel plugins, as this is where the wind velocity gets factored into the calculation of the moments and forces. Since these moments and forces are applied for each rotor individually (rather than in one central point like the advanced lift drag plugin), I would think that the wind affects each component individually.

@beniaminopozzan
Copy link
Member

Thanks @frede791 !
FYI, you can also start a gz_x500 simulation with the new world with

make px4_sitl gz_x500_windy_default

@frede791
Copy link
Contributor Author

@beniaminopozzan i have tried this but I get an "unknown target" error

@beniaminopozzan
Copy link
Member

@beniaminopozzan i have tried this but I get an "unknown target" error

@frede791 , do a clean build calling make distclean first

@frede791
Copy link
Contributor Author

yes this works. I will update the PR and also make a PR to the px4 user guide.

@Jaeyoung-Lim
Copy link
Member

@frede791 One more thing -> could we remove the default and just name in windy.world?

@frede791
Copy link
Contributor Author

@Jaeyoung-Lim @beniaminopozzan Addition to the PX4 user guide. Feel free to add if you think there is something missing/lacking.
PX4/PX4-user_guide#2817

@frede791
Copy link
Contributor Author

frede791 commented Nov 1, 2023

@Jaeyoung-Lim PX4/PX4-user_guide#2817 has been merged into the user guide. Should we look to merge this as well?

@Jaeyoung-Lim Jaeyoung-Lim merged commit d6dbf38 into PX4:main Nov 1, 2023
86 checks passed
@frede791 frede791 deleted the windy_world branch November 1, 2023 08:37
@junwoo091400 junwoo091400 added the Sim: gazebo Gazebo simulator (gz) label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sim: gazebo Gazebo simulator (gz)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants