ur-sock 0.4444 → 1.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/lib/dashboard.rb +61 -5
  4. data/ur-sock.gemspec +1 -1
  5. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 017a63d81101ae4de90a1b421a94c589006f8887b236cf0fba9e4208fd58ac6d
4
- data.tar.gz: '06908cfefab950c4a9c82ef2cea5f8919dcd1cb1c1a237bfaae8f4aa794fa545'
3
+ metadata.gz: 77f86804b68a66dbe0f5c547004d2bb58e0a84385a8f57d4b0dab4c60d7b1baf
4
+ data.tar.gz: d96c731d006689f1dd80f3052e84084d3219964e8670a9f40afaac97f38710bb
5
5
  SHA512:
6
- metadata.gz: 8c93c0e40e543d0f2388a78620989b22d3ad8f93bdb49ced229895342730728ba1277e3d2dd9c86589dd4dea6fc348bd1d69ea43e46ff99a53c86b851489805c
7
- data.tar.gz: f9d20ab1d6e5c4ba9f46887e785e5a0cb9b927dcec4c3fccf8eb100359ea04a3b3cc49a9696277030ef301563ad2ca1b0c6941b688868b2b419a78f072f0fd15
6
+ metadata.gz: e48eadd3e4f07cd3fab23c3c77e397ed7ed91ca350251683944552a8759b1086487c4e4933bb5aaa068b4949b54ff69379f64d72cb39accdcb1c5086bc7254ac
7
+ data.tar.gz: c770cbc905113eac5fa35ec8f658ee215f24ea5076e85aa4520a12e2aa88eb893ff79d4f53a84380d769abf98859009de462f932a10466a00e4d9ad70f59e22c
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:
@@ -165,12 +165,13 @@ module UR
165
165
  line = @sock.gets.strip
166
166
  rescue
167
167
  raise UR::Dash::Reconnect.new('Loaded program can not be got. Dashboard server down or not in Remote Mode')
168
- end
168
+ end
169
+ @logger.debug line
169
170
  if line.match(/^Loaded program:\s(.+)/)
170
- @logger.debug line
171
- path = $1.strip
171
+ $1.strip
172
+ elsif line.match(/^No program loaded/)
173
+ nil
172
174
  else
173
- @logger.error line
174
175
  raise UR::Dash::Reconnect.new('Loaded program can not be got. Dashboard server down or not in Remote Mode')
175
176
  end
176
177
  end
@@ -229,7 +230,7 @@ module UR
229
230
  @logger.debug line
230
231
  else
231
232
  @logger.error line
232
- raise UR::Dash::Reconnect.new('Cant set operation mode manual. DDashboard server down or not in Remote Mode')
233
+ raise UR::Dash::Reconnect.new('Cant set operation mode manual. Dashboard server down or not in Remote Mode')
233
234
  end
234
235
  end
235
236
 
@@ -341,11 +342,66 @@ module UR
341
342
  if line.match(/^Brake/)
342
343
  @logger.debug line
343
344
  true
345
+ elsif line.match(/^could not understand/)
346
+ @logger.warn'Could not execute restart_safety: Please upgrade to current version'
347
+ line
344
348
  else
345
349
  @logger.error line
346
350
  raise UR::Dash::Reconnect.new('Cant restart safety. Dashboard server down or not in Remote Mode')
347
351
  end
348
352
  end
349
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
+ elsif line.match(/^could not understand/)
363
+ @logger.warn'Could not execute get_operational_mode: Please upgrade to current version'
364
+ line
365
+ else
366
+ @logger.error line
367
+ raise UR::Dash::Reconnect.new('Cant restart safety. Dashboard server down or not in Remote Mode')
368
+ end
369
+ end
370
+
371
+ def is_in_remote_control
372
+ @sock.write("is in remote control\n")
373
+ line = @sock.gets.strip
374
+ if line.match(/^could not understand/)
375
+ @logger.warn'Could not execute is_in_remote_control: Please upgrade to current version'
376
+ line
377
+ else
378
+ @logger.debug line
379
+ line
380
+ end
381
+ end
382
+
383
+ def get_serial_number
384
+ @sock.write("get serial number\n")
385
+ line = @sock.gets.strip
386
+ if line.match(/^could not understand/)
387
+ @logger.warn'Could not execute get_serial_number: Please upgrade to current version'
388
+ line
389
+ else
390
+ @logger.debug line
391
+ line
392
+ end
393
+ end
394
+
395
+ def get_robot_model
396
+ @sock.write("get robot model\n")
397
+ line = @sock.gets.strip
398
+ if line.match(/^could not understand/)
399
+ @logger.warn'Could not execute get_robot_model: Please upgrade to current version'
400
+ line
401
+ else
402
+ @logger.debug line
403
+ line
404
+ end
405
+ end
350
406
  end
351
407
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "ur-sock"
3
- s.version = "0.4444"
3
+ s.version = "1.0"
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.4444'
4
+ version: '1.0'
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-09-26 00:00:00.000000000 Z
12
+ date: 2020-06-05 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.