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

Want to customize the default x500 model in the gazebo simulation #45

Open
JustinGao20 opened this issue Jun 5, 2024 · 1 comment
Open

Comments

@JustinGao20
Copy link

Hi developers,
We are currently working on a px4 project but we need to verify the simulated results before we want to deploy it on the real drone. However, a problem has come to our mind that our drone has a different parameter list as compared to the default holybro gx500 flight parameters. I am just wondering whether we could change the default parameters so that it will match up with the physical properties for our own drone.
We have found out that there are two folders in this repo. The sdf file in the x500 will help us change motor related parameters, and the sdf file in the x500_base will help use change the motor position and other properties. I am just wondering whether you could give us a more detailed explanation on the parameters in the gazebo files so that we could change them. Sincerely.

@Kametor
Copy link

Kametor commented Oct 3, 2024

Hi Justin,
I hope you're doing well.
I have also been working on creating a custom model in Gazebo. After researching the topic and reviewing related issues, I've found that the process for creating custom models in Gazebo isn't very well documented, either on the wiki or other sources. Despite this challenge, I was able to successfully create and fly my custom model, though there are still aspects that I do not fully understand. I've also raised an issue in the Gazebo repository to address some of these unclear points (gazebosim/gz-sim#2637).
In summary, to create your own custom model, you will need to generate custom model files. One approach is to start by copying the x500 model and then modify the critical parameters to suit your needs. Key parameters include physical attributes such as weight and inertias, as well as motor model plugin parameters. These adjustments will primarily be on the Gazebo side, specifically in PX4-Autopilot/Tools/simulation/gz.
For the PX4 SITL side, you will need to create a parameter configuration file and add this new parameter configuration to the CMakeLists.txt file located in PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/airframes.
This is the general approach I followed. You may find it helpful to review this discussion: PX4 Forum Topic on Creating Custom Models for SITL.
If you have any specific questions, particularly regarding the motor model side, please feel free to ask.

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

No branches or pull requests

2 participants