PX4 Offboard例程运行顺序
先运行PX4,再打开Mavros,最后运行代码
官网:https://dev.px4.io/master/en/simulation/ros_interface.htm
运行PX4:
cd <Firmware_clone>
DONT_RUN=1 make px4_sitl_default gazebo
source ~/catkin_ws/devel/setup.bash # (optional)
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo
roslaunch px4 posix_sitl.launch
运行Mavros:
roslaunch mavros px4.launch fcu_url:="udp://:14540@192.168.1.36:14557"
运行代码:
rosrun offboard_pkg offboard_node