Building Example Sketches


I was trying to follow the steps on the website below

However i am facing the problem that

~/ardupilot/libraries/AP_InertialSensor/examples/INS_generic$ make px4-clean
make: *** No rule to make target ‘px4-clean’. Stop.

How can it be fixed?

I have same problem. I could not find any make file in that directory

I want to compile and upload example sketches to my pixhawk,and I am facing the same problems…

The build system is changed to waf now. In fact the page in the link has been updated to talk about how to build the examples with waf

I have same problem. I could not find any make file in that directory

We no longer use the make build system for our examples.

We now use “waf”; I’ve updated the instructions on the wiki to reflect

Additionally, the INS_generic example is currently broken. I have created
a pull request (AP_InertialSensor: fix INS_generic example (call BoardConfig.init()) by peterbarker · Pull Request #5055 · ArduPilot/ardupilot · GitHub) to fix
that, and in the meantime try one of the other examples (the DataFlash
example is pretty verbose - and just tested :slight_smile: ).

Hi guys,

I have a problem with building example sketches… I can’t build them, always get the same error doesn’t matter which sample I wanted to build.
I’m following this instructions:

So when I want to build the code with ./waf build --target examples/INS_generic --upload
I got error in libraries/AP_ADSB_AP_ADSB.cpp in line 594.
It says:
error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
uint8_t AP_ADSB::get_encoded_callsign_null_char()
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

I assume that maybe the problem is in px4 fw_io because last build is here and after this build failed.
[462/470] CMake Build px4 fw_io
ninja: no work to do.
…/…/libraries/AP_ADSB/AP_ADSB.cpp: In member function ‘uint8_t AP_ADSB::get_encoded_callsign_null_char()’:

I stopped here and don’t know how to fix this problem…
Maybe someone had the same or similar problem in the past???

Thank you!

Same error there. I was trying to build a custom version of Arducopter for Pixhawk 2 with make px4-v3.
Did you ever find out the cause/fix?

Yutaoliu, unfortunately i didn’t.
Did you maybe try to build it with waf (./waf) ?
I’m using Pixhawk 1…