ur-sock 0.3.2 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54d9351d7f44499bd4dada3e3a015c23d75901518451ae817b663b0b0ccf4255
4
- data.tar.gz: ac3846b9dd6bae74131d2eaa3e0190b4d041e614f7335952d3d6f72084064e07
3
+ metadata.gz: a78431f336bb9dec101ac249d78b1ff36e0d40846b8beeec19a837e1a9e2fdee
4
+ data.tar.gz: 727b583ef420264d83698d0632f51853d684cd28d2bca074ab431b50990304e3
5
5
  SHA512:
6
- metadata.gz: 78c4b31e86ea096df4a53cb38454ad866da02115cbcaf2e93ef0ef049ee42d746668d60cc841af189b2b1630f73664f7d2a1288a00870dda06393d4e98a128a9
7
- data.tar.gz: e61971e886631b1a6aac252f7aab31ceeb5d11deee2c331bc1c207f1641354d0dc2216f97e0c039cb237e754dd2f21669aa8f28b5579d860675561134d78d586
6
+ metadata.gz: 98cae8207b8fcdbe4db0e99716a9b634a576bcb0384b9968e5729d49445d7ab356006f73b2818f70a04263908097f8f25728d49d3a9bbc0e492efd267dc9c6c6
7
+ data.tar.gz: 07d59722f52e3215ac3076837dd6bb85543e90dbc1be743b94dbb039516aed6dc6994bd57f4e6807bbccc33977ad4e1cf8965096e55cc4792d2d5f3d7c47765d
data/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Universal robot interface implementation in ruby. This library provides functions using different interfaces of the universal robot. Primary this was designed for the new e-series.
4
4
 
5
+ ## Requirements
6
+
7
+ This software requires URControl version newer than 5.1.
8
+ Latest supported URControl vresion: 5.5
9
+
5
10
  ## Getting Started
6
11
 
7
12
  This library uses 3 interfaces of the universal robot:
@@ -79,7 +84,7 @@ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c6
79
84
  * **Florian Pauker**
80
85
  * **Jürgen Mangler**
81
86
 
