Main Page
Namespaces
Classes
Files
File List
File Members
include
ur_client_library
ur
datatypes.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
// Copyright 2015, 2016 Thomas Timm Andersen (original version)
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
#include <
ur_client_library/types.h
>
31
32
namespace
urcl
33
{
34
enum class
RobotMode
: int8_t
35
{
36
UNKNOWN
= -128,
// This is not defined by UR but only inside this driver
37
NO_CONTROLLER
= -1,
38
DISCONNECTED
= 0,
39
CONFIRM_SAFETY
= 1,
40
BOOTING
= 2,
41
POWER_OFF
= 3,
42
POWER_ON
= 4,
43
IDLE
= 5,
44
BACKDRIVE
= 6,
45
RUNNING
= 7,
46
UPDATING_FIRMWARE
= 8
47
};
48
49
enum class
SafetyMode
: int8_t
50
{
51
NORMAL
= 1,
52
REDUCED
= 2,
53
PROTECTIVE_STOP
= 3,
54
RECOVERY
= 4,
55
SAFEGUARD_STOP
= 5,
56
SYSTEM_EMERGENCY_STOP
= 6,
57
ROBOT_EMERGENCY_STOP
= 7,
58
VIOLATION
= 8,
59
FAULT
= 9,
60
VALIDATE_JOINT_ID
= 10,
61
UNDEFINED_SAFETY_MODE
= 11
62
};
63
64
enum class
SafetyStatus
: int8_t
// Only available on 3.10/5.4
65
{
66
NORMAL
= 1,
67
REDUCED
= 2,
68
PROTECTIVE_STOP
= 3,
69
RECOVERY
= 4,
70
SAFEGUARD_STOP
= 5,
71
SYSTEM_EMERGENCY_STOP
= 6,
72
ROBOT_EMERGENCY_STOP
= 7,
73
VIOLATION
= 8,
74
FAULT
= 9,
75
VALIDATE_JOINT_ID
= 10,
76
UNDEFINED_SAFETY_MODE
= 11,
77
AUTOMATIC_MODE_SAFEGUARD_STOP
= 12,
78
SYSTEM_THREE_POSITION_ENABLING_STOP
= 13
79
};
80
81
inline
std::string
robotModeString
(
const
RobotMode
& mode)
82
{
83
switch
(mode)
84
{
85
case
RobotMode::NO_CONTROLLER
:
86
return
"NO_CONTROLLER"
;
87
case
RobotMode::DISCONNECTED
:
88
return
"DISCONNECTED"
;
89
case
RobotMode::CONFIRM_SAFETY
:
90
return
"CONFIRM_SAFETY"
;
91
case
RobotMode::BOOTING
:
92
return
"BOOTING"
;
93
case
RobotMode::POWER_OFF
:
94
return
"POWER_OFF"
;
95
case
RobotMode::POWER_ON
:
96
return
"POWER_ON"
;
97
case
RobotMode::IDLE
:
98
return
"IDLE"
;
99
case
RobotMode::BACKDRIVE
:
100
return
"BACKDRIVE"
;
101
case
RobotMode::RUNNING
:
102
return
"RUNNING"
;
103
case
RobotMode::UPDATING_FIRMWARE
:
104
return
"UPDATING_FIRMWARE"
;
105
default
:
106
std::stringstream ss;
107
ss <<
"Unknown robot mode: "
<<
static_cast<
int
>
(mode);
108
throw
std::invalid_argument(ss.str());
109
}
110
}
111
112
inline
std::string
safetyModeString
(
const
SafetyMode
& mode)
113
{
114
switch
(mode)
115
{
116
case
SafetyMode::NORMAL
:
117
return
"NORMAL"
;
118
case
SafetyMode::REDUCED
:
119
return
"REDUCED"
;
120
case
SafetyMode::PROTECTIVE_STOP
:
121
return
"PROTECTIVE_STOP"
;
122
case
SafetyMode::RECOVERY
:
123
return
"RECOVERY"
;
124
case
SafetyMode::SAFEGUARD_STOP
:
125
return
"SAFEGUARD_STOP"
;
126
case
SafetyMode::SYSTEM_EMERGENCY_STOP
:
127
return
"SYSTEM_EMERGENCY_STOP"
;
128
case
SafetyMode::ROBOT_EMERGENCY_STOP
:
129
return
"ROBOT_EMERGENCY_STOP"
;
130
case
SafetyMode::VIOLATION
:
131
return
"VIOLATION"
;
132
case
SafetyMode::FAULT
:
133
return
"FAULT"
;
134
case
SafetyMode::VALIDATE_JOINT_ID
:
135
return
"VALIDATE_JOINT_ID"
;
136
case
SafetyMode::UNDEFINED_SAFETY_MODE
:
137
return
"UNDEFINED_SAFETY_MODE"
;
138
default
:
139
std::stringstream ss;
140
ss <<
"Unknown safety mode: "
<<
static_cast<
int
>
(mode);
141
throw
std::invalid_argument(ss.str());
142
}
143
}
144
145
inline
std::string
safetyStatusString
(
const
SafetyStatus
& status)
146
{
147
switch
(status)
148
{
149
case
SafetyStatus::NORMAL
:
150
return
"NORMAL"
;
151
case
SafetyStatus::REDUCED
:
152
return
"REDUCED"
;
153
case
SafetyStatus::PROTECTIVE_STOP
:
154
return
"PROTECTIVE_STOP"
;
155
case
SafetyStatus::RECOVERY
:
156
return
"RECOVERY"
;
157
case
SafetyStatus::SAFEGUARD_STOP
:
158
return
"SAFEGUARD_STOP"
;
159
case
SafetyStatus::SYSTEM_EMERGENCY_STOP
:
160
return
"SYSTEM_EMERGENCY_STOP"
;
161
case
SafetyStatus::ROBOT_EMERGENCY_STOP
:
162
return
"ROBOT_EMERGENCY_STOP"
;
163
case
SafetyStatus::VIOLATION
:
164
return
"VIOLATION"
;
165
case
SafetyStatus::FAULT
:
166
return
"FAULT"
;
167
case
SafetyStatus::VALIDATE_JOINT_ID
:
168
return
"VALIDATE_JOINT_ID"
;
169
case
SafetyStatus::UNDEFINED_SAFETY_MODE
:
170
return
"UNDEFINED_SAFETY_MODE"
;
171
case
SafetyStatus::AUTOMATIC_MODE_SAFEGUARD_STOP
:
172
return
"AUTOMATIC_MODE_SAFEGUARD_STOP"
;
173
case
SafetyStatus::SYSTEM_THREE_POSITION_ENABLING_STOP
:
174
return
"SYSTEM_THREE_POSITION_ENABLING_STOP"
;
175
default
:
176
std::stringstream ss;
177
ss <<
"Unknown safety status: "
<<
static_cast<
int
>
(status);
178
throw
std::invalid_argument(ss.str());
179
}
180
}
181
}
// namespace urcl
urcl::RobotMode
RobotMode
Definition:
datatypes.h:34
urcl::SafetyMode::SYSTEM_EMERGENCY_STOP
urcl::SafetyMode::VIOLATION
urcl::SafetyMode::SAFEGUARD_STOP
types.h
urcl::RobotMode::NO_CONTROLLER
urcl::RobotMode::POWER_ON
urcl::SafetyMode::VALIDATE_JOINT_ID
urcl::RobotMode::BOOTING
urcl::SafetyMode::REDUCED
urcl::RobotMode::CONFIRM_SAFETY
urcl::SafetyMode::FAULT
urcl::RobotMode::BACKDRIVE
urcl::RobotMode::POWER_OFF
urcl::SafetyMode::RECOVERY
urcl::RobotMode::UPDATING_FIRMWARE
urcl::SafetyMode::UNDEFINED_SAFETY_MODE
urcl::safetyStatusString
std::string safetyStatusString(const SafetyStatus &status)
Definition:
datatypes.h:145
urcl::RobotMode::RUNNING
urcl::SafetyStatus::AUTOMATIC_MODE_SAFEGUARD_STOP
urcl::robotModeString
std::string robotModeString(const RobotMode &mode)
Definition:
datatypes.h:81
urcl::SafetyStatus
SafetyStatus
Definition:
datatypes.h:64
urcl::RobotMode::UNKNOWN
urcl::RobotMode::DISCONNECTED
urcl::SafetyMode
SafetyMode
Definition:
datatypes.h:49
urcl::SafetyMode::PROTECTIVE_STOP
urcl::safetyModeString
std::string safetyModeString(const SafetyMode &mode)
Definition:
datatypes.h:112
urcl::SafetyMode::ROBOT_EMERGENCY_STOP
urcl::SafetyMode::NORMAL
urcl::RobotMode::IDLE
urcl
Definition:
bin_parser.h:36
urcl::SafetyStatus::SYSTEM_THREE_POSITION_ENABLING_STOP
ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Sun May 9 2021 02:16:26