Go to the documentation of this file.
29 #ifndef UR_CLIENT_LIBRARY_DATA_PACKAGE_H_INCLUDED
30 #define UR_CLIENT_LIBRARY_DATA_PACKAGE_H_INCLUDED
32 #include <unordered_map>
41 namespace rtde_interface
81 DataPackage(
const std::vector<std::string>& recipe,
const uint16_t& protocol_version = 2)
106 virtual std::string
toString()
const;
127 template <
typename T>
132 val = std::get<T>(
data_[name]);
151 template <
typename T,
size_t N>
152 bool getData(
const std::string& name, std::bitset<N>& val)
154 static_assert(
sizeof(T) * 8 >= N,
"Bitset is too large for underlying variable");
158 val = std::bitset<N>(std::get<T>(
data_[name]));
177 template <
typename T>
203 static std::unordered_map<std::string, _rtde_type_variant>
g_type_list;
205 std::unordered_map<std::string, _rtde_type_variant>
data_;
213 #endif // ifndef UR_CLIENT_LIBRARY_DATA_PACKAGE_H_INCLUDED
virtual std::string toString() const
Produces a human readable representation of the package object.
virtual bool parseWith(comm::BinParser &bp)
Sets the attributes of the package by parsing a serialized representation of the package.
void setRecipeID(const uint8_t &recipe_id)
Setter of the recipe id value used to identify the used recipe to the robot.
The DataPackage class handles communication in the form of RTDE data packages both to and from the ro...
RUNTIME_STATE
Possible values for the runtime state.
DataPackage(const std::vector< std::string > &recipe, const uint16_t &protocol_version=2)
Creates a new DataPackage object, based on a given recipe.
std::vector< std::string > recipe_
std::array< double, 6 > vector6d_t
bool setData(const std::string &name, T &val)
Set a data field in the DataPackage.
uint16_t protocol_version_
std::variant< bool, uint8_t, uint32_t, uint64_t, int32_t, double, vector3d_t, vector6d_t, vector6int32_t, vector6uint32_t, std::string > _rtde_type_variant
std::array< uint32_t, 6 > vector6uint32_t
DataPackage(const DataPackage &other)
std::array< int32_t, 6 > vector6int32_t
bool getData(const std::string &name, T &val)
Get a data field from the DataPackage.
virtual ~DataPackage()=default
PackageType
Possible package types.
size_t serializePackage(uint8_t *buffer)
Serializes the package.
std::unordered_map< std::string, _rtde_type_variant > data_
static std::unordered_map< std::string, _rtde_type_variant > g_type_list
std::array< double, 3 > vector3d_t
The BinParser class handles a byte buffer and functionality to iteratively parse the content.
void initEmpty()
Initializes to contained list with empty values based on the recipe.
bool getData(const std::string &name, std::bitset< N > &val)
Get a data field from the DataPackage as bitset.
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