82
- See also the list of [contributors](https://intra.acdp.at/gogs/fpauker/ua4ur/contributors) who participated in this project.
87
+ See also the list of [contributors](https://github.com/fpauker/ua4ur/contributors) who participated in this project.
83
88
 
84
89
  ## License
85
90
 
@@ -6,6 +6,8 @@ require 'uri'
6
6
  module UR
7
7
 
8
8
  class Dash
9
+ class Reconnect < Exception; end
10
+
9
11
  module ConnectionState
10
12
  DISCONNECTED = 'DISCONNECTED'
11
13
  CONNECTED = 'CONNECTED'
@@ -77,17 +79,16 @@ module UR
77
79
  end
78
80
 
79
81
  def load_program (programname)
80
- @logger.info "loadprogram"
82
+ @logger.debug "loadprogram"
81
83
  send = "load " + programname + ".urp\n"
82
- puts send
83
- @sock.write (send)
84
+ @sock.write send
84
85
  line = @sock.gets.strip
85
- if line.match(/^./) == 'L'
86
- @logger.info line
86
+ if line.match(/^L/)
87
+ @logger.debug line
87
88
  true
88
89
  else
89
90
  @logger.error line
90
- nil
91
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
91
92
  end
92
93
  end
93
94
 
@@ -95,11 +96,11 @@ module UR
95
96
  @sock.write("play\n")
96
97
  line = @sock.gets.strip
97
98
  if line == "Starting program"
98
- @logger.info line
99
+ @logger.debug line
99
100
  true
100
101
  else
101
102
  @logger.error line
102
- nil
103
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
103
104
  end
104
105
  end
105
106
 
@@ -107,118 +108,140 @@ module UR
107
108
  @sock.write("stop\n")
108
109
  line = @sock.gets.strip
109
110
  if line == "Stopped"
110
- @logger.info line
111
+ @logger.debug line
111
112
  true
112
113
  else
113
114
  @logger.error line
114
- nil
115
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
115
116
  end
116
117
  end
117
118
 
118
119
  def pause_program
119
120
  @sock.write("pause\n")
121
+ line = @sock.gets.strip
120
122
  if line == "Pausing program"
121
- @logger.info line
123
+ @logger.debug line
122
124
  true
123
125
  else
124
126
  @logger.error line
125
- nil
127
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
126
128
  end
127
129
  end
128
130
 
129
131
  def shutdown
130
132
  @sock.write("shutdown\n")
133
+ line = @sock.gets.strip
131
134
  if line == "Shutting down"
132
- @logger.info line
135
+ @logger.debug line
133
136
  true
134
137
  else
135
138
  @logger.error line
136
- nil
139
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
137
140
  end
138
141
  end
139
142
 
140
143
  def running?
141
144
  @sock.write("running\n")
145
+ line = @sock.gets.strip
142
146
  if line == "Program running: True"
143
- @logger.info line
147
+ @logger.debug line
144
148
  true
145
149
  else
146
150
  @logger.error line
147
- nil
151
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
148
152
  end
149
153
  end
150
154
 
151
155
  def get_robotmode
152
156
  @sock.write("robotmode\n")
153
157
  line = @sock.gets.strip
154
- @logger.info line
158
+ @logger.debug line
155
159
  result = $1.strip if line.match(/^Robotmode:\s(.+)/)
156
160
  end
157
161
 
158
162
  def get_loaded_program
159
- @sock.write ("get loaded program\n")
160
- line = @sock.gets.strip
163
+ begin
164
+ @sock.write ("get loaded program\n")
165
+ line = @sock.gets.strip
166
+ rescue
167
+ raise UR::Dash::Reconnect.new('Loaded program can not be got. Dashboard server down or not in Remote Mode')
168
+ end
169
+ @logger.debug line
161
170
  if line.match(/^Loaded program:\s(.+)/)
162
- @logger.info line
163
- path = $1.strip
164
- else
165
- @logger.error line
171
+ $1.strip
172
+ elsif line.match(/^No program loaded/)
166
173
  nil
174
+ else
175
+ raise UR::Dash::Reconnect.new('Loaded program can not be got. Dashboard server down or not in Remote Mode')
167
176
  end
168
177
  end
169
178
 
170
179
  def open_popupmessage(message)
171
180
  @sock.write ("popup " + message.to_s + "\n")
172
- @logger.info @sock.gets.strip
181
+ @logger.debug @sock.gets.strip
173
182
  end
174
183
 
175
184
  def close_popupmessage
176
185
  @sock.write ("close popup\n")
177
- @logger.info @sock.gets.strip
186
+ @logger.debug @sock.gets.strip
178
187
  end
179
188
 
180
189
  def add_to_log(message)
181
190
  @sock.write ("addToLog " + message.to_s + "\n")
182
191
  line = @sock.gets.strip
183
192
  if line.match(/^Added log message/)
184
- @logger.info line
193
+ @logger.debug line
185
194
  else
186
195
  @logger.error line
196
+ raise UR::Dash::Reconnect.new('Dashboard server down or not in Remote Mode')
187
197
  end
188
198
  end
189
199
 
190
200
  def is_program_saved?
191
201
  @sock.write("isProgramSaved\n")
202
+ line = @sock.gets.strip
192
203
  if line == "True"
193
- @logger.info line
204
+ @logger.debug line
194
205
  true
195
206
  else
196
207
  @logger.error line
197
- nil
208
+ raise UR::Dash::Reconnect.new('Cant determine if program is saved. Dashboard server down or not in Remote Mode')
198
209
  end
199
210
  end
200
211
 
201
212
  def get_program_state
202
213
  @sock.write("programState\n")
203
214
  line = @sock.gets.strip
204
- @logger.info line
215
+ @logger.debug line
205
216
  line
206
217
  end
207
218
 
208
219
  def get_polyscope_version
209
220
  @sock.write("PolyscopeVersion\n")
210
221
  line = @sock.gets.strip
211
- @logger.info line
222
+ @logger.debug line
212
223
  line
213
224
  end
214
225
 
226
+ def set_operation_mode_manual
227
+ @sock.write("set operational mode manual\n")
228
+ line = @sock.gets.strip
229
+ if line.match(/^S/)
230
+ @logger.debug line
231
+ else
232
+ @logger.error line
233
+ raise UR::Dash::Reconnect.new('Cant set operation mode manual. Dashboard server down or not in Remote Mode')
234
+ end
235
+ end
236
+
215
237
  def set_operation_mode_auto
216
238
  @sock.write("set operational mode automatic\n")
217
239
  line = @sock.gets.strip
218
240
  if line.match(/^S/)
219
- @logger.info line
241
+ @logger.debug line
220
242
  else
221
243
  @logger.error line
244
+ raise UR::Dash::Reconnect.new('Cant set operation mode automatic. Dashboard server down or not in Remote Mode')
222
245
  end
223
246
  end
224
247
 
@@ -226,96 +249,169 @@ module UR
226
249
  @sock.write("clear operational mode\n")
227
250
  line = @sock.gets.strip
228
251
  if line.match(/^operational/)
229
- @logger.info line
252
+ @logger.debug line
230
253
  true
231
254
  else
232
255
  @logger.error line
256
+ raise UR::Dash::Reconnect.new('Cant clear operation mode. Dashboard server down or not in Remote Mode')
233
257
  end
234
258
  end
235
259
 
236
260
  def power_on
237
261
  @sock.write("power on\n")
262
+ line = @sock.gets.strip
238
263
  if line.match(/^Powering/)
239
- @logger.info line
264
+ @logger.debug line
240
265
  true
241
266
  else
242
267
  @logger.error line
243
- nil
268
+ raise UR::Dash::Reconnect.new('Cant power on. Dashboard server down or not in Remote Mode')
244
269
  end
245
270
  end
246
271
 
247
272
  def power_off
248
273
  @sock.write("power off\n")
274
+ line = @sock.gets.strip
249
275
  if line.match(/^Powering/)
250
- @logger.info line
276
+ @logger.debug line
251
277
  true
252
278
  else
253
279
  @logger.error line
254
- nil
280
+ raise UR::Dash::Reconnect.new('Cant power off. Dashboard server down or not in Remote Mode')
255
281
  end
256
282
  end
257
283
 
258
284
  def break_release
259
285
  @sock.write("brake release\n")
286
+ line = @sock.gets.strip
260
287
  if line.match(/^Brake/)
261
- @logger.info line
288
+ @logger.debug line
262
289
  true
263
290
  else
264
291
  @logger.error line
265
- nil
292
+ raise UR::Dash::Reconnect.new('Cant release breaks. Dashboard server down or not in Remote Mode')
266
293
  end
267
294
  end
268
295
 
269
296
  def get_safety_mode
270
297
  @sock.write("safetymode\n")
271
298
  line = @sock.gets.strip
272
- @logger.info line
299
+ @logger.debug line
273
300
  result = $1.strip if line.match(/^Safetymode:\s(.+)/)
274
301
  end
275
302
 
276
303
  def unlock_protective_stop
277
304
  @sock.write("unlock protective stop\n")
305
+ line = @sock.gets.strip
278
306
  if line.match(/^Protective/)
279
- @logger.info line
307
+ @logger.debug line
280
308
  true
281
309
  else
282
310
  @logger.error line
283
- nil
311
+ raise UR::Dash::Reconnect.new('Cant unlock protective stop. Dashboard server down or not in Remote Mode')
284
312
  end
285
313
  end
286
314
 
287
315
  def close_safety_popup
288
316
  @sock.write("close safety popup\n")
317
+ line = @sock.gets.strip
289
318
  if line.match(/^closing/)
290
- @logger.info line
319
+ @logger.debug line
291
320
  true
292
321
  else
293
322
  @logger.error line
294
- nil
323
+ raise UR::Dash::Reconnect.new('Cant close safety popup. Dashboard server down or not in Remote Mode')
295
324
  end
296
325
  end
297
326
 
298
327
  def load_installation
299
328
  @sock.write("load installation\n")
329
+ line = @sock.gets.strip
300
330
  if line.match(/^Loading/)
301
- @logger.info line
331
+ @logger.debug line
302
332
  true
303
333
  else
304
334
  @logger.error line
305
- nil
335
+ raise UR::Dash::Reconnect.new('Cant load installation. Dashboard server down or not in Remote Mode')
306
336
  end
307
337
  end
308
338
 
309
339
  def restart_safety
310
340
  @sock.write("restart safety\n")
341
+ line = @sock.gets.strip
311
342
  if line.match(/^Brake/)
312
- @logger.info line
343
+ @logger.debug line
313
344
  true
345
+ elsif line.match(/^could not understand/)
346
+ @logger.warn'Could not execute restart_safety: Please upgrade to current version'
347
+ nil
314
348
  else
315
349
  @logger.error line
350
+ raise UR::Dash::Reconnect.new('Cant restart safety. Dashboard server down or not in Remote Mode')
351
+ end
352
+ end
353
+
354
+ def get_operational_mode
355
+ @sock.write("get operational mode\n")
356
+ line = @sock.gets.strip
357
+ if line == "MANUAL" || line == "AUTOMATIC"
358
+ @logger.debug line
359
+ line
360
+ elsif line == "NONE"
361
+ @logger.warn'No password set, so no modes variable is available'
362
+ nil
363
+ elsif line.match(/^could not understand/)
364
+ @logger.warn'Could not execute get_operational_mode: Please upgrade to current version'
316
365
  nil
366
+ else
367
+ @logger.error line
368
+ raise UR::Dash::Reconnect.new('Cant get operational mode. Dashboard server down or not in Remote Mode')
317
369
  end
318
370
  end
319
371
 
372
+ def is_in_remote_control
373
+ @sock.write("is in remote control\n")
374
+ line = @sock.gets.strip
375
+ if line.match(/^could not understand/)
376
+ @logger.warn'Could not execute is_in_remote_control: Please upgrade to current version'
377
+ nil
378
+ elsif line == 'true' || line == 'false'
379
+ @logger.debug line
380
+ line
381
+ else
382
+ @logger.error line
383
+ raise UR::Dash::Reconnect.new('Cant determine if robot is in remote control mode. Dashboard server down maybe down')
384
+ end
385
+ end
386
+
387
+ def get_serial_number
388
+ @sock.write("get serial number\n")
389
+ line = @sock.gets.strip
390
+ if line.match(/^could not understand/)
391
+ @logger.warn'Could not execute get_serial_number: Please upgrade to current version'
392
+ nil
393
+ elsif line.match(/^\d+$/)
394
+ @logger.debug line
395
+ line
396
+ else
397
+ @logger.error line
398
+ raise UR::Dash::Reconnect.new('Cant get serial number. Dashboard server down maybe down or not in Remote Mode')
399
+ end
400
+ end
401
+
402
+ def get_robot_model
403
+ @sock.write("get robot model\n")
404
+ line = @sock.gets.strip
405
+ if line.match(/^could not understand/)
406
+ @logger.warn'Could not execute get_robot_model: Please upgrade to current version'
407
+ nil
408
+ elsif line.match(/^UR/)
409
+ @logger.debug line
410
+ line
411
+ else
412
+ @logger.error line
413
+ raise UR::Dash::Reconnect.new('Cant get robot model. Dashboard server down maybe down or not in Remote Mode')
414
+ end
415
+ end
320
416
  end
321
417
  end
data/lib/psi.rb CHANGED
@@ -41,18 +41,27 @@ module UR
41
41
  @sock.close
42
42
  @sock = nil
43
43
  @conn_state = ConnectionState::DISCONNECTED
44
- @logger.info "Connection closed " + @hostname + ":" + @port.to_s
44
+ @logger.info 'Connection closed ' + @hostname + ':' + @port.to_s
45
45
  end
46
46
  end
47
47
 
48
- def transfer(filename)
48
+ def execute_ur_script_file(filename)
49
+ @logger.info 'Executing UR Script File: ' + filename
49
50
  File.open(filename) do |file|
50
51
  while not file.eof?
51
- @sock.write(file.read(1024))
52
+ @sock.write(file.readline)
53
+ line = @sock.gets.strip
54
+ @logger.debug line
52
55
  end
53
56
  end
54
57
  end
55
58
 
59
+ def execute_ur_script(str)
60
+ @logger.info 'Executing UR Script ...'
61
+ @sock.write(str)
62
+ line = @sock.gets.strip
63
+ @logger.debug line
64
+ end
56
65
  end
57
66
 
58
67
  end
@@ -7,17 +7,66 @@ module UR
7
7
 
8
8
  class Rtde
9
9
  PROTOCOL_VERSION = 2
10
- @@robotmode = {-1 => 'No Controller',
11
- 0 => 'Disconnected',
12
- 1 => 'Confirm Safety',
13
- 2 => 'Booting',
14
- 3 => 'Power Off',
15
- 4 => 'Power On',
16
- 5 => 'Idle',
17
- 6 => 'Backdrive',
18
- 7 => 'Running',
19
- 8 => 'Updating Firmware'
20
- }
10
+ ROBOTMODE = {
11
+ -1 => 'No Controller',
12
+ 0 => 'Disconnected',
13
+ 1 => 'Confirm Safety',
14
+ 2 => 'Booting',
15
+ 3 => 'Power Off',
16
+ 4 => 'Power On',
17
+ 5 => 'Idle',
18
+ 6 => 'Backdrive',
19
+ 7 => 'Running',
20
+ 8 => 'Updating Firmware'
21
+ }
22
+ PROGRAMSTATE = {
23
+ 1 => 'Stopped',
24
+ 2 => 'Playing',
25
+ 4 => 'Paused'
26
+ }
27
+ JOINTMODE = {
28
+ 235 => 'JOINT_MODE_RESET',
29
+ 236 => 'JOINT_MODE_SHUTTING_DOWN',
30
+ 237 => 'JOINT_PART_D_CALIBRATION_MODE (INTERNAL USE ONLY)',
31
+ 238 => 'JOINT_MODE_BACKDRIVE',
32
+ 239 => 'JOINT_MODE_POWER_OFF',
33
+ 240 => 'JOINT_MODE_READY_FOR_POWER_OFF (FROM VERSION 5.1)',
34
+ 245 => 'JOINT_MODE_NOT_RESPONDING',
35
+ 246 => 'JOINT_MODE_MOTOR_INITIALISATION',
36
+ 247 => 'JOINT_MODE_BOOTING',
37
+ 248 => 'JOINT_PART_D_CALIBRATION_ERROR_MODE (INTERNAL USE ONLY)',
38
+ 249 => 'JOINT_MODE_BOOTLOADER',
39
+ 250 => 'JOINT_CALIBRATION_MODE (INTERNAL USE ONLY)',
40
+ 251 => 'JOINT_MODE_VIOLATION',
41
+ 252 => 'JOINT_MODE_FAULT',
42
+ 253 => 'JOINT_MODE_RUNNING',
43
+ 255 => 'JOINT_MODE_IDLE'
44
+ }
45
+ SAFETYMODE = {
46
+ 11 => 'SAFETY_MODE_UNDEFINED_SAFETY_MODE',
47
+ 10 => 'SAFETY_MODE_VALIDATE_JOINT_ID',
48
+ 9 => 'SAFETY_MODE_FAULT',
49
+ 8 => 'SAFETY_MODE_VIOLATION',
50
+ 7 => 'SAFETY_MODE_ROBOT_EMERGENCY_STOP',
51
+ 6 => 'SAFETY_MODE_SYSTEM_EMERGENCY_STOP',
52
+ 5 => 'SAFETY_MODE_SAFEGUARD_STOP',
53
+ 4 => 'SAFETY_MODE_RECOVERY',
54
+ 3 => 'SAFETY_MODE_PROTECTIVE_STOP',
55
+ 2 => 'SAFETY_MODE_REDUCED',
56
+ 1 => 'SAFETY_MODE_NORMAL'
57
+ }
58
+
59
+ TOOLMODE = {
60
+ 235 => 'JOINT_MODE_RESET',
61
+ 236 => 'JOINT_MODE_SHUTTING_DOWN',
62
+ 239 => 'JOINT_MODE_POWER_OFF',
63
+ 245 => 'JOINT_MODE_NOT_RESPONDING',
64
+ 247 => 'JOINT_MODE_BOOTING',
65
+ 249 => 'JOINT_MODE_BOOTLOADER',
66
+ 252 => 'JOINT_MODE_FAULT',
67
+ 253 => 'JOINT_MODE_RUNNING',
68
+ 255 => 'JOINT_MODE_IDLE'
69
+ }
21
70
 
22
71
  module Command #{{{
23
72
  RTDE_REQUEST_PROTOCOL_VERSION = 86 # ASCII V
@@ -37,10 +86,6 @@ module UR
37
86
  PAUSED = 3
38
87
  end #}}}
39
88
 
40
- def get_robotmode
41
- @@robotmode
42
- end
43
-
44
89
  def initialize(host, logger=Logger.new(STDOUT,level: :INFO)) #{{{
45
90
  host = '//' + host if host !~ /\/\//
46
91
  uri = URI::parse(host)
@@ -56,7 +101,7 @@ module UR
56
101
  def connect #{{{
57
102
  return if @sock
58
103
 
59
- @buf = '' # buffer data in binary format
104
+ @buf = ''.b # buffer data in binary format
60
105
  begin
61
106
  @sock = Socket.new Socket::AF_INET, Socket::SOCK_STREAM
62
107
  @sock.setsockopt Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1
@@ -114,18 +159,18 @@ module UR
114
159
  @logger.error 'Cannot send when RTDE synchroinization is inactive'
115
160
  return
116
161
  end
117
- if not @input_config.key?(input_data.recipe_id)
162
+ if not @input_config.include? input_data.recipe_id
118
163
  @logger.error 'Input configuration id not found: ' + @input_data.recipe_id
119
164
  return
120
165
  end
121
166
  config = @input_config[input_data.recipe_id]
122
167
  send_all Command::RTDE_DATA_PACKAGE, config.pack(input_data)
123
168
  end #}}}
124
- def send_and_receive(cmd, payload = '') #{{{
169
+ def send_and_receive(cmd, payload = ''.b) #{{{
125
170
  @logger.debug 'Start send_and_receive'
126
171
  send_all(cmd, payload) ? recv(cmd) : nil
127
172
  end #}}}
128
- def send_all(command, payload = '') #{{{
173
+ def send_all(command, payload = ''.b) #{{{
129
174
  fmt = 'S>C'
130
175
  size = ([0,0].pack fmt).length + payload.length
131
176
  buf = [size, command].pack(fmt) + payload
@@ -216,16 +261,16 @@ module UR
216
261
  return true
217
262
  end #}}}
218
263
 
219
- def receive #{{{
264
+ def receive(binary=false) #{{{
220
265
  @logger.debug 'Start receive'
221
266
  if !@output_config
222
267
  @logger.error 'Output configuration not initialized'
223
268
  nil
224
269
  end
225
270
  return nil if @conn_state != ConnectionState::STARTED
226
- recv Command::RTDE_DATA_PACKAGE
271
+ recv Command::RTDE_DATA_PACKAGE, binary
227
272
  end #}}}
228
- def recv(command) #{{{
273
+ def recv(command, binary=false) #{{{
229
274
  @logger.debug 'Start recv' + @buf.to_s
230
275
  while connected?
231
276
  readable, _, xlist = IO.select([@sock], [], [@sock])
@@ -266,7 +311,7 @@ module UR
266
311
  end
267
312
  if packet_header.command == command
268
313
  @logger.debug 'returning becuase of packet_header.command == command'
269
- return data
314
+ return binary ? packet[1..-1] : data
270
315
  else
271
316
  @logger.info 'skipping package(2)'
272
317
  end
@@ -64,6 +64,8 @@ module UR
64
64
  data[offset...offset+size].map(&:to_i)
65
65
  elsif data_type == 'INT32' or data_type == 'UINT8'
66
66
  data[offset].to_i
67
+ elsif data_type == 'BOOL'
68
+ data[offset].to_i > 0 ? true : false
67
69
  else
68
70
  raise TypeError.new('unpack_field: unknown data type: ' + data_type)
69
71
  end
@@ -131,7 +133,6 @@ module UR
131
133
  rmd.id = buf.unpack('C')[0]
132
134
  rmd.types = buf[1..-1].split(',')
133
135
  rmd.fmt = 'C'
134
- #p rmd.types
135
136
  rmd.types.each do |i|
136
137
  if i == 'INT32'
137
138
  rmd.fmt += 'i>'
@@ -151,10 +152,12 @@ module UR
151
152
  rmd.fmt += 'Q>'
152
153
  elsif i == 'UINT8'
153
154
  rmd.fmt += 'C'
155
+ elsif i == 'BOOL'
156
+ rmd.fmt += '?'
154
157
  elsif i == 'IN_USE'
155
- raise TypeError 'An input parameter is already in use.'
158
+ #raise TypeError 'An input parameter is already in use.'
156
159
  else
157
- raise TypeError 'Unknown data type: ' + i
160
+ #raise TypeError 'Unknown data type: ' + i
158
161
  end
159
162
  end
160
163
  rmd
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "ur-sock"
3
- s.version = "0.3.2"
3
+ s.version = "1.0.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Preliminary release of Universal Robot (UR) Socket Communication."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ur-sock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Pauker
@@ -9,28 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-23 00:00:00.000000000 Z
12
+ date: 2020-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xml-smart
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
18
  - - ">="
22
19
  - !ruby/object:Gem::Version
23
20
  version: 0.3.6
21
+ - - "~>"
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - "~>"
29
- - !ruby/object:Gem::Version
30
- version: '0'
31
28
  - - ">="
32
29
  - !ruby/object:Gem::Version
33
30
  version: 0.3.6
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
34
  description: see https://github.com/fpauker/ur-sock
35
35
  email: florian.pauker@gmail.com
36
36
  executables: []
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.0.3
70
+ rubygems_version: 3.1.2
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Preliminary release of Universal Robot (UR) Socket Communication.