Skip to content

定点飞行

快速启动脚本

运行使用tmux快捷脚本直接自动填充好指令

~/uav_ws/src/uav_code/sh/cruise_sim.sh

执行启动指令

打开仿真环境

roslaunch fly_sim sim.launch

调整定点飞行参数

打开~/uav_ws/src/uav_code/fly_demo/params/cruise_points.yaml调整参数

需要将改为if_physical: false以使无人机自动起飞,为true时无人机会自动切入offboard,为false时会等待遥控器拨下offboard拨杆

# 仿真还是实物
if_physical: false
# 是否修改最大速度
if_modify_vel_param: true
# z方向0.5m/s
max_vel_z: 0.5
# xy方向0.5m/s
max_vel_xy: 0.5
# 判断到点的阈值 即距离目标点0.3m/s就算到达了
threshold_distance: 0.3
# 目标点个数
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.2

启动控制代码

roslaunch fly_demo cruise.launch

无人机便按照预设的点位依次飞行后降落