Main Page
Namespaces
Classes
Files
File List
File Members
include
ur_modern_driver
ur
robot_mode.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017, 2018 Simon Rasmussen (refactor)
3
*
4
* Copyright 2015, 2016 Thomas Timm Andersen (original version)
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
19
#pragma once
20
21
#include <inttypes.h>
22
#include <cstddef>
23
#include "
ur_modern_driver/bin_parser.h
"
24
#include "
ur_modern_driver/types.h
"
25
#include "
ur_modern_driver/ur/state.h
"
26
27
class
SharedRobotModeData
28
{
29
public
:
30
virtual
bool
parseWith
(
BinParser
& bp);
31
32
uint64_t
timestamp
;
33
bool
physical_robot_connected
;
34
bool
real_robot_enabled
;
35
bool
robot_power_on
;
36
bool
emergency_stopped
;
37
bool
protective_stopped
;
// AKA security_stopped
38
bool
program_running
;
39
bool
program_paused
;
40
41
static
const
size_t
SIZE
=
sizeof
(uint64_t) +
sizeof
(uint8_t) * 6;
42
};
43
44
enum class
robot_mode_V1_X
: uint8_t
45
{
46
ROBOT_RUNNING_MODE
= 0,
47
ROBOT_FREEDRIVE_MODE
= 1,
48
ROBOT_READY_MODE
= 2,
49
ROBOT_INITIALIZING_MODE
= 3,
50
ROBOT_SECURITY_STOPPED_MODE
= 4,
51
ROBOT_EMERGENCY_STOPPED_MODE
= 5,
52
ROBOT_FATAL_ERROR_MODE
= 6,
53
ROBOT_NO_POWER_MODE
= 7,
54
ROBOT_NOT_CONNECTED_MODE
= 8,
55
ROBOT_SHUTDOWN_MODE
= 9,
56
ROBOT_SAFEGUARD_STOP_MODE
= 10
57
};
58
59
class
RobotModeData_V1_X
:
public
SharedRobotModeData
,
public
StatePacket
60
{
61
public
:
62
virtual
bool
parseWith
(
BinParser
& bp);
63
virtual
bool
consumeWith(
URStatePacketConsumer
& consumer);
64
65
robot_mode_V1_X
robot_mode
;
66
double
speed_fraction
;
67
68
static
const
size_t
SIZE =
SharedRobotModeData::SIZE
+
sizeof
(uint8_t) +
sizeof
(
robot_mode_V1_X
) +
sizeof
(double);
69
70
static_assert(
RobotModeData_V1_X::SIZE
== 24,
"RobotModeData_V1_X has missmatched size"
);
71
};
72
73
enum class
robot_mode_V3_X
: uint8_t
74
{
75
DISCONNECTED
= 0,
76
CONFIRM_SAFETY
= 1,
77
BOOTING
= 2,
78
POWER_OFF
= 3,
79
POWER_ON
= 4,
80
IDLE
= 5,
81
BACKDRIVE
= 6,
82
RUNNING
= 7,
83
UPDATING_FIRMWARE
= 8
84
};
85
86
enum class
robot_control_mode_V3_X
: uint8_t
87
{
88
POSITION
= 0,
89
TEACH
= 1,
90
FORCE
= 2,
91
TORQUE
= 3
92
};
93
94
class
RobotModeData_V3_0__1
:
public
SharedRobotModeData
,
public
StatePacket
95
{
96
public
:
97
virtual
bool
parseWith
(
BinParser
& bp);
98
virtual
bool
consumeWith(
URStatePacketConsumer
& consumer);
99
100
robot_mode_V3_X
robot_mode
;
101
robot_control_mode_V3_X
control_mode
;
102
103
double
target_speed_fraction
;
104
double
speed_scaling
;
105
106
static
const
size_t
SIZE =
SharedRobotModeData::SIZE
+
sizeof
(uint8_t) +
sizeof
(
robot_mode_V3_X
) +
107
sizeof
(
robot_control_mode_V3_X
) +
sizeof
(
double
) +
sizeof
(double);
108
109
static_assert(
RobotModeData_V3_0__1::SIZE
== 33,
"RobotModeData_V3_0__1 has missmatched size"
);
110
};
111
112
class
RobotModeData_V3_2
:
public
RobotModeData_V3_0__1
113
{
114
public
:
115
virtual
bool
parseWith
(
BinParser
& bp);
116
virtual
bool
consumeWith(
URStatePacketConsumer
& consumer);
117
118
double
target_speed_fraction_limit
;
119
120
static
const
size_t
SIZE =
RobotModeData_V3_0__1::SIZE
+
sizeof
(double);
121
122
static_assert(
RobotModeData_V3_2::SIZE
== 41,
"RobotModeData_V3_2 has missmatched size"
);
123
};
124
125
class
RobotModeData_V3_5
:
public
RobotModeData_V3_2
126
{
127
public
:
128
virtual
bool
parseWith
(
BinParser
& bp);
129
virtual
bool
consumeWith(
URStatePacketConsumer
& consumer);
130
131
unsigned
char
unknown_internal_use
;
132
133
static
const
size_t
SIZE =
RobotModeData_V3_2::SIZE
+
sizeof
(
unsigned
char);
134
135
static_assert(
RobotModeData_V3_5::SIZE
== 42,
"RobotModeData_V3_5 has missmatched size"
);
136
};
SharedRobotModeData::parseWith
virtual bool parseWith(BinParser &bp)
Definition:
src/ur/robot_mode.cpp:22
RobotModeData_V1_X::speed_fraction
double speed_fraction
Definition:
robot_mode.h:66
RobotModeData_V3_0__1::speed_scaling
double speed_scaling
Definition:
robot_mode.h:104
types.h
SharedRobotModeData::timestamp
uint64_t timestamp
Definition:
robot_mode.h:32
robot_mode_V1_X::ROBOT_NO_POWER_MODE
SharedRobotModeData::robot_power_on
bool robot_power_on
Definition:
robot_mode.h:35
RobotModeData_V1_X
Definition:
robot_mode.h:59
RobotModeData_V3_0__1::target_speed_fraction
double target_speed_fraction
Definition:
robot_mode.h:103
RobotModeData_V3_5
Definition:
robot_mode.h:125
SharedRobotModeData::program_running
bool program_running
Definition:
robot_mode.h:38
SharedRobotModeData::emergency_stopped
bool emergency_stopped
Definition:
robot_mode.h:36
SharedRobotModeData::program_paused
bool program_paused
Definition:
robot_mode.h:39
RobotModeData_V3_0__1::robot_mode
robot_mode_V3_X robot_mode
Definition:
robot_mode.h:100
robot_mode_V1_X::ROBOT_SHUTDOWN_MODE
robot_mode_V3_X::POWER_ON
robot_mode_V3_X::UPDATING_FIRMWARE
bin_parser.h
StatePacket
Definition:
state.h:50
robot_mode_V1_X::ROBOT_READY_MODE
SharedRobotModeData
Definition:
robot_mode.h:27
robot_mode_V1_X::ROBOT_INITIALIZING_MODE
RobotModeData_V3_2::SIZE
static const size_t SIZE
Definition:
robot_mode.h:120
robot_mode_V1_X::ROBOT_FREEDRIVE_MODE
robot_mode_V3_X::RUNNING
RobotModeData_V3_0__1::control_mode
robot_control_mode_V3_X control_mode
Definition:
robot_mode.h:101
SharedRobotModeData::real_robot_enabled
bool real_robot_enabled
Definition:
robot_mode.h:34
RobotModeData_V3_2::target_speed_fraction_limit
double target_speed_fraction_limit
Definition:
robot_mode.h:118
BinParser
Definition:
bin_parser.h:32
robot_control_mode_V3_X::TORQUE
RobotModeData_V3_0__1
Definition:
robot_mode.h:94
SharedRobotModeData::SIZE
static const size_t SIZE
Definition:
robot_mode.h:41
robot_control_mode_V3_X::POSITION
robot_mode_V3_X::IDLE
robot_mode_V1_X::ROBOT_SECURITY_STOPPED_MODE
RobotModeData_V1_X::robot_mode
robot_mode_V1_X robot_mode
Definition:
robot_mode.h:65
SharedRobotModeData::protective_stopped
bool protective_stopped
Definition:
robot_mode.h:37
robot_mode_V3_X::CONFIRM_SAFETY
robot_mode_V3_X::POWER_OFF
robot_mode_V3_X
robot_mode_V3_X
Definition:
robot_mode.h:73
robot_mode_V1_X::ROBOT_SAFEGUARD_STOP_MODE
robot_mode_V1_X::ROBOT_RUNNING_MODE
robot_mode_V1_X::ROBOT_EMERGENCY_STOPPED_MODE
state.h
RobotModeData_V3_0__1::SIZE
static const size_t SIZE
Definition:
robot_mode.h:106
RobotModeData_V1_X::SIZE
static const size_t SIZE
Definition:
robot_mode.h:68
robot_control_mode_V3_X::FORCE
robot_mode_V3_X::BOOTING
RobotModeData_V3_2
Definition:
robot_mode.h:112
robot_mode_V1_X::ROBOT_FATAL_ERROR_MODE
robot_mode_V1_X
robot_mode_V1_X
Definition:
robot_mode.h:44
URStatePacketConsumer
Definition:
consumer.h:42
robot_mode_V1_X::ROBOT_NOT_CONNECTED_MODE
robot_control_mode_V3_X::TEACH
RobotModeData_V3_5::SIZE
static const size_t SIZE
Definition:
robot_mode.h:133
SharedRobotModeData::physical_robot_connected
bool physical_robot_connected
Definition:
robot_mode.h:33
RobotModeData_V3_5::unknown_internal_use
unsigned char unknown_internal_use
Definition:
robot_mode.h:131
robot_mode_V3_X::BACKDRIVE
robot_control_mode_V3_X
robot_control_mode_V3_X
Definition:
robot_mode.h:86
robot_mode_V3_X::DISCONNECTED
ur_modern_driver
Author(s): Thomas Timm Andersen, Simon Rasmussen
autogenerated on Fri Jun 26 2020 03:37:00