Go to the documentation of this file.
37 namespace primary_interface
62 bp.
parse(packet_size);
73 URCL_LOG_ERROR(
"Failed to read sub-package length, there's likely a parsing error");
76 uint32_t sub_size = bp.
peek<uint32_t>();
77 if (!bp.
checkSize(
static_cast<size_t>(sub_size)))
79 URCL_LOG_WARN(
"Invalid sub-package size of %" PRIu32
" received!", sub_size);
91 if (packet ==
nullptr)
99 if (!packet->parseWith(sbp))
101 URCL_LOG_ERROR(
"Sub-package parsing of type %d failed!",
static_cast<int>(type));
105 results.push_back(std::move(packet));
109 URCL_LOG_ERROR(
"Sub-package of type %d was not parsed completely!",
static_cast<int>(type));
126 bp.
parse(message_type);
128 std::unique_ptr<PrimaryPackage> packet(
messageFromType(message_type, timestamp, source));
129 if (!packet->parseWith(bp))
131 URCL_LOG_ERROR(
"Package parsing of type %d failed!",
static_cast<int>(message_type));
135 results.push_back(std::move(packet));
142 URCL_LOG_DEBUG(
"Invalid robot package type recieved: %u",
static_cast<uint8_t
>(type));
@ ROBOT_MESSAGE_ERROR_CODE
RobotMessage * messageFromType(RobotMessagePackageType type, uint64_t timestamp, uint8_t source)
T peek()
Parses the next bytes as given type without moving the buffer pointer.
The ErrorCodeMessage class handles the error code messages sent via the primary UR interface.
This messages contains data about the mode of the robot.
RobotMessagePackageType
Possible RobotMessage types.
virtual ~PrimaryParser()=default
#define URCL_LOG_ERROR(...)
The RobotMessage class is a parent class for the different received robot messages.
The parser is a general paser. The namsepace rtde_interface and primary_interface both iclude classes...
#define URCL_LOG_DEBUG(...)
The primary specific parser. Interprets a given byte stream as serialized primary packages and parses...
The ConfigurationData class handles the configuration data sent via the primary UR interface.
bool empty()
Checks if no unparsed bytes remain in the buffer.
void consume()
Sets the current buffer position to the end of the buffer, finishing parsing.
bool parse(comm::BinParser &bp, std::vector< std::unique_ptr< PrimaryPackage >> &results)
Uses the given BinParser to create package objects from the contained serialization.
bool checkSize(size_t bytes)
Checks if at least a given number of bytes is still remaining unparsed in the buffer.
The VersionMessage class handles the version messages sent via the primary UR interface.
RobotPackageType
Possible RobotPackage types.
RobotStateType
Possible RobotState types.
RobotState * stateFromType(RobotStateType type)
#define URCL_LOG_WARN(...)
Base class for a RobotState data packages will be used directly.
void parse(T &val)
Parses the next bytes as given type.
The BinParser class handles a byte buffer and functionality to iteratively parse the content.
This messages contains information about the robot's calibration. The DH parameters are a combination...
void debug()
Logs debugging information about the BinParser object.
ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Mon May 26 2025 02:35:58