MPC多旋翼控制 - mav_control_rw项目

MPC多旋翼控制 - mav_control_rw项目

目录

  • MPC多旋翼控制 - mav_control_rw项目
  • mav_control_rw项目介绍
  • 项目安装
  • 成果

mav_control_rw项目介绍

毕业论文需要研究MPC无人机控制,找到一个比较不错的入手项目,ETHZ ASL的mav_control_rw项目。利用mpc控制实现了旋翼式无人机的轨迹追踪算法。

相关论文:

[1] 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)
[2] Linear vs Nonlinear MPC for Trajectory Tracking Applied to Rotary Wing Micro Aerial Vehicles. Mina Kamel, Michael Burri and Roland Siegwart. arXiv:1611.09240

主要看了第一篇,主要内容是讲旋翼式以及固定翼的线性以及非线性模型的mpc控制器,感觉讲的非常详细了。

项目安装

安装ROS,项目使用的是indigo,但我用的是Noetic,后面使用无区别。不过为了防止意外,此处还是用indigo。不过如果要用Noetic的话需要把安装包中的python后面加个3,如python3-wstool。

  $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
  $ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
  $ sudo apt-get update
  $ sudo apt-get install ros-indigo-desktop-full ros-indigo-joy ros-indigo-octomap-ros python-wstool python-catkin-tools
  $ sudo rosdep init
  $ rosdep update
  $ source /opt/ros/indigo/setup.bash

初始化ROS工作空间(如果没有工作空间的话)

  $ mkdir -p ~/catkin_ws/src
  $ cd ~/catkin_ws
  $ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
  $ catkin init  # initialize your catkin workspace

获取项目源码,如果在之前的步骤建了catkin_ws,需要在~/catkin_ws/src中进行git clone。

 $ sudo apt-get install liblapacke-dev
 $ git clone https://github.com/catkin/catkin_simple.git
 $ 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/ethz-asl/mav_control_rw.git

build工作空间

  $ catkin build

最后进行测试,在两个不同的命令行窗口中输入以下命令

$ roslaunch rotors_gazebo mav.launch mav_name:=firefly
$ roslaunch mav_linear_mpc mav_linear_mpc_sim.launch mav_name:=firefly

成果

现在可以用rqt发布命令试试效果了.命令行输入rqt,然后打开Plugins菜单中visualization里的Message Publisher,发布的话题名称为/firefly/command/pose即可实现定点控制拉,接下来研究一下trajectory的格式以备后面使用。

MPC多旋翼控制 - mav_control_rw项目_第1张图片
MPC多旋翼控制 - mav_control_rw项目_第2张图片

你可能感兴趣的:(c++,嵌入式硬件)