This codebase builds on prior work of pcac.cpp and pcac.hpp to implement PCAC in ardupilot on a fixed-wing vehicle. This means that the core pcac code is designed to be implementation-independent. A wrapper, AP_PCAC, interfaces pcac.cpp with the implementation-specific details. The functions for the elevator, throttle, and rudder/aileron lateral instances of pcac are scheduled in plane.cpp at a fixed rate on a single thread. This is one of the limitation of Ardupilot- it is not designed to run as a multithreaded program, and once oneStep is called, it will run until completion. This is markedly different from PX4, which is a multithreaded design where oneStep can be interrupted once an interval has been completed.
https://ardupilot.org/dev/docs/building-setup-linux.html#building-setup-linux
git clone git@github.com:DunkTheDoughnut/ardupilot.git
Tools/environment_install/install-prereqs-ubuntu.sh -y
. ~/.profileThis respository has been tested on Ubuntu Jammy.
https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html
https://ardupilot.org/dev/docs/debugging-with-gdb-on-linux.html
https://www.python.org/downloads/
pip install --upgrade numpy
sudo apt install python3-tk
export MPLBACKEND=Qt5AggCopy ardupilotmega.xml from ros2pcac repository
cd ./modules/mavlink/pymavlink$
python3 -m pip install Cython wheel setuptools future --user
python3 setup.py install --user ./waf clean #(not necessary every time)
./waf configure --board sitl #(or desired target)
./waf plane -j3 --debugOn a host computer
./waf clean #(not necessary every time)
./waf configure --board EchopilotAI --enable-custom-controller
./waf planeEnsure the board is powered off Connect one end of a USB cable to the FMU USB port
./waf plane --uploadOnce the "waiting for bootloader..." screen appears, plug the other end of the USB cable into the host computer. Ensure the cable is not unplugged during the flash process.
r (run)
break file:linenumber (optional)
break class::function (optional)
delete <breakpoint number>
n (next line/step over))
s (step into)
u (step out)
c (continue to next breakpoint)
CTRL + c (break)
q (quit)
print *<Eigen Matrix>.m_storage.data()@(<size>)
info threads (show threads)
set scheduler-locking on (prevent changing threads)
bt (backtrace)
frame <frame number>
print <variable>
(bind failed - Address already in use) sudo lsof -i : sudo kill -9
gdb --args build/sitl/bin/arduplane --model plane --defaults Tools/autotest/models/plane.parmThe ArduPilot project is licensed under the GNU General Public License, version 3.