跳转至

定点飞行

打开仿真环境

roslaunch px4 mavros_posix_sitl.launch

执行代码

roslaunch uav_code_simple cruise.launch

uav_code_simple/params/cruise_points.yaml中含有各种参数

if_physical: false
if_modify_vel_param: false
max_vel_z: 0.5
max_vel_xy: 0.5
threshold_distance: 0.2
navigation_number: 6

point1:
  x: 0.0
  y: 0.0
  z: 1.0

point2:
  x: 1.0
  y: 0.0
  z: 1.0

point3:
  x: 1.0
  y: 1.0
  z: 1.0

point4:
  x: 0.0
  y: 1.0
  z: 1.0

point5:
  x: 0.0
  y: 0.0
  z: 1.0

point6:
  x: 0.0
  y: 0.0
  z: 0.0

uav_code_simple/src/cruise_simple.cpp为该程序源代码