Skip to content

Latest commit

 

History

History
95 lines (61 loc) · 2.46 KB

8_4_ROS2_Ardupilot_PX4.md

File metadata and controls

95 lines (61 loc) · 2.46 KB

1 DDS for Ardupilot and PX4

2 Install libs and pkgs for Ardupilot

Main reference is ROS 2.

https://ardupilot.org/dev/docs/ros2.html

2.2 mavros for ros2

2.2.1 run mavros2

    ros2 run mavros mavros_node --ros-args --param fcu_url:=udp://127.0.0.1:14551@14555

2.2.2 docker for mavros2

docker source rockstarartist/mavros2

  1. get ardupilot in simulation
    sim_vehicle.py -v ArduCopter --console
  1. we can use mavros like
    roslaunch mavros apm.launch fcu_url:=udp://127.0.0.1:14551@14555
  1. use mavros2 in docker A docker image of mavros2 is created here rockstarartist/mavros2.
  • build the container from that image
        docker pull rockstarartist/mavros2
  • run mavros2
        docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p fcu_url:=udp://:14561@localhost:5901 -p tgt_system:=1

Executing commands on Pixhawk with ArduPilot via MAVROS2

How to use mavros2

How to install mavros inside the container with ros2 humble preinstalled

MAVROS2: RC-Override in ROS2 Foxy - Equivalent of rosrun mavros mavparam set SYSID_MYGCS 1

basic ros2 topic run

read those

mavlink/mavros#815

mavlink/mavros#1469

mavlink/mavros#1423

mavlink/mavros#1423

mavlink/mavros#1564

mavlink/mavros#1793

mavlink/mavros#1582

user docker mavlink/mavros#1864

https://hub.docker.com/r/rockstarartist/mavros2

MAvlink https://zhuanlan.zhihu.com/p/415266156

3. Set ROS2 for PX4

Main reference is ROS 2 User Guide.

make px4_sitl gz_x500
MicroXRCEAgent udp4 -p 8888
# use ament_garge for ros2 pkgs
ament_target_dependencies(frame_transforms geometry_msgs sensor_msgs)
# use targe_link for pkg Eigen3
target_link_libraries(frame_transforms Eigen3::Eigen)