Class RefSerialData
Defined in File ref_serial_data.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Derived Types
public tap::communication::serial::RefSerial
(Class RefSerial)public tap::communication::serial::RefSerialTransmitter
(Class RefSerialTransmitter)
Class Documentation
-
class RefSerialData
Contains enum and struct definitions used in the
RefSerial
class.Subclassed by tap::communication::serial::RefSerial, tap::communication::serial::RefSerialTransmitter
Public Types
-
enum class RobotId : uint16_t
When receiving data about other robots or sending data to other robots, they are identified by the numbers below
Values:
-
enumerator INVALID
-
enumerator RED_HERO
-
enumerator RED_ENGINEER
-
enumerator RED_SOLDIER_1
-
enumerator RED_SOLDIER_2
-
enumerator RED_SOLDIER_3
-
enumerator RED_DRONE
-
enumerator RED_SENTINEL
-
enumerator RED_DART
-
enumerator RED_RADAR_STATION
-
enumerator BLUE_HERO
-
enumerator BLUE_ENGINEER
-
enumerator BLUE_SOLDIER_1
-
enumerator BLUE_SOLDIER_2
-
enumerator BLUE_SOLDIER_3
-
enumerator BLUE_DRONE
-
enumerator BLUE_SENTINEL
-
enumerator BLUE_DART
-
enumerator BLUE_RADAR_STATION
-
enumerator INVALID
Public Static Functions
-
class RobotToRobotMessageHandler
Public Functions
-
inline RobotToRobotMessageHandler()
-
virtual void operator()(const DJISerial::ReceivedSerialMessage &message) = 0
-
inline RobotToRobotMessageHandler()
-
class Rx
Contains enum and struct definitions specific to receiving data from the referee serial class.
Public Types
-
enum class GameType : uint8_t
The type of game the robot is competing in.
Values:
-
enumerator UNKNOWN
Unknown competition type (most likely disconnected from server).
-
enumerator ROBOMASTER_RMUC
RoboMaster Univeristy Challenge.
-
enumerator ROBOMASTER_RMUTC
RoboMaster Technical Challenge.
-
enumerator ROBOMASTER_AI_CHALLENGE
RobomMaster AI challenge.
-
enumerator ROBOMASTER_RMUL_3V3
RoboMaster RMUL 3v3 competition.
-
enumerator ROBOMASTER_RMUL_1V1
RoboMaster RMUL 1v1 competition.
-
enumerator UNKNOWN
-
enum class GameStage : uint8_t
Values:
-
enumerator PREMATCH
Pre-competition. stage.
-
enumerator SETUP
Setup stage.
-
enumerator INITIALIZATION
Initialization stage.
-
enumerator COUNTDOWN
5-second countdown.
-
enumerator IN_GAME
In middle of the game.
-
enumerator END_GAME
Calculating competition results.
-
enumerator PREMATCH
-
enum class GameWinner : uint8_t
Values:
-
enumerator DRAW
Match was a draw.
-
enumerator RED
Red team won the match.
-
enumerator BLUE
Blue team won the match.
-
enumerator DRAW
-
enum class SiteDartHit : uint8_t
Values:
-
enumerator NONE
No hit target.
-
enumerator OUTPOST
Outpost hit.
-
enumerator BASE_FIXED
Fixed target hit.
-
enumerator BASE_RANDOM
Random target hit.
-
enumerator NONE
-
enum class SupplierOutletStatus : uint8_t
Values:
-
enumerator CLOSED
The outlet is closed.
-
enumerator PREPARING
The outlet is preparing projectiles.
-
enumerator RELEASING
The outlet is releasing projectiles.
-
enumerator CLOSED
-
enum class DartTarget : uint8_t
Values:
-
enumerator NONE_OR_OUTPOST
No target or outpost selected.
-
enumerator BASE_FIXED
A fixed target selected.
-
enumerator BASE_RANDOM
A random target selected.
-
enumerator NONE_OR_OUTPOST
-
enum class ArmorId : uint8_t
Values:
-
enumerator FRONT
armor #0 (front).
-
enumerator LEFT
armor #1 (left).
-
enumerator REAR
armor #2 (rear).
-
enumerator RIGHT
armor #3 (right).
-
enumerator TOP
armor #4 (top).
-
enumerator FRONT
-
enum class DamageType : uint8_t
Values:
-
enumerator ARMOR_DAMAGE
Armor damage.
-
enumerator MODULE_OFFLINE
Module offline.
-
enumerator BARREL_OVER_SPEED
Firing speed too high.
-
enumerator BARREL_OVERHEAT
Barrel overheat.
-
enumerator CHASSIS_POWER_OVERRUN
Chassis power overrun.
-
enumerator COLLISION
Armor plate collision.
-
enumerator ARMOR_DAMAGE
-
enum class SiteData : uint32_t
Values:
-
enumerator RESTORATION_FRONT_OCCUPIED
-
enumerator RESTORATION_INSIDE_OCCUPIED
-
enumerator SUPPLIER_OCCUPIED
-
enumerator POWER_RUNE_OCCUPIED
-
enumerator SMALL_POWER_RUNE_ACTIVATED
-
enumerator LARGER_POWER_RUNE_ACTIVIATED
-
enumerator RING_OCCUPIED_TEAM
-
enumerator RING_OCCUPIED_OPPONENT
-
enumerator TRAPEZOID_R3_OCCUPIED_TEAM
-
enumerator TRAPEZOID_R3_OCCUPIED_OPPONENT
-
enumerator TRAPEZOID_R4_OCCUPIED_TEAM
-
enumerator TRAPEZOID_R4_OCCUPIED_OPPONENT
-
enumerator CENTRAL_BUFF_OCCUPIED_TEAM
-
enumerator CENTRAL_BUFF_OCCUPIED_OPPONENT
-
enumerator RESTORATION_FRONT_OCCUPIED
-
enum class RobotPower : uint8_t
Values:
-
enumerator GIMBAL_HAS_POWER
1 if there is 24V output to gimbal, 0 for 0V.
-
enumerator CHASSIS_HAS_POWER
1 if there is 24V output to chassis, 0 for 0V.
-
enumerator SHOOTER_HAS_POWER
1 if there is 24V output to shooter, 0 for 0V.
-
enumerator GIMBAL_HAS_POWER
-
enum class RFIDActivationStatus : uint32_t
Activation status flags for the RFID module (for RMUC only).
Values:
-
enumerator BASE_BUFF
-
enumerator ELEVATED_RING_OWN
-
enumerator ELEVATED_RING_OPPONENT
-
enumerator TRAPEZOID_R3_OWN
-
enumerator TRAPEZOID_R3_OPPONENT
-
enumerator TRAPEZOID_R4_OWN
-
enumerator TRAPEZOID_R4_OPPONENT
-
enumerator POWER_RUNE_ACTIVATION
-
enumerator LAUNCH_RAMP_FRONT_OWN
-
enumerator LAUNCH_RAMP_BACK_OWN
-
enumerator LAUNCH_RAMP_FRONT_OPPONENT
-
enumerator LAUNCH_RAMP_BACK_OPPONENT
-
enumerator OUTPOST_BUFF
-
enumerator RESTORATION_ZONE
-
enumerator SENTRY_PATROL_OWN
-
enumerator SENTRY_PATROL_OPPONENT
-
enumerator LARGE_ISLAND_OWN
-
enumerator LARGE_ISLAND_OPPONENT
-
enumerator EXCHANGE_ZONE
-
enumerator CENTRAL_BUFF
-
enumerator BASE_BUFF
-
enum BulletType
Values:
-
enumerator AMMO_17
17 mm projectile ammo.
-
enumerator AMMO_42
42 mm projectile ammo.
-
enumerator AMMO_17
-
enum MechanismID
Barrel identifier associated with the projectile launch message (which is sent when a projectile has been launched).
Values:
-
enumerator TURRET_17MM_1
17mm barrel ID 1
-
enumerator TURRET_17MM_2
17mm barrel ID 2
-
enumerator TURRET_42MM
42mm barrel
-
enumerator TURRET_17MM_1
-
enum AirSupportState
Values:
-
enumerator COOLING
The air support is cooling down.
-
enumerator COOLED
The air support has cooled down.
-
enumerator IN_AIR
The air support is in the air.
-
enumerator COOLING
-
enum DartStationState
Values:
-
enumerator OPEN
The dart station is open.
-
enumerator CLOSED
The dart station is closed.
-
enumerator TRANSITION
The dart station is opening or closing.
-
enumerator OPEN
-
using RobotPower_t = modm::Flags8<RobotPower>
-
using RFIDActivationStatus_t = modm::Flags32<RFIDActivationStatus>
Public Static Attributes
-
static int MAX_LAUNCH_SPEED_17MM = 30
The Maximum launch speed for a 17mm barrel in m/s.
-
static int MAX_LAUNCH_SPEED_42MM = 16
The Maximum launch speed for a 42mm barrel in m/s.
-
struct AirSupportData
Public Members
-
AirSupportState state
The current state of air support.
-
uint8_t remainingStateTime
The remaining seconds until the air support moves to the next state.
-
AirSupportState state
-
struct ChassisData
Public Members
-
uint16_t volt
Output voltage to the chassis (in mV).
-
uint16_t current
Output current to the chassis (in mA).
-
float power
Output power to the chassis (in W).
-
uint16_t powerBuffer
Chassis power buffer (in J).
-
RobotPosition position
x, y coordinate of the chassis (in m).
-
uint16_t powerConsumptionLimit
The current chassis power limit (in W).
-
uint16_t volt
-
struct DamageEvent
-
struct DartInfo
Information about the dart launcher
Public Members
-
uint8_t launchCountdown
Seconds until the dart launcher can fire again.
-
SiteDartHit lastHit
The last target hit by the dart.
-
uint8_t hits
The number of successful hits by the dart launcher.
-
DartTarget selectedTarget
The currently selected target.
-
uint8_t launchCountdown
-
struct DartStationInfo
Public Members
-
DartStationState state
Current state of the dart station doors.
-
uint16_t targetChangedTime
Remaining seconds in the competition when the target was changed.
-
uint16_t lastLaunchedTime
Remaining seconds in the competition when the dart was launched.
-
DartStationState state
-
struct EventData
Data about the current state of the event.
Public Members
-
SiteData_t siteData
Information about occupied zones.
-
uint8_t virtualShieldRemainingPercent
Remain percent on own base’s virtual shield.
-
uint8_t timeSinceLastDartHit
Time since the last dart hit own outpost or base.
-
SiteDartHit lastDartHit
The target hit by the last dart.
-
SiteData_t siteData
-
struct GameData
Public Members
-
uint16_t stageTimeRemaining
Remaining time in the current stage (in seconds).
-
uint64_t unixTime
Unix time of the competition server.
-
GameWinner gameWinner
Results of the match.
-
SupplierAction supplier
Data about the projectile supplier.
-
AirSupportData airSupportData
Information about the air support.
-
DartStationInfo dartStation
Information about the dart launching station.
-
GroundRobotPositions positions
Information about the position of ground robots.
-
RadarMarkProgress radarProgress
Information about the mark progress for the radar station.
-
SentryInfo sentry
Information about the sentry.
-
uint16_t stageTimeRemaining
-
struct GroundRobotPositions
Public Members
-
RobotPosition hero
-
RobotPosition engineer
-
RobotPosition standard3
-
RobotPosition standard4
-
RobotPosition standard5
-
RobotPosition hero
-
struct RadarInfo
-
struct RadarMarkProgress
Mark progress of different robots. Values range from 0 to 120.
-
struct RefereeWarningData
Ref serial warning data. This informational struct is intended to be updated each time a yellow or red card has been received.
When a yellow card is received, the offending Operator will be blocked from seeing anything for 5 seconds, while the operation interfaces of other operators in the offending team will be blocked for 2 seconds.
-
struct RobotBuffStatus
Public Members
-
uint8_t recoveryBuff
The robot’s recovery buff. Each increment is 1%.
-
uint8_t coolingBuff
The robot’s barrel cooling rate buff. Each increment is a 1x multiplier.
-
uint8_t defenseBuff
The robot’s defense buff. Each increment is 1%.
-
uint8_t vulnerabilityBuff
The robot’s negative defense buff. Each increment is 1%.
-
uint16_t attackBuff
The robot’s attack buff. Each increment is 1%.
-
uint8_t recoveryBuff
-
struct RobotData
Public Members
-
uint8_t robotLevel
Current level of this robot (1-3).
-
uint16_t previousHp
Health of this robot before damage was received, used to calculate receivedDps if no damage was received recently, previousHp = currentHp.
-
uint16_t currentHp
Current health of this robot.
-
uint16_t maxHp
Max health of this robot.
-
RobotPower_t robotPower
Flags indicating which parts of the robot have power.
-
DamageType damageType
Cause of damage.
-
float receivedDps
Damage per second received.
-
ChassisData chassis
Chassis power draw and position data.
-
TurretData turret
Turret firing and heat data.
-
RobotHpData allRobotHp
Current HP of all the robots.
-
uint16_t remainingCoins
Number of remaining coins left to spend.
-
RobotBuffStatus robotBuffStatus
Status of all buffs on the robot.
-
RFIDActivationStatus_t rfidStatus
The current status of which RFID zones are being activated by the current robot.
-
uint32_t robotDataReceivedTimestamp
Most recent time at which data with message id
REF_MESSAGE_TYPE_ROBOT_STATUS
has been received.
-
RefereeWarningData refereeWarningData
Referee warning information, updated when a robot receives a penalty
-
uint8_t robotLevel
-
struct RobotPosition
Robot position information.
-
struct SentryInfo
-
struct SupplierAction
Information about the projectile supplier.
Public Members
-
SupplierOutletStatus outletStatus
The current state of the supplier outlet.
-
uint8_t suppliedProjectiles
The number of projectiles suppied.
-
SupplierOutletStatus outletStatus
-
struct TurretData
Public Members
-
BulletType bulletType
17mm or 42mm last projectile shot.
-
MechanismID launchMechanismID
Either 17mm mechanism 1, 3, or 42 mm mechanism.
-
uint8_t firingFreq
Firing frequency (in Hz).
-
uint16_t heat17ID1
Current 17mm turret heat, ID1.
-
uint16_t heat17ID2
Current 17mm turret heat, ID2.
-
uint16_t heat42
Current 42mm turret heat.
-
uint16_t heatLimit
Turret heat limit. Shared with all turrets.
-
uint16_t coolingRate
Turret cooling value per second. Shared with all turrets.
-
uint16_t bulletsRemaining17
Number of bullets remaining in sentinel and drone only (500 max) if in RMUC, or any robot in RMUL.
-
uint16_t bulletsRemaining42
Number of bullets remaining in hero if in RMUL or 0 if in RMUC.
-
float bulletSpeed
Last bullet speed (in m/s).
-
float yaw
Barrel yaw position (degree).
-
uint32_t lastReceivedLaunchingInfoTimestamp
Last time in milliseconds that the real-time launching information message was received
-
BulletType bulletType
-
enum class GameType : uint8_t
-
class Tx
Contains enum and struct definitions specific to sending data to the referee serial class. Includes structure for sending different types of graphic messages.
Public Types
-
enum DeleteGraphicOperation
Graphic operations that can be passed to a delete graphic operation. Using this enum you can specify if you would like to delete a graphic layer (multiple graphics can be drawn on one of a number of layers) or delete all the graphics on the screen.
Values:
-
enumerator DELETE_GRAPHIC_NO_OP
Do nothing, no-op.
-
enumerator DELETE_GRAPHIC_LAYER
Delete a particular graphic layer (specified later on)
-
enumerator DELETE_ALL
Delete all graphic in all graphic layers.
-
enumerator DELETE_GRAPHIC_NO_OP
-
enum GraphicOperation
Graphic operations that can be passed in an add graphic operation.
Values:
-
enumerator GRAPHIC_NO_OP
Do nothing, no-op.
-
enumerator GRAPHIC_ADD
Add a new graphic. If the graphic has a unique id not already registered with the UI, the graphic will be uniquely added, otherwise the graphic with the same graphic ID will be replaced. If you have a graphic that is already drawn that you want to change, you should use GRAPHIC_MODIFY instead
-
enumerator GRAPHIC_MODIFY
Modify an existing graphic (by graphic ID). The graphic must already exist for this to work properly.
-
enumerator GRAPHIC_DELETE
Delete a particular graphic.
-
enumerator GRAPHIC_NO_OP
Public Static Functions
-
template<typename T>
static inline uint32_t getWaitTimeAfterGraphicSendMs(T*) Get the min wait time after which you can send more data to the client. Sending faster than this time may cause dropped packets.
Pass a pointer to some graphic message. For example, if you have a
Graphic1Message
calledmsg
, you can callgetWaitTimeAfterGraphicSendMs(&msg)
.- Template Parameters:
T – The type of the graphic message that was just been sent.
Public Static Attributes
-
static uint32_t MAX_TRANSMIT_SPEED_BYTES_PER_S = 1000
You cannot send messages faster than this speed to the referee system.
Source: https://bbs.robomaster.com/forum.php?mod=viewthread&tid=9120
Changed from 1280 to 1000 as the HUD was still unreliable.
-
struct DeleteGraphicLayerMessage
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
uint8_t deleteOperation
-
uint8_t layer
-
uint16_t crc16
-
DJISerial::FrameHeader frameHeader
-
struct Graphic1Message
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
GraphicData graphicData
-
uint16_t crc16
-
DJISerial::FrameHeader frameHeader
-
struct Graphic2Message
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
GraphicData graphicData[2]
-
uint16_t crc16
-
DJISerial::FrameHeader frameHeader
-
struct Graphic5Message
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
GraphicData graphicData[5]
-
uint16_t crc16
-
DJISerial::FrameHeader frameHeader
-
struct Graphic7Message
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
GraphicData graphicData[7]
-
uint16_t crc16
-
DJISerial::FrameHeader frameHeader
-
struct GraphicCharacterMessage
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
GraphicData graphicData
-
char msg[30]
-
uint16_t crc16
-
DJISerial::FrameHeader frameHeader
-
struct GraphicData
Public Members
-
uint8_t name[3]
-
uint32_t operation
-
uint32_t type
-
uint32_t layer
-
uint32_t color
-
uint32_t startAngle
-
uint32_t endAngle
-
uint32_t lineWidth
-
uint32_t startX
-
uint32_t startY
-
uint32_t radius
-
uint32_t endX
-
uint32_t endY
-
int32_t value
- union tap::communication::serial::RefSerialData::Tx::GraphicData
-
uint8_t name[3]
-
struct InteractiveHeader
Each graphic message has a graphic header inside of the message data.
-
struct RobotToRobotMessage
Public Members
-
DJISerial::FrameHeader frameHeader
-
uint16_t cmdId
-
InteractiveHeader interactiveHeader
-
uint8_t dataAndCRC16[115]
-
DJISerial::FrameHeader frameHeader
-
enum DeleteGraphicOperation
-
enum class RobotId : uint16_t