Skip to content

Commit

Permalink
新增全向感知
Browse files Browse the repository at this point in the history
  • Loading branch information
imuncle committed Aug 5, 2022
1 parent 564ec92 commit 0dbfab3
Show file tree
Hide file tree
Showing 47 changed files with 3,856 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ RMUA2021战队技术答辩视频链接:[RoboMaster 2021高校人工智能挑
|robot_sentry|哨岗识别模块|
|robot_decision|决策模块|
|robot_detection|装甲识别模块|
|robot_omni|车端全向感知模块|
|robot_msgs|自定义的ros消息类型|

## 编译及运行
哨岗识别模块自成一体,不与其他模块一起编译。

决策模块、装甲识别模块和全向感知模块均依赖`robot_msgs`,编译时务必包含在内。

具体编译步骤参考各个模块的README。
4 changes: 3 additions & 1 deletion robot_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ robot_detection
单独运行测试:进入工作空间,运行节点,播放rosbag

```bash
source devel/setup.bash
catkin_make
source devel/setup.bash
roslaunch robot_detection robot_detection.launch
rosbag play test.bag
```

## 4、网盘链接
网盘中提供了用于演示功能的rosbag。链接:[https://pan.baidu.com/s/1EDhP30KD0Ao7wxOlbpj_VQ](https://pan.baidu.com/s/1EDhP30KD0Ao7wxOlbpj_VQ?pwd=ft9k),提取码:ft9k。
84 changes: 84 additions & 0 deletions robot_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
cmake_minimum_required(VERSION 3.1)
project(robot_msgs)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})

find_package(catkin REQUIRED COMPONENTS
std_msgs
nav_msgs
geometry_msgs
actionlib
message_generation
)

add_action_files(
DIRECTORY action
FILES
)

add_message_files(
DIRECTORY msg
FILES
IMUParam.msg
TOFdata.msg
)

add_message_files(
DIRECTORY msg/net
FILES

ZMQdata.msg
)

add_message_files(
DIRECTORY msg/robot
FILES
ArmorDetection.msg
ChassisParam.msg
CornerDetection.msg
GimbalAngle.msg
OdomGoalMsg.msg
RobotFlag.msg
RobotPose.msg
TwistAccel.msg
RobotLocation.msg
GlobalMap.msg
)

add_message_files(
DIRECTORY msg/referee
FILES
GameZone.msg
GameBuff.msg
GameResult.msg
GameRobotHP.msg
GameStatus.msg
RobotDamage.msg
RobotStatus.msg
)

add_message_files(
DIRECTORY msg/wireless
FILES
SentryData.msg
SharePath.msg
TeamInfo.msg
WirelessParam.msg
)

add_service_files(
DIRECTORY srv
FILES
)

generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
nav_msgs
)

catkin_package(
CATKIN_DEPENDS
message_runtime
)
5 changes: 5 additions & 0 deletions robot_msgs/msg/IMUParam.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# imu param
float32 temperature
float32 gyro_bias_x
float32 gyro_bias_y
float32 gyro_bias_z
6 changes: 6 additions & 0 deletions robot_msgs/msg/TOFdata.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
uint8 id1
uint8 id2
uint8 status1
uint8 status2
float64 distance1
float64 distance2
4 changes: 4 additions & 0 deletions robot_msgs/msg/net/ZMQdata.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ZMQ data
int16[8] robot_pose_x
int16[8] robot_pose_y

12 changes: 12 additions & 0 deletions robot_msgs/msg/referee/GameBuff.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# game zone array
GameZone[6] zone

# game robot bullet
uint16 red1
uint16 red2
uint16 blue1
uint16 blue2

# lurk_mode
uint8 lurl_mode
uint8 res
5 changes: 5 additions & 0 deletions robot_msgs/msg/referee/GameResult.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#game result
uint8 DRAW=0
uint8 RED_WIN=1
uint8 BLUE_WIN=2
uint8 result
5 changes: 5 additions & 0 deletions robot_msgs/msg/referee/GameRobotHP.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#game robot hp
uint16 red1
uint16 red2
uint16 blue1
uint16 blue2
12 changes: 12 additions & 0 deletions robot_msgs/msg/referee/GameStatus.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#game status
uint8 PRE_MATCH = 0
uint8 SETUP = 1
uint8 INIT = 2
uint8 FIVE_SEC_CD = 3
uint8 ROUND = 4
uint8 CALCULATION = 5
uint8 game_status
uint16 remaining_time



10 changes: 10 additions & 0 deletions robot_msgs/msg/referee/GameZone.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#game zone
uint8 RED_HP_RECOVERY=1
uint8 RED_BULLET_SUPPLY=2
uint8 BLUE_HP_RECOVERY=3
uint8 BLUE_BULLET_SUPPLY=4
uint8 DISABLE_SHOOTING=5
uint8 DISABLE_MOVEMENT=6

uint8 type
bool active
14 changes: 14 additions & 0 deletions robot_msgs/msg/referee/RobotDamage.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#robot damage
uint8 ARMOR = 0
uint8 OFFLINE = 1
uint8 EXCEED_SHOOT_SPEED = 2
uint8 EXCEED_SHOOT_HEAT = 3
uint8 EXCEED_CHASSIS_POWER = 4
uint8 OBSTACLE_COLLISION = 5
uint8 damage_type

