Module PX4

Hi everyone,

I am a student and I am currently working on Dynamic Soaring with PX4 Gazebo.

In order to simulate dynamic soaring, I created a new module named fw_dynamic_soaring in which I compute the energy and the wind gradients. It is just the beginning of the work and I don’t know if it will work after. However, before doing the rest to really do dynamic soaring, I tested if my code is working or not.

So, I launched px4 and I see in the files build/px4_sitl_default/boardconfig that the line “CONFIG_MODULES_FW_DYNAMIC_SOARING=y” has been added and in the file build/px4_sitl_default/px4_boardconfig.h, that the line “#define CONFIG_MODULES_FW_DYNAMIC_SOARING 1” has also been added.

However, in the console, when I write “help”, I don’t see “fw_dynamic_soaring”. And when I type in the MAVLink Console “help”, the command “fw_dynamic_soaring’“ does not appear.

So, I think I missed something but I really don’t understand what. I checked the files Kconfig, fw_dynamic_soaring.cpp and the CmakeLists.txt and everything seems good (it is very similar to other modules like “fw_lateral_longitudinal_control”) while it does not seem to be recognized. Does someone have an idea to solve it or have had the same issue ?

Thanks a lot !

Hi, could you share a link to the Github branch you’re developing on? (you can make a fork of GitHub - PX4/PX4-Autopilot: PX4 Autopilot Software and push is there) That would be easier for us to see if you missed something in the code

Hi,

I am sorry, I don’t kown very well how to use Github. So, I added my files I created as an attachment. They are located in the folder : “PX4_Autopilot/src/modules/fw_dynamic_soaring”.

CMakeLists.txt.pdf (19.2 KB)

fw_dynamic_soaring.cpp.pdf (95.6 KB)

Kconfig.pdf (18.9 KB)

I think it is a problem of version because a colleague of mine uses a previous version of PX4 and it works perfectly. I don’t know why it doesn’t work now with the new version. Do you have any idea ? I tried again following these instructions : First Application Tutorial (Hello Sky) | PX4 Guide (main) and it also doesn’t work.

Hi @SPrsn,

I can’t see you start your module.

If you can create your custom module apps file and start it there, example here: ROMFS/px4fmu_common/init.d/rc.fw_apps.
Don’t forget to at it in CMakeLists.txt and rc.vehicle_setup.

Hi @alnI3S ,

You’re right, it works and my module '“fw_dynamic_soaring” appears in QGC.

I have a new issue about parameters in my module. In my file “fw_dynamic_soaring_params.c” , the parameters are located in the group @group “FW DS “. But this group and its parameters do not appear in QGC parameters (even after refreshing these parameters).

I tried to see if it is just a problem of display. For instance, I wrote “param show DS_CLIMB_S”, or “param show DS_ENABLE”. And the parameters seem to exist and using “param set <the_params>” enables me to change its value or state.

However, as I said before, the group “FW DS” and the parameters inside (like DS_CLIMB on the picture) do not appear on QGC.

Do you have already experienced this issue or can you help me please ?

Just to add a description of my problem, in the console MAVLink, I can see that :

Even if I have written start, it says it is not running…

The parameters are only shown in QGC when they are actually used by the system. In your case, you said that “Even if I have written start, it says it is not running…”, so it’s probably not running, and that’s the reason why the parameters are not showing up.

Maybe take as an example another small module (e.g.: PX4-Autopilot/src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp at 0ce60fd52813db6a38e2b4b14d8458efb89d505e · PX4/PX4-Autopilot · GitHub) and copy the structure.

Thanks for your response @bresch, I will try it !