src/ur/rt_state.cpp
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 
21 
23 {
24  bp.parse(time);
25  bp.parse(q_target);
26  bp.parse(qd_target);
27  bp.parse(qdd_target);
28  bp.parse(i_target);
29  bp.parse(m_target);
30  bp.parse(q_actual);
31  bp.parse(qd_actual);
32  bp.parse(i_actual);
33 }
34 
36 {
40  bp.consume(sizeof(double)); // Unused "Test value" field
41  bp.parse(robot_mode);
42 }
43 
45 {
46  if (!bp.checkSize<RTState_V1_6__7>())
47  return false;
48 
49  parse_shared1(bp);
50 
51  bp.parse(tool_accelerometer_values);
52  bp.consume(sizeof(double) * 15);
53  bp.parse(tcp_force);
56 
57  parse_shared2(bp);
58 
59  return true;
60 }
61 
63 {
64  if (!bp.checkSize<RTState_V1_8>())
65  return false;
66 
68 
69  bp.parse(joint_modes);
70 
71  return true;
72 }
73 
75 {
76  if (!bp.checkSize<RTState_V3_0__1>())
77  return false;
78 
79  parse_shared1(bp);
80 
81  bp.parse(i_control);
84  bp.parse(tcp_force);
85  bp.parse(tool_vector_target);
86  bp.parse(tcp_speed_target);
87 
88  parse_shared2(bp);
89 
90  bp.parse(joint_modes);
91  bp.parse(safety_mode);
92  bp.consume(sizeof(double[6])); // skip undocumented
93  bp.parse(tool_accelerometer_values);
94  bp.consume(sizeof(double[6])); // skip undocumented
95  bp.parse(speed_scaling);
96  bp.parse(linear_momentum_norm);
97  bp.consume(sizeof(double)); // skip undocumented
98  bp.consume(sizeof(double)); // skip undocumented
99  bp.parse(v_main);
100  bp.parse(v_robot);
101  bp.parse(i_robot);
102  bp.parse(v_actual);
103 
104  return true;
105 }
106 
108 {
109  if (!bp.checkSize<RTState_V3_2__3>())
110  return false;
111 
113 
114  bp.parse(digital_outputs);
115  bp.parse(program_state);
116 
117  return true;
118 }
119 
121 {
122  return consumer.consume(*this);
123 }
125 {
126  return consumer.consume(*this);
127 }
129 {
130  return consumer.consume(*this);
131 }
133 {
134  return consumer.consume(*this);
135 }
uint64_t digital_inputs
Definition: rt_state.h:64
virtual bool consumeWith(URRTPacketConsumer &consumer)
virtual bool consume(shared_ptr< RTPacket > packet)
Definition: consumer.h:31
void parse_shared1(BinParser &bp)
virtual bool consumeWith(URRTPacketConsumer &consumer)
std::array< double, 6 > qdd_target
Definition: rt_state.h:46
std::array< double, 6 > i_actual
Definition: rt_state.h:51
std::array< double, 6 > motor_temperatures
Definition: rt_state.h:65
cartesian_coord_t tcp_speed_actual
Definition: rt_state.h:60
bool parseWith(BinParser &bp)
virtual bool consumeWith(URRTPacketConsumer &consumer)
bool parseWith(BinParser &bp)
std::array< double, 6 > qd_actual
Definition: rt_state.h:50
std::array< double, 6 > qd_target
Definition: rt_state.h:45
bool parseWith(BinParser &bp)
std::array< double, 6 > tcp_force
Definition: rt_state.h:55
double robot_mode
Definition: rt_state.h:67
std::array< double, 6 > q_actual
Definition: rt_state.h:49
std::array< double, 6 > m_target
Definition: rt_state.h:48
bool parseWith(BinParser &bp)
bool checkSize(size_t bytes)
Definition: bin_parser.h:184
cartesian_coord_t tool_vector_actual
Definition: rt_state.h:59
double time
Definition: rt_state.h:43
void parse_shared2(BinParser &bp)
double controller_time
Definition: rt_state.h:66
void parse(T &val)
Definition: bin_parser.h:96
virtual bool consumeWith(URRTPacketConsumer &consumer)
std::array< double, 6 > q_target
Definition: rt_state.h:44
std::array< double, 6 > i_target
Definition: rt_state.h:47
void consume()
Definition: bin_parser.h:175


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