uint8 FORWARD = 0
uint8 LEFT = 1
uint8 BACKWARD = 2
uint8 RIGHT = 3
uint8 damage_source
13 changes: 13 additions & 0 deletions robot_msgs/msg/referee/RobotStatus.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#robot status
uint8 id
uint8 level
uint16 remain_hp
uint16 max_hp

uint16 heat_cooling_rate
uint16 heat_cooling_limit
uint16 heat_speed_limit

bool gimbal_enable
bool chassis_enable
bool shooter_enable
7 changes: 7 additions & 0 deletions robot_msgs/msg/robot/ArmorDetection.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#armor detected msg
Header header
uint8 id
bool detected_enemy
float64 enemy_x
float64 enemy_y
float64 distance
3 changes: 3 additions & 0 deletions robot_msgs/msg/robot/ChassisParam.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
uint8 robot_id
uint16 wheel_pwm
float32 voltage
12 changes: 12 additions & 0 deletions robot_msgs/msg/robot/CornerDetection.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
uint8 camera_id # 相机id号
uint8 num_find # 相机找到机器人的数量

uint8 robot_id_1
float64 position_x_1
float64 position_y_1
float64 angular_theta_1

uint8 robot_id_2
float64 position_x_2
float64 position_y_2
float64 angular_theta_2
13 changes: 13 additions & 0 deletions robot_msgs/msg/robot/GimbalAngle.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#gimbal feedback angle data
Header header
bool yaw_mode

float64 yaw_gyro
float64 yaw_angle
float64 yaw_ecd_angle
float64 pitch_angle
float64 yaw_original
float64 bullet_speed

uint16 armor_angle
uint16 distance
5 changes: 5 additions & 0 deletions robot_msgs/msg/robot/GlobalMap.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#GlobalMap
Header header
RobotLocation[] robots
RobotLocation[6] msg2decision #0->red1 1->red2 2->blue1 3->blue2 4->gray1 5->gray2
bool is_sentry_on
4 changes: 4 additions & 0 deletions robot_msgs/msg/robot/OdomGoalMsg.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
float64 x
float64 y
float64 yaw
uint8 mode
1 change: 1 addition & 0 deletions robot_msgs/msg/robot/RobotFlag.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bool flag
5 changes: 5 additions & 0 deletions robot_msgs/msg/robot/RobotLocation.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Robot_location
uint8 id
float32 x #单位m
float32 y
float64 yaw #单位弧度 ==100表示无效
8 changes: 8 additions & 0 deletions robot_msgs/msg/robot/RobotPose.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
float32 robot0_x
float32 robot0_y
float32 robot1_x
float32 robot1_y
float32 robot2_x
float32 robot2_y
float32 robot3_x
float32 robot3_y
3 changes: 3 additions & 0 deletions robot_msgs/msg/robot/TwistAccel.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
uint8 mode
geometry_msgs/Twist twist
geometry_msgs/Accel accel
7 changes: 7 additions & 0 deletions robot_msgs/msg/wireless/SentryData.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# sentry data
Header header
uint8 id
uint8[4] lable
uint16[4] x # mm
uint16[4] y # mm
int16[4] yaw # rad*100
6 changes: 6 additions & 0 deletions robot_msgs/msg/wireless/SharePath.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 机器人路径规划共享
Header header
uint8 id

uint16[7] pos_x
uint16[7] pos_y
14 changes: 14 additions & 0 deletions robot_msgs/msg/wireless/TeamInfo.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Header header
uint8 id

uint8 attack_enemy #正攻击敌方机器人id
uint8 being_attacked #受攻击方向
uint8 to_buff #要去的buff点
uint16 pose_x_teammate
uint16 pose_y_teammate
uint16 pose_x_enemy
uint16 pose_y_enemy

bool teammate_retreat #队友是否撤退
uint8 team_mode #主攻还是辅助的标志
uint8 decision_enemy_id #决策选择的进攻目标
14 changes: 14 additions & 0 deletions robot_msgs/msg/wireless/WirelessParam.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# wireless param

uint8 id

# freq range: 0~127
uint8 freq_tx
uint8 freq_rx1
uint8 freq_rx2

uint8 SPEED_250K = 0
uint8 SPEED_1M = 1
uint8 SPEED_2M = 2
uint8 speed

32 changes: 32 additions & 0 deletions robot_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<package>
<name>robot_msgs</name>
<version>1.0.0</version>
<description>
The robot msgs package provides all the messages for RoboMaster AI Robot
</description>
<author>RoboMaster</author>
<maintainer email="[email protected]">RoboMaster</maintainer>
<license>GPL 3.0</license>
<url>https://github.com/RoboMaster/RoboRTS</url>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>actionlib</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>message_generation</build_depend>


<run_depend>actionlib</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>nav_msgs</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>message_runtime</run_depend>

<export>
</export>

</package>
Loading

0 comments on commit 0dbfab3

Please sign in to comment.