Class RefSerialData::Rx

Nested Relationships

This class is a nested type of Class RefSerialData.

Nested Types

Class Documentation

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.

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.

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.

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.

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.

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.

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).

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.

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
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.

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
enum BulletType

Values:

enumerator AMMO_17

17 mm projectile ammo.

enumerator AMMO_42

42 mm projectile ammo.

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

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.

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.

using SiteData_t = modm::Flags32<SiteData>
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.

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).

struct DamageEvent

Public Members

uint16_t damageAmount

Amount of damage received.

uint32_t timestampMs

Time when damage was received (in milliseconds).

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.

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.

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.

struct GameData

Public Members

GameType gameType

Current type of competition the robot is taking part in.

GameStage gameStage

Current stage in the game.

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.

EventData eventData

Data about the current event.

SupplierAction supplier

Data about the projectile supplier.

DartInfo dartInfo

Data about the dart launcher.

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.

RadarInfo radar

Information about the radar station.

struct GroundRobotPositions

Public Members

RobotPosition hero
RobotPosition engineer
RobotPosition standard3
RobotPosition standard4
RobotPosition standard5
struct RadarInfo

Public Members

uint8_t availableDoubleVulnerablilityEffects

The number of remaining effects.

bool activeDoubleVulnerabilityEffect

True when the effect is active.

struct RadarMarkProgress

Mark progress of different robots. Values range from 0 to 120.

Public Members

uint8_t hero
uint8_t engineer
uint8_t standard3
uint8_t standard4
uint8_t standard5
uint8_t sentry
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.

Public Members

uint8_t level

The level of the wraning. 1: Yellow card 2: Red card 3: Forfeiture

RobotId foulRobotID

The robot that received the referee warning.

uint8_t count

The number of violations triggered by the robot.

uint32_t lastReceivedWarningRobotTime = 0

Last time (in milliseconds) that a warning was received.

Public Static Attributes

static uint32_t OFFENDING_OPERATOR_BLIND_TIME = 5'000

time in ms that the user will be blinded for when the operator is the offender

static uint32_t NONOFFENDING_OPERATOR_BLIND_TIME = 2'000

time in ms that the user will be blinded for when the operator is not the offender

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%.

struct RobotData

Public Members

RobotId robotId

Robot type and team.

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.

ArmorId damagedArmorId

Armor ID that was damaged.

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

struct RobotHpData

Current HP of all robots

Public Members

RobotHp red
RobotHp blue
struct RobotHp

Public Members

uint16_t hero1
uint16_t engineer2
uint16_t standard3
uint16_t standard4
uint16_t standard5
uint16_t sentry7
uint16_t outpost
uint16_t base
struct RobotPosition

Robot position information.

Public Members

float x

The x location in meters.

float y

The y location in meters.

struct SentryInfo

Public Members

uint16_t projectileAllowance

Allocated projectiles not including remote exchange.

uint8_t remoteProjectileExchanges

The number of remote projectile exchanges taken.

uint8_t remoteHealthExchanges

The number of remote health exchanges taken.

struct SupplierAction

Information about the projectile supplier.

Public Members

RobotId reloadingRobot

The id of the reloading robot.

SupplierOutletStatus outletStatus

The current state of the supplier outlet.

uint8_t suppliedProjectiles

The number of projectiles suppied.

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