Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::communication::serial::RefSerialData::Tx Class Reference

#include <ref_serial_data.hpp>

Collaboration diagram for tap::communication::serial::RefSerialData::Tx:

Classes

struct  DeleteGraphicLayerMessage
 
struct  Graphic1Message
 
struct  Graphic2Message
 
struct  Graphic5Message
 
struct  Graphic7Message
 
struct  GraphicCharacterMessage
 
struct  GraphicData
 
struct  InteractiveHeader
 
struct  RobotToRobotMessage
 

Public Types

enum  DeleteGraphicOperation { DELETE_GRAPHIC_NO_OP = 0 , DELETE_GRAPHIC_LAYER = 1 , DELETE_ALL = 2 }
 
enum  GraphicOperation { GRAPHIC_NO_OP = 0 , GRAPHIC_ADD = 1 , GRAPHIC_MODIFY = 2 , GRAPHIC_DELETE = 3 }
 Graphic operations that can be passed in an add graphic operation. More...
 
enum class  GraphicType : uint8_t {
  STRAIGHT_LINE = 0 , RECTANGLE = 1 , CIRCLE = 2 , ELLIPSE = 3 ,
  ARC = 4 , FLOATING_NUM = 5 , INTEGER = 6 , CHARACTER = 7
}
 The type of graphic being drawn (some geometry, or a string/number) More...
 
enum class  GraphicColor : uint8_t {
  RED_AND_BLUE = 0 , YELLOW = 1 , GREEN = 2 , ORANGE = 3 ,
  PURPLISH_RED = 4 , PINK = 5 , CYAN = 6 , BLACK = 7 ,
  WHITE = 8
}
 The color of the graphic being drawn. More...
 

Static Public Member Functions

template<typename T >
static constexpr uint32_t getWaitTimeAfterGraphicSendMs (T *)
 

Public Attributes

struct tap::communication::serial::RefSerialData::Tx::InteractiveHeader modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::GraphicData modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::DeleteGraphicLayerMessage modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::Graphic1Message modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::RobotToRobotMessage modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::Graphic2Message modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::Graphic5Message modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::Graphic7Message modm_packed
 
struct tap::communication::serial::RefSerialData::Tx::GraphicCharacterMessage modm_packed
 

Static Public Attributes

static constexpr uint32_t MAX_TRANSMIT_SPEED_BYTES_PER_S = 1000
 

Detailed Description

Contains enum and struct definitions specific to sending data to the referee serial class. Includes structure for sending different types of graphic messages.

Member Enumeration Documentation

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

Enumerator
DELETE_GRAPHIC_NO_OP 

Do nothing, no-op.

DELETE_GRAPHIC_LAYER 

Delete a particular graphic layer (specified later on)

DELETE_ALL 

Delete all graphic in all graphic layers.

◆ GraphicColor

The color of the graphic being drawn.

Enumerator
RED_AND_BLUE 
YELLOW 
GREEN 
ORANGE 
PURPLISH_RED 
PINK 
CYAN 
BLACK 
WHITE 

◆ GraphicOperation

Graphic operations that can be passed in an add graphic operation.

Enumerator
GRAPHIC_NO_OP 

Do nothing, no-op.

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

GRAPHIC_MODIFY 

Modify an existing graphic (by graphic ID). The graphic must already exist for this to work properly.

GRAPHIC_DELETE 

Delete a particular graphic.

◆ GraphicType

The type of graphic being drawn (some geometry, or a string/number)

Enumerator
STRAIGHT_LINE 
RECTANGLE 
CIRCLE 
ELLIPSE 
ARC 
FLOATING_NUM 
INTEGER 
CHARACTER 

Member Function Documentation

◆ getWaitTimeAfterGraphicSendMs()

template<typename T >
static constexpr uint32_t tap::communication::serial::RefSerialData::Tx::getWaitTimeAfterGraphicSendMs ( T *  )
inlinestaticconstexpr

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 called msg, you can call getWaitTimeAfterGraphicSendMs(&msg).

Template Parameters
TThe type of the graphic message that was just been sent.
Todo:
Deprecated:

Member Data Documentation

◆ MAX_TRANSMIT_SPEED_BYTES_PER_S

constexpr uint32_t tap::communication::serial::RefSerialData::Tx::MAX_TRANSMIT_SPEED_BYTES_PER_S = 1000
staticconstexpr

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.

◆ modm_packed [1/9]

struct tap::communication::serial::RefSerialData::Tx::InteractiveHeader tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [2/9]

struct tap::communication::serial::RefSerialData::Tx::GraphicData tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [3/9]

struct tap::communication::serial::RefSerialData::Tx::DeleteGraphicLayerMessage tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [4/9]

struct tap::communication::serial::RefSerialData::Tx::Graphic1Message tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [5/9]

struct tap::communication::serial::RefSerialData::Tx::RobotToRobotMessage tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [6/9]

struct tap::communication::serial::RefSerialData::Tx::Graphic2Message tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [7/9]

struct tap::communication::serial::RefSerialData::Tx::Graphic5Message tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [8/9]

struct tap::communication::serial::RefSerialData::Tx::Graphic7Message tap::communication::serial::RefSerialData::Tx::modm_packed

◆ modm_packed [9/9]

struct tap::communication::serial::RefSerialData::Tx::GraphicCharacterMessage tap::communication::serial::RefSerialData::Tx::modm_packed

The documentation for this class was generated from the following file: