24#ifndef TAPROOT_REF_SERIAL_DATA_HPP_
25#define TAPROOT_REF_SERIAL_DATA_HPP_
29#include <modm/architecture/interface/register.hpp>
31#include "modm/architecture/utils.hpp"
677 template <
typename T>
682 std::is_same<T, DeleteGraphicLayerMessage>::value ||
683 std::is_same<T, Graphic1Message>::value ||
684 std::is_same<T, RobotToRobotMessage>::value ||
685 std::is_same<T, Graphic2Message>::value ||
686 std::is_same<T, Graphic5Message>::value ||
687 std::is_same<T, Graphic7Message>::value ||
688 std::is_same<T, GraphicCharacterMessage>::value,
689 "Invalid type, getWaitTimeAfterGraphicSendMs only takes in ref serial message "
700 static_cast<uint16_t
>(id1) +
static_cast<uint16_t
>(id2));
706 static_cast<uint16_t
>(id1) -
static_cast<uint16_t
>(id2));
Definition ref_serial_data.hpp:76
RobotToRobotMessageHandler()
Definition ref_serial_data.hpp:78
virtual void operator()(const DJISerial::ReceivedSerialMessage &message)=0
Definition ref_serial_data.hpp:87
GameStage
Definition ref_serial_data.hpp:102
@ IN_GAME
In middle of the game.
@ COUNTDOWN
5-second countdown.
@ INITIALIZATION
Initialization stage.
@ END_GAME
Calculating competition results.
@ PREMATCH
Pre-competition. stage.
RFIDActivationStatus
Activation status flags for the RFID module (for RMUC only).
Definition ref_serial_data.hpp:199
@ TERRAIN_CROSSING_OFF_CENTRAL_OWN
@ TERRAIN_CROSSING_ON_ROAD_OWN
@ TERRAIN_CROSSING_ON_ROAD_OPPONENT
@ LARGE_RESOURCE_ISLAND_OPPONENT
@ LARGE_RESOURCE_ISLAND_OWN
@ TERRAIN_CROSSING_OFF_ROAD_OPPONENT
@ CENTRAL_ELEVATED_GROUND_OWN
@ CENTRAL_ELEVATED_GROUND_OPPONENT
@ TERRAIN_CROSSING_OFF_ROAD_OWN
@ TERRAIN_CROSSING_OFF_CENTRAL_OPPONENT
@ TERRAIN_CROSSING_ON_CENTRAL_OPPONENT
@ RESUPPLY_ZONE_OUTSIDE_EXCHANGE
@ LAUNCH_RAMP_BACK_OPPONENT
@ TERRAIN_CROSSING_ON_CENTRAL_OWN
@ LAUNCH_RAMP_FRONT_OPPONENT
@ RESUPPLY_ZONE_INSIDE_EXCHANGE
RobotPower
Definition ref_serial_data.hpp:180
@ CHASSIS_HAS_POWER
1 if there is 24V output to chassis, 0 for 0V.
@ GIMBAL_HAS_POWER
1 if there is 24V output to gimbal, 0 for 0V.
@ SHOOTER_HAS_POWER
1 if there is 24V output to shooter, 0 for 0V.
RobotEnergyLevel
Definition ref_serial_data.hpp:188
MechanismID
Definition ref_serial_data.hpp:244
@ TURRET_17MM_2
17mm barrel ID 2
Definition ref_serial_data.hpp:246
@ TURRET_42MM
42mm barrel
Definition ref_serial_data.hpp:247
@ TURRET_17MM_1
17mm barrel ID 1
Definition ref_serial_data.hpp:245
GameType
The type of game the robot is competing in.
Definition ref_serial_data.hpp:91
@ ROBOMASTER_RMUTC
RoboMaster Technical Challenge.
@ ROBOMASTER_RMUC
RoboMaster Univeristy Challenge.
@ ROBOMASTER_AI_CHALLENGE
RobomMaster AI challenge.
@ ROBOMASTER_RMUL_3V3
RoboMaster RMUL 3v3 competition.
@ ROBOMASTER_RMUL_1V1
RoboMaster RMUL 1v1 competition.
DartTarget
Definition ref_serial_data.hpp:135
@ BASE_RANDOM
A random target selected.
@ NONE_OR_OUTPOST
No target or outpost selected.
SupplierOutletStatus
Definition ref_serial_data.hpp:128
@ PREPARING
The outlet is preparing projectiles.
@ RELEASING
The outlet is releasing projectiles.
DamageType
Definition ref_serial_data.hpp:151
@ BARREL_OVER_SPEED
Firing speed too high.
@ MODULE_OFFLINE
Module offline.
@ ARMOR_DAMAGE
Armor damage.
@ BARREL_OVERHEAT
Barrel overheat.
@ COLLISION
Armor plate collision.
@ CHASSIS_POWER_OVERRUN
Chassis power overrun.
static constexpr int MAX_LAUNCH_SPEED_17MM
Definition ref_serial_data.hpp:253
MODM_FLAGS32(RFIDActivationStatus)
static constexpr int MAX_LAUNCH_SPEED_42MM
Definition ref_serial_data.hpp:258
SiteData
Definition ref_serial_data.hpp:161
@ LARGER_POWER_RUNE_ACTIVIATED
@ RESUPPLY_INSIDE_EXCHANGE_OCCUPIED
@ CENTRAL_ELEVATED_GROUND_OCCUPIED_TEAM
@ SMALL_POWER_RUNE_ACTIVATED
@ RESUPPLY_OUTSIDE_EXCHANGE_OCCUPIED
@ CENTRAL_BUFF_OCCUPIED_OPPONENT
@ CENTRAL_ELEVATED_GROUND_OCCUPIED_OPPONENT
@ CENTRAL_BUFF_OCCUPIED_TEAM
@ TRAPEZOID_OCCUPIED_TEAM
AirSupportState
Definition ref_serial_data.hpp:387
@ IN_AIR
The air support is in the air.
Definition ref_serial_data.hpp:390
@ COOLED
The air support has cooled down.
Definition ref_serial_data.hpp:389
@ COOLING
The air support is cooling down.
Definition ref_serial_data.hpp:388
DartStationState
Definition ref_serial_data.hpp:401
@ TRANSITION
The dart station is opening or closing.
Definition ref_serial_data.hpp:404
@ CLOSED
The dart station is closed.
Definition ref_serial_data.hpp:403
@ OPEN
The dart station is open.
Definition ref_serial_data.hpp:402
GameWinner
Definition ref_serial_data.hpp:112
@ BLUE
Blue team won the match.
@ RED
Red team won the match.
BulletType
Definition ref_serial_data.hpp:234
@ AMMO_42
42 mm projectile ammo.
Definition ref_serial_data.hpp:236
@ AMMO_17
17 mm projectile ammo.
Definition ref_serial_data.hpp:235
ArmorId
Definition ref_serial_data.hpp:142
SiteDartHit
Definition ref_serial_data.hpp:119
@ BASE_RANDOM_FIXED
Fixed target hit after random movement.
@ BASE_FIXED
Fixed target hit.
@ BASE_RANDOM_MOVING
Random moving target hit.
Definition ref_serial_data.hpp:504
struct tap::communication::serial::RefSerialData::Tx::InteractiveHeader modm_packed
GraphicType
The type of graphic being drawn (some geometry, or a string/number)
Definition ref_serial_data.hpp:534
GraphicOperation
Graphic operations that can be passed in an add graphic operation.
Definition ref_serial_data.hpp:520
@ GRAPHIC_NO_OP
Do nothing, no-op.
Definition ref_serial_data.hpp:521
@ GRAPHIC_ADD
Definition ref_serial_data.hpp:522
@ GRAPHIC_DELETE
Delete a particular graphic.
Definition ref_serial_data.hpp:529
@ GRAPHIC_MODIFY
Definition ref_serial_data.hpp:527
DeleteGraphicOperation
Definition ref_serial_data.hpp:512
@ DELETE_ALL
Delete all graphic in all graphic layers.
Definition ref_serial_data.hpp:515
@ DELETE_GRAPHIC_NO_OP
Do nothing, no-op.
Definition ref_serial_data.hpp:513
@ DELETE_GRAPHIC_LAYER
Delete a particular graphic layer (specified later on)
Definition ref_serial_data.hpp:514
static constexpr uint32_t MAX_TRANSMIT_SPEED_BYTES_PER_S
Definition ref_serial_data.hpp:664
GraphicColor
The color of the graphic being drawn.
Definition ref_serial_data.hpp:547
static constexpr uint32_t getWaitTimeAfterGraphicSendMs(T *)
Definition ref_serial_data.hpp:678
Definition ref_serial_data.hpp:41
static bool isBlueTeam(RobotId id)
Definition ref_serial_data.hpp:73
RobotId
Definition ref_serial_data.hpp:48
Definition dji_serial.cpp:41
RefSerialData::RobotId operator-(RefSerialData::RobotId id1, RefSerialData::RobotId id2)
Definition ref_serial_data.hpp:703
RefSerialData::RobotId operator+(RefSerialData::RobotId id1, RefSerialData::RobotId id2)
Definition ref_serial_data.hpp:697
Definition ref_serial_data.hpp:394
uint8_t remainingStateTime
Definition ref_serial_data.hpp:396
AirSupportState state
The current state of air support.
Definition ref_serial_data.hpp:395
Definition ref_serial_data.hpp:310
uint16_t powerBuffer
Chassis power buffer (in J).
Definition ref_serial_data.hpp:311
uint16_t powerConsumptionLimit
The current chassis power limit (in W).
Definition ref_serial_data.hpp:313
RobotPosition position
x, y coordinate of the chassis (in m).
Definition ref_serial_data.hpp:312
Definition ref_serial_data.hpp:228
uint16_t damageAmount
Amount of damage received.
Definition ref_serial_data.hpp:229
uint32_t timestampMs
Time when damage was received (in milliseconds).
Definition ref_serial_data.hpp:230
Definition ref_serial_data.hpp:379
uint8_t hits
The number of successful hits by the dart launcher.
Definition ref_serial_data.hpp:382
DartTarget selectedTarget
The currently selected target.
Definition ref_serial_data.hpp:383
SiteDartHit lastHit
The last target hit by the dart.
Definition ref_serial_data.hpp:381
uint8_t launchCountdown
Seconds until the dart launcher can fire again.
Definition ref_serial_data.hpp:380
Definition ref_serial_data.hpp:408
uint16_t targetChangedTime
Definition ref_serial_data.hpp:410
uint16_t lastLaunchedTime
Definition ref_serial_data.hpp:412
DartStationState state
Current state of the dart station doors.
Definition ref_serial_data.hpp:409
Definition ref_serial_data.hpp:284
uint8_t timeSinceLastDartHit
Time since the last dart hit own outpost or base.
Definition ref_serial_data.hpp:286
SiteData_t siteData
Information about occupied zones.
Definition ref_serial_data.hpp:285
SiteDartHit lastDartHit
The target hit by the last dart.
Definition ref_serial_data.hpp:287
Definition ref_serial_data.hpp:451
AirSupportData airSupportData
Information about the air support.
Definition ref_serial_data.hpp:460
GameWinner gameWinner
Results of the match.
Definition ref_serial_data.hpp:456
SentryInfo sentry
Information about the sentry.
Definition ref_serial_data.hpp:465
EventData eventData
Data about the current event.
Definition ref_serial_data.hpp:457
RadarInfo radar
Information about the radar station.
Definition ref_serial_data.hpp:466
SupplierAction supplier
Data about the projectile supplier.
Definition ref_serial_data.hpp:458
uint64_t unixTime
Unix time of the competition server.
Definition ref_serial_data.hpp:455
DartStationInfo dartStation
Information about the dart launching station.
Definition ref_serial_data.hpp:461
RadarMarkProgress radarProgress
Information about the mark progress for the radar station.
Definition ref_serial_data.hpp:464
GameStage gameStage
Current stage in the game.
Definition ref_serial_data.hpp:453
DartInfo dartInfo
Data about the dart launcher.
Definition ref_serial_data.hpp:459
GroundRobotPositions positions
Information about the position of ground robots.
Definition ref_serial_data.hpp:462
uint16_t stageTimeRemaining
Remaining time in the current stage (in seconds).
Definition ref_serial_data.hpp:454
GameType gameType
Current type of competition the robot is taking part in.
Definition ref_serial_data.hpp:452
Definition ref_serial_data.hpp:417
RobotPosition hero
Definition ref_serial_data.hpp:418
RobotPosition engineer
Definition ref_serial_data.hpp:419
RobotPosition standard4
Definition ref_serial_data.hpp:421
RobotPosition standard3
Definition ref_serial_data.hpp:420
Definition ref_serial_data.hpp:445
bool activeDoubleVulnerabilityEffect
True when the effect is active.
Definition ref_serial_data.hpp:447
uint8_t availableDoubleVulnerablilityEffects
The number of remaining effects.
Definition ref_serial_data.hpp:446
Definition ref_serial_data.hpp:428
uint8_t standard3
Definition ref_serial_data.hpp:431
uint8_t hero
Definition ref_serial_data.hpp:429
uint8_t standard4
Definition ref_serial_data.hpp:432
uint8_t engineer
Definition ref_serial_data.hpp:430
uint8_t sentry
Definition ref_serial_data.hpp:433
Definition ref_serial_data.hpp:357
uint8_t count
The number of violations triggered by the robot.
Definition ref_serial_data.hpp:365
uint8_t level
Definition ref_serial_data.hpp:358
RobotId foulRobotID
The robot that received the referee warning.
Definition ref_serial_data.hpp:364
uint32_t lastReceivedWarningRobotTime
Definition ref_serial_data.hpp:366
static constexpr uint32_t OFFENDING_OPERATOR_BLIND_TIME
time in ms that the user will be blinded for when the operator is the offender
Definition ref_serial_data.hpp:370
static constexpr uint32_t NONOFFENDING_OPERATOR_BLIND_TIME
time in ms that the user will be blinded for when the operator is not the offender
Definition ref_serial_data.hpp:372
Definition ref_serial_data.hpp:338
uint8_t recoveryBuff
The robot's recovery buff. Each increment is 1%.
Definition ref_serial_data.hpp:339
uint16_t attackBuff
The robot's attack buff. Each increment is 1%.
Definition ref_serial_data.hpp:345
uint8_t coolingBuff
Definition ref_serial_data.hpp:340
uint8_t defenseBuff
The robot's defense buff. Each increment is 1%.
Definition ref_serial_data.hpp:342
uint8_t vulnerabilityBuff
The robot's negative defense buff. Each increment is 1%.
Definition ref_serial_data.hpp:344
Definition ref_serial_data.hpp:470
float receivedDps
Damage per second received.
Definition ref_serial_data.hpp:482
RefereeWarningData refereeWarningData
Definition ref_serial_data.hpp:493
RobotPower_t robotPower
Flags indicating which parts of the robot have power.
Definition ref_serial_data.hpp:479
ArmorId damagedArmorId
Armor ID that was damaged.
Definition ref_serial_data.hpp:480
uint16_t maxHp
Max health of this robot.
Definition ref_serial_data.hpp:478
TurretData turret
Turret firing and heat data.
Definition ref_serial_data.hpp:484
DamageType damageType
Cause of damage.
Definition ref_serial_data.hpp:481
RFIDActivationStatus_t rfidStatus
Definition ref_serial_data.hpp:488
uint16_t remainingCoins
Number of remaining coins left to spend.
Definition ref_serial_data.hpp:486
RobotEnergyLevel robotEnergyRemaining
The current energy level of the robot.
Definition ref_serial_data.hpp:495
RobotId robotId
Robot type and team.
Definition ref_serial_data.hpp:471
RobotBuffStatus robotBuffStatus
Status of all buffs on the robot.
Definition ref_serial_data.hpp:487
uint8_t robotLevel
Current level of this robot (1-3).
Definition ref_serial_data.hpp:472
uint32_t robotDataReceivedTimestamp
Definition ref_serial_data.hpp:490
uint16_t currentHp
Current health of this robot.
Definition ref_serial_data.hpp:477
ChassisData chassis
Chassis power draw and position data.
Definition ref_serial_data.hpp:483
RobotHpData allRobotHp
Current HP of all the robots.
Definition ref_serial_data.hpp:485
uint16_t previousHp
Definition ref_serial_data.hpp:473
Definition ref_serial_data.hpp:266
uint16_t hero1
Definition ref_serial_data.hpp:267
uint16_t standard4
Definition ref_serial_data.hpp:270
uint16_t sentry7
Definition ref_serial_data.hpp:271
uint16_t outpost
Definition ref_serial_data.hpp:272
uint16_t base
Definition ref_serial_data.hpp:273
uint16_t engineer2
Definition ref_serial_data.hpp:268
uint16_t standard3
Definition ref_serial_data.hpp:269
Definition ref_serial_data.hpp:264
RobotHp blue
Definition ref_serial_data.hpp:277
RobotHp red
Definition ref_serial_data.hpp:276
Definition ref_serial_data.hpp:304
float x
The x location in meters.
Definition ref_serial_data.hpp:305
float y
The y location in meters.
Definition ref_serial_data.hpp:306
Definition ref_serial_data.hpp:437
uint8_t remoteHealthExchanges
The number of remote health exchanges taken.
Definition ref_serial_data.hpp:441
uint16_t projectileAllowance
Allocated projectiles not including remote exchange.
Definition ref_serial_data.hpp:438
uint8_t remoteProjectileExchanges
The number of remote projectile exchanges taken.
Definition ref_serial_data.hpp:440
Definition ref_serial_data.hpp:294
SupplierOutletStatus outletStatus
The current state of the supplier outlet.
Definition ref_serial_data.hpp:296
RobotId reloadingRobot
The id of the reloading robot.
Definition ref_serial_data.hpp:295
uint8_t suppliedProjectiles
The number of projectiles suppied.
Definition ref_serial_data.hpp:297
Definition ref_serial_data.hpp:317
uint32_t lastReceivedLaunchingInfoTimestamp
Definition ref_serial_data.hpp:332
uint16_t heat42
Current 42mm turret heat.
Definition ref_serial_data.hpp:323
uint16_t heatLimit
Turret heat limit. Shared with all turrets.
Definition ref_serial_data.hpp:324
float yaw
Barrel yaw position (degree).
Definition ref_serial_data.hpp:331
MechanismID launchMechanismID
Either 17mm mechanism 1, 3, or 42 mm mechanism.
Definition ref_serial_data.hpp:319
float bulletSpeed
Last bullet speed (in m/s).
Definition ref_serial_data.hpp:330
uint16_t coolingRate
Turret cooling value per second. Shared with all turrets.
Definition ref_serial_data.hpp:325
uint16_t heat17ID2
Current 17mm turret heat, ID2.
Definition ref_serial_data.hpp:322
BulletType bulletType
17mm or 42mm last projectile shot.
Definition ref_serial_data.hpp:318
uint16_t bulletsRemaining17
Definition ref_serial_data.hpp:326
uint16_t heat17ID1
Current 17mm turret heat, ID1.
Definition ref_serial_data.hpp:321
uint16_t bulletsRemaining42
Definition ref_serial_data.hpp:328
uint8_t firingFreq
Firing frequency (in Hz).
Definition ref_serial_data.hpp:320
Definition ref_serial_data.hpp:594
uint8_t deleteOperation
Definition ref_serial_data.hpp:598
uint16_t cmdId
Definition ref_serial_data.hpp:596
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:597
uint16_t crc16
Definition ref_serial_data.hpp:600
uint8_t layer
Definition ref_serial_data.hpp:599
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:595
Definition ref_serial_data.hpp:604
uint16_t crc16
Definition ref_serial_data.hpp:609
GraphicData graphicData
Definition ref_serial_data.hpp:608
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:605
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:607
uint16_t cmdId
Definition ref_serial_data.hpp:606
Definition ref_serial_data.hpp:621
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:624
GraphicData graphicData[2]
Definition ref_serial_data.hpp:625
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:622
uint16_t cmdId
Definition ref_serial_data.hpp:623
uint16_t crc16
Definition ref_serial_data.hpp:626
Definition ref_serial_data.hpp:630
GraphicData graphicData[5]
Definition ref_serial_data.hpp:634
uint16_t cmdId
Definition ref_serial_data.hpp:632
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:631
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:633
uint16_t crc16
Definition ref_serial_data.hpp:635
Definition ref_serial_data.hpp:639
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:640
uint16_t crc16
Definition ref_serial_data.hpp:644
uint16_t cmdId
Definition ref_serial_data.hpp:641
GraphicData graphicData[7]
Definition ref_serial_data.hpp:643
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:642
Definition ref_serial_data.hpp:648
char msg[30]
Definition ref_serial_data.hpp:653
GraphicData graphicData
Definition ref_serial_data.hpp:652
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:649
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:651
uint16_t cmdId
Definition ref_serial_data.hpp:650
uint16_t crc16
Definition ref_serial_data.hpp:654
Definition ref_serial_data.hpp:570
uint8_t name[3]
Definition ref_serial_data.hpp:571
int32_t value
Definition ref_serial_data.hpp:589
uint32_t layer
Definition ref_serial_data.hpp:574
uint32_t endX
Definition ref_serial_data.hpp:586
uint32_t startY
Definition ref_serial_data.hpp:580
uint32_t startX
Definition ref_serial_data.hpp:579
uint32_t radius
Definition ref_serial_data.hpp:585
uint32_t endAngle
Definition ref_serial_data.hpp:577
uint32_t startAngle
Definition ref_serial_data.hpp:576
uint32_t type
Definition ref_serial_data.hpp:573
uint32_t endY
Definition ref_serial_data.hpp:587
uint32_t lineWidth
Definition ref_serial_data.hpp:578
struct tap::communication::serial::RefSerialData::Tx::GraphicData::@0::@1 modm_packed
uint32_t operation
Definition ref_serial_data.hpp:572
uint32_t color
Definition ref_serial_data.hpp:575
Definition ref_serial_data.hpp:613
DJISerial::FrameHeader frameHeader
Definition ref_serial_data.hpp:614
uint16_t cmdId
Definition ref_serial_data.hpp:615
InteractiveHeader interactiveHeader
Definition ref_serial_data.hpp:616
uint8_t dataAndCRC16[115]
Definition ref_serial_data.hpp:617