< >
Home » ROS与AR.Drone教程 » ROS与AR.Drone-tum_ardrone-drone_autopilot(自动驾驶)

ROS与AR.Drone-tum_ardrone-drone_autopilot(自动驾驶)

drone_autopilot(自动驾驶)

说明

  • 无人机的PID控制,包含基本的航点跟随,自动初始化
  • 要求drone_stateestimation运行
  • 通过/tum_ardrone/com主题设置目标

订阅主题

  • /ardrone/predictedPose

发布主题

  • /cmd_vel
  • /ardrone/land
  • /ardrone/takeoff
  • /ardrone/reset

参数

  • ~minPublishFreq: usually, a control command is sent for each pose estimate received from drone_stateestimation. However, if no pose estimate is received for more than minPublishFreq milliseconds, a HOVER command is sent, causing the drone to hover if for example drone_stateestimation is shut down suddenly. Default: 110.
  • Ki_X, Kd_X, Kp_X: PID controller parameters for roll/pitch, gaz (up/down) and yaw.
  • max_X: maximal respective control command sent (ever).
  • rise_fac: rise commands are larger than respective drop commands by this factor. This is due to the drone sometimes dropping unpredictably fast for large drop commands, however rising somethimes requires large rise commands. aggressiveness: multiplied to PI-component of all commands sent. Low values lead to the drone flying "slower".

使用

  • 采用“c COMMAND”形式,飞行器的行为通过发送命令到/tum_ardrone/com主题来改变。
  • 命令保存在队列里,会逐一执行(例如一个航点到达执行下一个)。
  • 清除队列执行“c clearCommands”
  • 命令通过drone_gui发布
  • 一些例子的脚本在 /flightPlans/*.txt.

可能用到的命令:

  1. autoInit [int moveTimeMS] [int waitTimeMS] [int riseTimeMs] [float initSpeed]
takes control, starts drone, initializes PTAM. That is:
- starts the drone & and waits riseTimeMs, the drone will rise to approx. 
  a height of 1m. 
- initializes PTAM by taking the first KF, flying up (sending initSpeed as control command) for moveTimeMS, 
  waiting waitTimeMS and then taking the second KF. 
  This is done until success (flying up and down respectively).
- good default values are "autoInit 500 800 4000 0.5" 
  1. autoTakeover [int moveTimeMS] [int waitTimeMS] [int riseTimeMs] [float initSpeed]
takes control, initializes PTAM. The same as autoInit ..., 
but to be used when the drone is already flying (skipps the first step).
  1. takeoff
- takes control, starts drone.
- does not reset map or initialize PTAM

4.setReference [doube x] [double y] [double z] [double yaw]

sets reference point (used in goto X X X X).

5.setMaxControl [double cap = 1.0]

maximal control sent is capped at [cap], causing the drone to fly slower.
  1. setInitialReachDist [double dist = 0.2]
drone has to come this close to a way point initially
  1. setStayWithinDist [double dist = 0.5]
drone has to stay this close to a way point for a certain amount of time.
  1. setStayTime [double seconds = 2.0]
time the drone has to stay within [stayWithinDist] for target to be reached.
  1. clearCommands
clears all targets, such that the next command is executed immediately.
  1. goto [doube x] [double y] [double z] [double yaw]
flies to position (x,y,z yaw), relative to current reference point.
blocks until target is reached according to set parameters
  1. moveBy [doube x] [double y] [double z] [double yaw]
moves by (x,y,z,yaw), relative to the current target position blocks until target is reached according to set parameters
  1. moveByRel [doube x] [double y] [double z] [double yaw]
moves by (x,y,z,yaw), relative to the current estimated position of the drone blocks until target is reached according to set parameters

13.land

initializes landing (use auto-land of drone)

14.lockScaleFP

sets the one point that does not change when the scale is re-estimated to the current drone position. The scaleFP can only be set when PTAM is good, i.e. this is delayed until PTAM is initialized and good. Need to set useWorldFixpoint in dynammic_reconfigure.

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: tum_ardrone, ar.drone