/FYT2024_vision

中南大学FYT战队RoboMaster24赛季视觉项目

Primary LanguageC++Apache License 2.0Apache-2.0

FYT2024 Vision Project

中南大学FYT战队24赛季视觉项目主仓库,该项目在原rm_vision项目上扩展了自瞄选板、能量机关识别与预测、哨兵定位、自主导航等功能,为RoboMaster机器人实现了一套通用的算法框架

目前赛场上出现过2次能量机关程序崩溃的现象

一、项目结构

*表示不在本仓库中直接提供,这部分模块已在CSU-RM-Sentry开源

.
│
├── rm_bringup (启动及参数文件)
│
├── rm_robot_description (机器人urdf文件,坐标系的定义)
│
├── rm_interfaces (自定义msg、srv)
│
├── rm_hardware_driver
│   ├── livox_ros_driver2 (*Livox激光雷达驱动)
│   │
│   ├── rm_camera_driver (相机驱动)
│   │
│   └── rm_serial_driver (串口驱动)
│
├── rm_auto_aim (自瞄算法)
│
├── rm_rune (打符算法)
│
├── rm_localization (*定位算法)
│
├── rm_perception (*感知算法)
│
├── rm_navigation (*导航算法)
│
├── rm_decision (*自主决策算法)
│
├── rm_utils (工具包) 
│   ├── math (包括PnP解算、弹道补偿等)
│   │
│   └── logger (日志库)
│
└── rm_upstart (自启动配置)

二、环境

如果你不需要完整功能,可以直接把相关的功能包删除掉

1. 基础

  • Ubuntu 22.04
  • ROS2 Humble
  • 大恒相机驱动

2. 自瞄

  • fmt库
    sudo apt install libfmt-dev
  • Sophus库 (G2O库依赖)
    git clone https://github.com/strasdat/Sophus
    cd Sophus
    mkdir build && cd build
    cmake ..
    make -j
    sudo make install
  • G2O库 (优化装甲板Yaw角度)
    sudo apt install libeigen3-dev libspdlog-dev libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-dev-qt5
    git clone https://github.com/RainerKuemmerle/g2o
    cd g2o
    mkdir build && cd build
    cmake ..
    make -j
    sudo make install

3. 能量机关

  • OpenVINO库 (能量机关识别)

    参考OpenVINO官方文档,建议同时安装GPU相关依赖

  • Ceres库 (能量机关曲线拟合)

    sudo apt install libceres-dev

4. 导航

  • Livox SDK2

    参考Livox官方仓库

  • Navigation2 (导航)

    sudo apt install ros-humble-navigation2 ros-humble-nav2-bringup
  • PCL库 (导航时对点云的处理)

    sudo apt install libpcl-dev
    

5. 其他

本文档中可能有缺漏,如有,可以用rosdep安装剩下依赖

rosdep install --from-paths src --ignore-src -r -y

三、编译与运行

修改rm_bringup/config/launch_params.yaml,选择需要启动的功能

# 编译
colcon build --symlink-install --parallel-workers 4 #本仓库包含的功能包过多,建议限制同时编译的线程数
# 运行
source install/setup.bash
ros2 launch rm_bringup bringup.launch.py

默认日志和内录视频路径为~/fyt2024-log/

我们的日志库是用fmt搓的,不使用ros2的日志库

四、自启动

  • 编译程序后,进入rm_upstart文件夹
cd rm_upstart
  • 修改rm_watch_dog.sh中的NAMESPACE(ros命名空间)、NODE_NAMES(需要看门狗监控的节点)和WORKING_DIR (代码路径)

  • 注册服务

sudo chmod +x ./register_service.sh
sudo ./register_service.sh

# 正常时有如下输出
# Creating systemd service file at /etc/systemd/system/rm.service...
# Reloading systemd daemon...
# Enabling service rm.service...
# Starting service rm.service...
# Service rm.service has been registered and started.
  • 查看程序状态
systemctl status rm
  • 查看终端输出
查看screen.output或~/fyt2024-log下的日志
  • 关闭程序
systemctl stop rm
  • 取消自启动
systemctl disable rm

维护者及开源许可证

赛季结束开源

Maintainer : FYT Vision Group

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

致谢

感谢这个赛季视觉组的每一个成员的付出,感谢以下开源项目: