Developed by autmav
Tested with:
- ubuntu 20.0, ros2 (foxy), Gazebo-classic (v: ...), PX4 (v1.14). Remember to have
PX4-Autopilot
root in your home dir.
mkdir ~/ws
cd ~/ws
git clone https://github.com/autmav/px4_ros2_api.git src
cd ..
source /opt/ros/foxy/setup.bash
colcon build
Each of the following fields must be done in separate terminals. PX4:
cd ~/PX4_Autopilot
make px4_sitl gazebo-classic
XRCE:
MicroXRCEAgent udp4 -p 8888
Main code:
cd ~/ws
source /opt/ros/foxy/setup.bash
source install/setup.bash
# for just take off
ros2 launch px4_ros_com only_takeoff.yaml
# for position mode
ros2 run px4_ros_com position_command
# for velocity mode
ros2 run px4_ros_com velocity_command
# for attitude mode
ros2 run px4_ros_com attitude_command
Plot:
source /opt/ros/foxy/setup.bash
source install/setup.bash
ros2 run py_pubsub minimal_subscriber