How do I create a new mode?

I am a newbie programmer who interested in obstacle avoidance and navigation using vision. I am currently follow the guide on https://dev.px4.io/ and would like to create a new mode that obtain position from both GPS (when the copter can get enough satellites) and IMU. Would you please guide me that is it possible to create a new mode with in px4 Firmware and Where to start.

Thank you in advance for all kind of help :slight_smile:

Hello to everyone. Iโ€™m a newbie px4 developer too and iโ€™m a little bit lost too.
I followed the manual in https://dev.px4.io/ but I still have many doubts.
I would appreciate somebody giving me some basics.

Thank you very much in advance.

Are you talking about a new control mode or a new mode of estimating the vehicle position?
As you mention GPS and IMU it sounds like the latter.
Current estimators (LPE and EKF2) already fuse GPS and IMU data, so Iโ€™m not quite sure how your method would be different.
If you want to develop a new state estimator to take place of the existing ones, you will have to write your own module that outputs the state estimates in the same manner LPE and EKF2 do. You can look at e.g. the LPE module for reference on which topics you need to publish and so on. Then just make sure your module is started instead of the existing state estimator.

Hi Nicolas. First of all, thank you very much for responding.
Iโ€™m asking for some develop resource like a tutorial, example or similar to start making modifications and new features from the px4 firmware code in https://github.com/PX4/Firmware.
I followed the official dev guide but itโ€™s little information for me. I need more help.
Thank you very much.

@bernabepuente,

Iโ€™ve not done this myself, but this posting may be of help:

PX4 Research Log [10] โ€“ Adding a new flight mode (Preparation)

Their website has other informative posts on PX4 architecture.

1 Like

Many thanks hamid!!!
this is the kind of help I need!!!
Great website.
Regards.