robot_message.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // Copyright 2019 FZI Forschungszentrum Informatik
5 // Created on behalf of Universal Robots A/S
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 // -- END LICENSE BLOCK ------------------------------------------------
19 
20 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
28 
29 #ifndef UR_CLIENT_LIBRARY_ROBOT_MESSAGE_H_INCLUDED
30 #define UR_CLIENT_LIBRARY_ROBOT_MESSAGE_H_INCLUDED
31 
33 
34 namespace urcl
35 {
36 namespace primary_interface
37 {
41 enum class RobotMessagePackageType : uint8_t
42 {
52 };
53 
58 {
59 public:
66  RobotMessage(const uint64_t timestamp, const uint8_t source) : timestamp_(timestamp), source_(source)
67  {
68  }
76  RobotMessage(const uint64_t timestamp, const int8_t source, const RobotMessagePackageType message_type)
77  : timestamp_(timestamp), source_(source), message_type_(message_type)
78  {
79  }
80  virtual ~RobotMessage() = default;
81 
90  virtual bool parseWith(comm::BinParser& bp);
91 
99  virtual bool consumeWith(AbstractPrimaryConsumer& consumer);
100 
106  virtual std::string toString() const;
107 
108  uint64_t timestamp_;
109  uint8_t source_;
111 };
112 
113 } // namespace primary_interface
114 } // namespace urcl
115 
116 #endif /* UR_CLIENT_LIBRARY_ROBOT_MESSAGE_H_INCLUDED */
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_REQUEST_VALUE
@ ROBOT_MESSAGE_REQUEST_VALUE
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_ERROR_CODE
@ ROBOT_MESSAGE_ERROR_CODE
urcl::primary_interface::RobotMessage::timestamp_
uint64_t timestamp_
Definition: robot_message.h:108
urcl::primary_interface::RobotMessagePackageType
RobotMessagePackageType
Possible RobotMessage types.
Definition: robot_message.h:41
urcl::primary_interface::RobotMessage::message_type_
RobotMessagePackageType message_type_
Definition: robot_message.h:110
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_RUNTIME_EXCEPTION
@ ROBOT_MESSAGE_RUNTIME_EXCEPTION
urcl
Definition: bin_parser.h:36
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_VERSION
@ ROBOT_MESSAGE_VERSION
urcl::primary_interface::RobotMessage
The RobotMessage class is a parent class for the different received robot messages.
Definition: robot_message.h:57
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_PROGRAM_LABEL
@ ROBOT_MESSAGE_PROGRAM_LABEL
primary_package.h
urcl::primary_interface::RobotMessage::RobotMessage
RobotMessage(const uint64_t timestamp, const uint8_t source)
Creates a new RobotMessage object to be filled from a package.
Definition: robot_message.h:66
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_KEY
@ ROBOT_MESSAGE_KEY
urcl::primary_interface::RobotMessage::consumeWith
virtual bool consumeWith(AbstractPrimaryConsumer &consumer)
Consume this package with a specific consumer.
Definition: robot_message.cpp:40
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_SAFETY_MODE
@ ROBOT_MESSAGE_SAFETY_MODE
urcl::primary_interface::RobotMessagePackageType::ROBOT_MESSAGE_TEXT
@ ROBOT_MESSAGE_TEXT
urcl::primary_interface::RobotMessage::source_
uint8_t source_
Definition: robot_message.h:109
urcl::primary_interface::RobotMessagePackageType::PROGRAM_STATE_MESSAGE_VARIABLE_UPDATE
@ PROGRAM_STATE_MESSAGE_VARIABLE_UPDATE
urcl::primary_interface::RobotMessage::toString
virtual std::string toString() const
Produces a human readable representation of the package object.
Definition: robot_message.cpp:45
urcl::primary_interface::RobotMessage::~RobotMessage
virtual ~RobotMessage()=default
urcl::primary_interface::RobotMessage::parseWith
virtual bool parseWith(comm::BinParser &bp)
Sets the attributes of the package by parsing a serialized representation of the package.
Definition: robot_message.cpp:35
urcl::comm::BinParser
The BinParser class handles a byte buffer and functionality to iteratively parse the content.
Definition: bin_parser.h:44
urcl::primary_interface::RobotMessage::RobotMessage
RobotMessage(const uint64_t timestamp, const int8_t source, const RobotMessagePackageType message_type)
Creates a new RobotMessage object to be filled from a package.
Definition: robot_message.h:76
urcl::primary_interface::PrimaryPackage
The PrimaryPackage is solely an abstraction level. It inherits form the URPackage and is also a paren...
Definition: primary_package.h:46
urcl::primary_interface::AbstractPrimaryConsumer
Base consumer for primary packages.
Definition: abstract_primary_consumer.h:50


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