本项目是一个基于PX4和ROS Noetic的无人机仿真项目,结合Gazebo仿真环境和视觉伺服控制技术,实现无人机的目标跟踪与控制。通过ROS节点实现图像处理、视觉伺服、观测器以及目标控制等功能。
This project is a UAV simulation project based on PX4 and ROS Noetic, combining the Gazebo simulation environment and visual servoing control technology to achieve target tracking and control of UAVs. ROS nodes are used to implement image processing, visual servoing, observer, and target control functions.
在运行本项目之前,您需要安装以下软件和环境:
Before running this project, you need to install the following software and environments:
-
PX4 Autopilot: 无人机飞控软件。
- 安装指南: PX4官方安装文档
- PX4 Autopilot: UAV flight control software.
- Installation Guide: PX4 Official Installation Documentation
-
ROS Noetic: 机器人操作系统。
- 安装指南: ROS Noetic安装文档
- ROS Noetic: Robot Operating System.
- Installation Guide: ROS Noetic Installation Documentation
-
Gazebo: 仿真环境。
- 通常与ROS Noetic一起安装。
- Gazebo: Simulation environment.
- Usually installed with ROS Noetic.
-
QGroundControl (QGC): 地面站软件,用于控制无人机。
- 下载地址: QGroundControl官网
- QGroundControl (QGC): Ground control software for UAV control.
- Download: QGroundControl Official Website
-
将ROS启动文件
my_UAV_sitl.launch
复制到\PX4-Autopilot\launch
目录中。- Copy the ROS launch file
my_UAV_sitl.launch
to the\PX4-Autopilot\launch
directory.
- Copy the ROS launch file
-
将世界文件
my_sim_world.world
复制到\PX4-Autopilot\Tools\simulation\gazebo-classic\sitl_gazebo-classic\worlds
目录中。- Copy the world file
my_sim_world.world
to the\PX4-Autopilot\Tools\simulation\gazebo-classic\sitl_gazebo-classic\worlds
directory.
- Copy the world file
-
下载
obvs_ws
工作空间到本地,并使用catkin_make
进行编译。- Download the
obvs_ws
workspace to your local machine and compile it usingcatkin_make
.
cd ~/obvs_ws catkin_make
- Download the
-
编译完成后,使用以下命令设置环境变量:
-
After compilation, set up the environment variables using the following command:
source devel/setup.bash
-
启动仿真环境:
- Launch the simulation environment:
roslaunch px4 my_UAV_sitl.launch
-
打开QGroundControl (QGC) 地面站:
- Open QGroundControl (QGC) ground station:
- 启动QGC应用程序,并连接到仿真无人机。
- Launch the QGC application and connect to the simulated UAV.
- Open QGroundControl (QGC) ground station:
-
控制无人机起飞至7米高度:
-
打开图像处理节点:
- Start the image processing node:
rosrun ibvs_proj image_processor_node
-
打开视觉伺服节点:
- Start the visual servoing node:
rosrun ibvs_proj ibvs_node
-
打开观测器节点:
- Start the observer node:
rosrun ibvs_proj observe_node
-
运行目标控制节点:
- Run the target control node:
rosrun block_controller block_controller
使用 rqt 查看运行结果。 Use rqt to view the running results.
-
话题
/ground_target_Vel/twist/linear
为目标真实运动速度。- The topic
/ground_target_Vel/twist/linear
represents the true motion velocity of the target.
- The topic
-
话题
/target_est_vel_velocity/twist/linear
为估计器对目标运动速度的估计。- The topic
/target_est_vel_velocity/twist/linear
represents the estimated motion velocity of the target by the estimator.
- The topic