How to use list in ardupilot

I want to add a sliding window filter function in ardupilot code in ubuntu, so I need to use the list. I first #include , then define the list, then I get an error:undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)’
It seems likes a problem of gcc version?Does anyone have added a list in the source code?Please help me.

We don’t use functions like this from the standard library.

There are several filters already present in ArduPilot - have you looked
at their implementations?

1 Like

Thank you very much for your answer. Now the averaging filter can be found in filter.h, which has helped me a lot. However, I still have a question. I see that there are several functions that use list in the source code. For example, I tried to imitate this usage, but I still get an error. Can you help me see? After all, the use of list is still useful.thank you very much

QzpcVXNlcnNcQWRtaW5pc3RyYXRvclxBcHBEYXRhXFJvYW1pbmdcRGluZ1RhbGtcNDI3NjQwOTYxX3YyXEltYWdlRmlsZXNcMTUzOTkzMDE5Nzc2MV80MzEwMDg3My1FNDE3LTQ1ODktQkMwQy0xODU5NzBEOUM3MUEucG5n

The usage you’ve found is within parts of the PX4 Firmware tree we don’t use - or we’d see link errors there too.

I’ve realised you might be confused here; ArduPilot includes the PX4 Firmware tree as a module; that’s a complete autopilot in and of itself. ArduPilot used to exclusively use PX4 Firmware for driver and operating system things; we are now moving towards ChibiOS, an alternate operating system to NuttX.

I suggest confining your changes to the ArduPilot source code - not in the external modules.

Thanks again:grinning: