Steps to reproduce.
Firstly, install all required packages and software.
- PX4 - ROS2 interface lib
cd $ros_workspace/src
git clone --recursive https://github.com/Auterion/px4-ros2-interface-lib
cd ..
colcon build
source install/setup.bash
- Micro-XRCE-DDS-Agent
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
cd Micro-XRCE-DDS-Agent
mkdir build && cd build
On Linux, inside of the build folder, execute the following commands:cmake ..
make
sudo make install
- QGroundControl
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y
sudo apt install libfuse2 -y
sudo apt install libxcb-xinerama0 libxkbcommon-x11-0 libxcb-cursor0 -y
Download and install QGroundControlhttps://d176tv9ibo4jno.cloudfront.net/latest/QGroundControl.AppImage
chmod +x ./QGroundControl.AppImage
To be able to run QGroundControl from terminal, place QGroundControl app image to /usr/local/bin/ - PX4
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
cd PX4-Autopilot/
make px4_sitl
pip3 install --user -U empy==3.3.4 pyros-genmsg setuptools
- PX4 messages and PX4_ros_com
cd src/
git clone https://github.com/PX4/px4_msgs.git
git clone https://github.com/PX4/px4_ros_com.git
colcon build --packages-select px4_ros_com px4_msgs && source install/local_setup.bash
- Gazebo classic
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install gazebo11
If fails:sudo apt-get install gazebo
Gazebo ROS Librariessudo apt install ros-<ROS_DISTRO>-gazebo-ros-pkgs
- ROS2 aruco
Clone from current repo and install python libs:pip3 install opencv-contrib-python==4.9.0.80 transforms3d
Build from your src/ directory:colcon build --packages-select ros2_aruco ros2_aruco_interfaces && source install/local_setup.bash
After installation, test:
From /src/PX4-Autopilot
make px4_sitl gazebo-classic
From different shell
MicroXRCEAgent udp4 -p 8888
From different shell
QGroundControl.AppImage
From different shell
To test the drone's flight in a circle
ros2 run px4_ros_com circle_flight.py
From different shell
To test flight of a drone in a straight line and Aruco marker detection:
ros2 run px4_ros_com straight_flight.py
From different shell
ros2 launch ros2_aruco aruco_recognition.launch.py