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>
24 #include "ur_modern_driver/types.h"
26 
28 {
29 public:
30  virtual bool parseWith(BinParser& bp);
31 
32  uint64_t timestamp;
37  bool protective_stopped; // AKA security_stopped
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 {
48  ROBOT_READY_MODE = 2,
57 };
58 
60 {
61 public:
62  virtual bool parseWith(BinParser& bp);
63  virtual bool consumeWith(URStatePacketConsumer& consumer);
64 
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,
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 
95 {
96 public:
97  virtual bool parseWith(BinParser& bp);
98  virtual bool consumeWith(URStatePacketConsumer& consumer);
99 
102 
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 
113 {
114 public:
115  virtual bool parseWith(BinParser& bp);
116  virtual bool consumeWith(URStatePacketConsumer& consumer);
117 
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 
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 };
virtual bool parseWith(BinParser &bp)
double speed_fraction
Definition: robot_mode.h:66
uint64_t timestamp
Definition: robot_mode.h:32
double target_speed_fraction
Definition: robot_mode.h:103
robot_mode_V3_X robot_mode
Definition: robot_mode.h:100
static const size_t SIZE
Definition: robot_mode.h:120
robot_control_mode_V3_X control_mode
Definition: robot_mode.h:101
double target_speed_fraction_limit
Definition: robot_mode.h:118
static const size_t SIZE
Definition: robot_mode.h:41
robot_mode_V1_X robot_mode
Definition: robot_mode.h:65
robot_mode_V3_X
Definition: robot_mode.h:73
static const size_t SIZE
Definition: robot_mode.h:106
static const size_t SIZE
Definition: robot_mode.h:68
robot_mode_V1_X
Definition: robot_mode.h:44
static const size_t SIZE
Definition: robot_mode.h:133
bool physical_robot_connected
Definition: robot_mode.h:33
unsigned char unknown_internal_use
Definition: robot_mode.h:131
robot_control_mode_V3_X
Definition: robot_mode.h:86


ur_modern_driver
Author(s): Thomas Timm Andersen, Simon Rasmussen
autogenerated on Fri Jun 26 2020 03:37:00