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

The guidance for Flight Tasks in version 1.14 is inconsistent with the actual program in version 1.14.4. #3421

Closed
a233a2 opened this issue Oct 30, 2024 · 9 comments

Comments

@a233a2
Copy link

a233a2 commented Oct 30, 2024

Hi!I want to use the newly added flight mission in version 1.14.4 of the PX4 program. Refer to the documentation of version 1.14. But I didn't find any consistency in the documentation with the code, which prevented me from adding the code correctly to the CMakeLists. I think this is causing me to not compile correctly.
I couldn't find the following guidance to add in the program。
111
Where should I add it?

Here is the error: I meet
55d1cb13-9d89-40cf-b431-b48b318c43d9

I put my new task here: This is version 1.14
222

@hamishwillee
Copy link
Collaborator

@a233a2 The flight tasks guide is likely out of date since it was written in PX4 v1.11

Can you please post this in the discussion boards and then add a link back here. That will expose this problem to more people.

@MaEtUgR Is this something you can advise on? The FLightTaskIndex looks like it is auto-generated, so I would assume that adding to the CMakeLists is the right thing to do.

More generally, can I arrange a sanity check of this doc for at least PX4v1.15 accuracy?

@a233a2
Copy link
Author

a233a2 commented Oct 31, 2024

oh ok I have currently posted a similar situation to mine in the discussion section of PX4. But the bug cannot be solved, which makes me frustrated. Why does it not work when making fmu-v2_default, but it works when starting simulation?

MyDiscussion

@MaEtUgR
Copy link
Member

MaEtUgR commented Oct 31, 2024

@a233a2 I think I know what your problem is. The structure changed slightly and we should update the documentation. According to your screenshot you added your custom task in the right place if you want it only available on targets that are not very tight on flash memory usage (NOT px4_constrained_flash_build). that is here: https://github.com/PX4/PX4-Autopilot/blob/e8f8bc9af7f7536543148622a8cb80cc73ab60c9/src/modules/flight_mode_manager/CMakeLists.txt#L56-L57

fmu-v2 is one of the constrained targets so it will show in simulation (unconstrained) but not the fmu-v2 build.

Try moving the declaration of your task in CMake to the list above that which gets build on every target:
https://github.com/PX4/PX4-Autopilot/blob/e8f8bc9af7f7536543148622a8cb80cc73ab60c9/src/modules/flight_mode_manager/CMakeLists.txt#L42-L51

@DronecodeBot
Copy link

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

https://discuss.px4.io/t/new-task-when-i-make-fmu-v2-default-broken/42204/3

@a233a2
Copy link
Author

a233a2 commented Nov 1, 2024

I still haven't resolved my previous mistake, but thank you all for your answers. But I changed the compilation command to FMU-V3, and now the compilation has passed. I want to know if FMU-V3 can be burned on Pixhawk 2.4.8. This temporarily solves the problem. @MaEtUgR

@MaEtUgR
Copy link
Member

MaEtUgR commented Nov 4, 2024

But I changed the compilation command to FMU-V3, and now the compilation has passed.

@a233a2 That is because fmu-v3 is not a flash constrained target but fmu-v2 is, see:
https://github.com/PX4/PX4-Autopilot/blob/c9f64aeea8aa549a1031785c8ec0134057c8ac05/boards/px4/fmu-v2/default.px4board#L3

I want to know if FMU-V3 can be burned on Pixhawk 2.4.8.

No, as far as I remember that board is an fmu-v2 target and you should use make px4_fmu-v2 upload to flash it. If you pick the wrong target it should complain that the bootloader doesn't accept your binary.

Please just put your custom task to also be built on flash constrained targets like I described in #3421 (comment)
Here's essentially what that change would look like:
grafik

@MaEtUgR
Copy link
Member

MaEtUgR commented Nov 4, 2024

Sidenote: While it’s not required for the goal you describe here, you might want to consider upgrading to an up-to-date flight control board, like e.g. the Pixhawk 6C, when building/investing in a new drone.

@hamishwillee
Copy link
Collaborator

I strongly agree with ^^^^. The Pixhawk 2.4.8 is more than 10 years old technology with very little flash space. The money you save in buying them is lost in the time it takes to find enough flash to use the features you need.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Nov 6, 2024

OK. so I have added a note about constrained boards in #3434.

I'm closing this issue now because the specific case is address.
I have opened #3435 because we still need the rest of the doc checked @MaEtUgR !

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

4 participants