Homework 01 for the course ENAE788M: Hands-on Autonomous Aerial Robots (Spring 2023).
Using https://docs.px4.io/master/en/ros/mavros_offboard.html as reference, the code is modified to demonstrate the ModalAI VOXL drone beginning at (x: 0, y: 0, z: 10) and then follow the repeating pattern:
- Move forward 10 virtual meters
- Move up (heave) 15 virtual meters
- Move left 5 virtual meters
- Return to (0,0,10)
- Open a terminal and clone the repository in the
src
directory of your ROS catkin workspace into a folder/package calledoffboard
.
source /opt/ros/noetic/setup.bash
cd ~/catkin_ws/src
git clone https://github.com/adarshmalapaka/voxl_offboard.git offboard
cd ..
catkin_make
- To run the waypoint tracking demo:
-
Start the PX4
jmavsim
simulator:cd /PX4-Autopilot make px4_sitl_default jmavsim
-
Launch QGroundControl by double clicking the
QGroundControl.AppImage
file. -
Perform a take-off of the drone and wait until it reaches a height of 10m.
-
Open another terminal and run the following to launch the offboard node and save the bag data:
source /opt/ros/noetic/setup.bash roslaunch offboard hw1.launch savedata:=true
Note: After executing the above roslaunch command, change the mode in QGroundControl from either Hold/Position to Offboard.
-
- To read the generated bag file and plot the corresponding commanded and actual trajectory of the drone:
cd ~/catkin_ws/src/offboard/src python3 enae788m_plot.py
├─ CMakeLists.txt
├─ README.md
├─ bag
│ ├─ enae788m_hw1_VOXL1
│ │ ├─ mavros-local_position-pose.csv
│ │ └─ mavros-setpoint_raw-local.csv
│ └─ enae788m_hw1_VOXL1.bag # Saved rosbag for /mavros/local_position/pose & /mavros/setpoint_raw/local
├─ launch
│ ├─ hw1.launch # Launch file to run enae788m_hw1.cpp and rosbag record
│ ├─ record_data.launch
│ └─ total_launch.launch
├─ package.xml
└─ src
├─ enae788m_hw1.cpp # Code to perform waypoint tracking as given in HW1
├─ enae788m_plot.py # Code to visualize recorded ROS topics using rosbag
└─ offboard_example.cpp