You might need to run the following on the host machine before building the Docker image:
git submodule init siyi_sdk && git submodule update siyi_sdk
Run the following to start a simple SITL
cd /PX4-Autopilot
PX4_SIM_SPEED=2 PX4_HOME_LAT=38.31633 PX4_HOME_LON=-76.55578 PX4_HOME_ALT=142 make px4_sitl jmavsim
After starting the SITL, launch QGC.
sudo -H -u qgc /QGroundControl.AppImage
Ask QGC to takeoff using the UI.
Follow these instructions by Eric to establish a connection & SSH to the lab machine.
Then run this command to start the docker container docker run -it -v ~/uavf_2024:/home/ws/libuavf_2024 3940da8882a0
. The image ID (last argument) might be different, but you can find it by just running docker image ls
and looking for the big ones from VS code.
Once you're in the container, run sudo apt install tmux
and then run tmux
.
To start jmavsim in headless mode, prepend HEADLESS=1
.
cd /PX4-Autopilot
HEADLESS=1 PX4_SIM_SPEED=2 PX4_HOME_LAT=38.31633 PX4_HOME_LON=-76.55578 PX4_HOME_ALT=142 make px4_sitl jmavsim
You can skip QGroundcontrol and just type the following in the jmavsim
window to takeoff.
commander takeoff
After this you can go on to follow the rest of the instructions as normal.
Launch MAVROS. (It converts ROS messages sent to it into commands sent to the flight control software.)
ros2 launch mavros px4.launch fcu_url:=udp://:14540@
Build uavf_2024.
cd /home/ws && colcon build --merge-install && source install/setup.bash
Launch the mock imaging node:
ros2 run libuavf_2024 mock_imaging_node.py /home/ws/libuavf_2024/uavf_2024/gnc/data/primary.gpx 12 9
Launch the demo commander node:
ros2 run libuavf_2024 demo_commander_node.py /home/ws/libuavf_2024/uavf_2024/gnc/data/primary.gpx /home/ws/libuavf_2024/uavf_2024/gnc/data/PAYLOAD_LIST 12 9
This will execute one lap of the mission in SITL.
Use the following commands:
To load a safety geofence like we will have in real life you may open /home/ws/libuavf_2024/uavf_2024/gnc/data/ARC/plan.plan in QGC.
cd /PX4-Autopilot
PX4_SIM_SPEED=2 PX4_HOME_LAT=33.64210 PX4_HOME_LON=-117.82683 PX4_HOME_ALT=142 make px4_sitl jmavsim
cd /home/ws && colcon build --merge-install && source install/setup.bash
ros2 run libuavf_2024 mock_imaging_node.py /home/ws/libuavf_2024/uavf_2024/gnc/data/club_field.gpx 12 9
cd /home/ws && colcon build --merge-install && source install/setup.bash
ros2 run libuavf_2024 demo_commander_node.py /home/ws/libuavf_2024/uavf_2024/gnc/data/club_field.gpx /home/ws/libuavf_2024/uavf_2024/gnc/data/PAYLOAD_LIST 12 9
ARC upper field sim:
cd /PX4-Autopilot
PX4_SIM_SPEED=2 PX4_HOME_LAT=33.64158 PX4_HOME_LON=-117.82573 PX4_HOME_ALT=142 make px4_sitl jmavsim
cd /home/ws && colcon build --merge-install && source install/setup.bash
ros2 run libuavf_2024 mock_imaging_node.py /home/ws/libuavf_2024/uavf_2024/gnc/data/upper_field.gpx 12 9
cd /home/ws && colcon build --merge-install && source install/setup.bash
ros2 run libuavf_2024 demo_commander_node.py /home/ws/libuavf_2024/uavf_2024/gnc/data/upper_field.gpx /home/ws/libuavf_2024/uavf_2024/gnc/data/PAYLOAD_LIST 12 9
-
Run
mavlink_console.py
to send statustext on GCS. -
commander_node.py
now uses MAVROS to send statustext.