基于mpc实现无人机轨迹跟踪ROS功能包:mav_control_rw

发布于:2024-04-16 ⋅ 阅读:(25) ⋅ 点赞:(0)

功能包简介

mav_control_rw 功能包是ETHZ ASL的利用mpc控制实现了旋翼式无人机的轨迹追踪算法。

mpc是模型预测控制的简称,全称是Model-based Predictive Control

mpc利用一个已有的模型、系统当前的状态和未来的控制量,来预测系统未来的输出,然后与我们期望的系统输出做比较,得到代价函数,通过优化的方法,优化出未来控制量,使得代价函数最小。优化出来的控制量即算法的输出。

MPC 优点

  • 善于处理多输入多输出系统(MIMO)
  • 可以处理约束,如安全性约束,上下阈值
  • 是一种向前考虑未来时间步的有限时域优化方法(一定的预测能力)

传统的无人机多采用PID控制器, PID控制器不具有“前瞻性”,参与计算的各个量,有当前的 ,上个控制周期的 ,以及之前所有的 累计和,没有未来的 。PID属于无模型控制。PID仅仅通过目标和当前状态的差距,以及三个控制参数,就输出控制量。

github地址:GitHub - ethz-asl/mav_control_rw: Control strategies for rotary wing Micro Aerial Vehicles using ROS

相关论文:

  • Model Predictive Control for Trajectory Tracking of Unmanned Aerial Vehicles Using Robot Operating System. Mina Kamel, Thomas Stastny, Kostas Alexis and Roland Siegwart. Robot Operating System (ROS) The Complete Reference Volume 2. Springer 2017 (to appear)

  • Linear vs Nonlinear MPC for Trajectory Tracking Applied to Rotary Wing Micro Aerial Vehicles. Mina Kamel, Michael Burri and Roland Siegwart. arXiv:1611.09240

功能包中包含了多种控制器来实现对旋翼无人机的控制,当前包含的控制器有:

  • mav_linear_mpc:线性MPC轨迹跟踪控制器
  • mav_nonlinear_mpc:非线性MPC轨迹跟踪控制器
  • PID_attitude_control:PID姿态控制器

安装

ubuntu系统:20.04
ROS系统:noetic

 $ git clone https://github.com/ethz-asl/rotors_simulator.git
 $ git clone https://github.com/ethz-asl/mav_comm.git
 $ git clone https://github.com/ethz-asl/eigen_catkin.git
 $ git clone https://github.com/catkin/catkin_simple.git
 $ git clone https://github.com/ethz-asl/mav_control_rw.git

catkin_make

编译报错:

In file included from /home/jk-jone/jone_ws/src/mav_control_rw/mav_nonlinear_mpc/src/nonlinear_mpc.cc:33:
/home/jk-jone/jone_ws/src/mav_control_rw/mav_nonlinear_mpc/include/mav_nonlinear_mpc/nonlinear_mpc.h:44:10: fatal error: lapacke.h: 没有那个文件或目录
44 | #include
| ^~~
compilation terminated.

解决办法:

  $ sudo apt-get install liblapacke-dev

再次编译
卡在这里了半天

等了好长时间,终于编译过了

gazebo仿真测试

启动gazebo并加载无人机模型

$ roslaunch rotors_gazebo mav.launch mav_name:=firefly

 启动 linear mpc 控制器

$ roslaunch mav_linear_mpc mav_linear_mpc_sim.launch mav_name:=firefly

launch启动的节点如下:

点击基于mpc实现无人机轨迹跟踪ROS功能包:mav_control_rw - 古月居可查看全文