include
ur_client_library
primary
primary/package_header.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
//----------------------------------------------------------------------
28
//----------------------------------------------------------------------
29
30
#ifndef UR_CLIENT_LIBRARY_PRIMARY_INTERFACE_H_INCLUDED
31
#define UR_CLIENT_LIBRARY_PRIMARY_INTERFACE_H_INCLUDED
32
33
#include <inttypes.h>
34
#include <cstddef>
35
#include <endian.h>
36
#include "
ur_client_library/types.h
"
37
38
namespace
urcl
39
{
40
namespace
primary_interface
41
{
42
static
const
int
UR_PRIMARY_PORT
= 30001;
43
static
const
int
UR_SECONDARY_PORT
= 30002;
47
enum class
RobotPackageType
: int8_t
48
{
49
DISCONNECT
= -1,
50
ROBOT_STATE
= 16,
51
ROBOT_MESSAGE
= 20,
52
HMC_MESSAGE
= 22,
53
MODBUS_INFO_MESSAGE
= 5,
54
SAFETY_SETUP_BROADCAST_MESSAGE
= 23,
55
SAFETY_COMPLIANCE_TOLERANCES_MESSAGE
= 24,
56
PROGRAM_STATE_MESSAGE
= 25
57
};
58
62
class
PackageHeader
63
{
64
public
:
65
PackageHeader
() =
default
;
66
virtual
~
PackageHeader
() =
default
;
67
68
using
_package_size_type
= int32_t;
69
77
static
size_t
getPackageLength
(uint8_t* buf)
78
{
79
return
be32toh(*(reinterpret_cast<_package_size_type*>(buf)));
80
}
81
};
82
}
// namespace primary_interface
83
}
// namespace urcl
84
85
#endif // ifndef UR_CLIENT_LIBRARY_PRIMARY_INTERFACE_H_INCLUDED
types.h
urcl::primary_interface::PackageHeader
This class represents the header for primary packages.
Definition:
primary/package_header.h:62
urcl::primary_interface::RobotPackageType::DISCONNECT
urcl::primary_interface::RobotPackageType::ROBOT_STATE
urcl::primary_interface::PackageHeader::_package_size_type
int32_t _package_size_type
Definition:
primary/package_header.h:68
urcl::primary_interface::RobotPackageType::SAFETY_SETUP_BROADCAST_MESSAGE
urcl
Definition:
bin_parser.h:36
urcl::primary_interface::RobotPackageType::ROBOT_MESSAGE
urcl::primary_interface::PackageHeader::getPackageLength
static size_t getPackageLength(uint8_t *buf)
Reads a buffer, interpreting the next bytes as the size of the contained package. ...
Definition:
primary/package_header.h:77
urcl::primary_interface::UR_SECONDARY_PORT
static const int UR_SECONDARY_PORT
Definition:
primary/package_header.h:43
urcl::primary_interface::RobotPackageType::SAFETY_COMPLIANCE_TOLERANCES_MESSAGE
urcl::primary_interface::RobotPackageType::PROGRAM_STATE_MESSAGE
urcl::primary_interface::RobotPackageType
RobotPackageType
Possible RobotPackage types.
Definition:
primary/package_header.h:47
urcl::primary_interface::RobotPackageType::HMC_MESSAGE
urcl::primary_interface::RobotPackageType::MODBUS_INFO_MESSAGE
urcl::primary_interface::UR_PRIMARY_PORT
static const int UR_PRIMARY_PORT
Definition:
primary/package_header.h:42
ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Tue Jul 4 2023 02:09:47