Skip to content

Commit

Permalink
Docker compose up, recreate if necessary (#34)
Browse files Browse the repository at this point in the history
This is done by pinging the robot and wait for response.

Also moved around the functions in abb_runner to create some better grouping of functions.

Closes #23
Closes #32
  • Loading branch information
tetov authored Feb 18, 2020
1 parent dc4966d commit 3954dd4
Show file tree
Hide file tree
Showing 9 changed files with 336 additions and 171 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## \[0.1.17\] \[2020-02-18\]

### Added

- Docker compose integration via `compas_rcf.utils.docker` to set up needed services for `compas_rcf.fabrication.abb_runner`.
- Added ping function to `compas_rcf.abb.helpers`, sends NoOp to controller and waits for feedback.

### Changed

- Reordered functions in `abb_runner` and added comments to section of the functions.

## \[0.1.16\] \[2020-02-18\]

### Changed
Expand Down
46 changes: 0 additions & 46 deletions data/docker-compose/abb/virtual/docker-compose.yml

This file was deleted.

29 changes: 29 additions & 0 deletions src/compas_rcf/abb/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from __future__ import division
from __future__ import print_function

from compas_rrc import Noop
from compas_rrc import FeedbackLevel

from compas_rcf import HERE

# Describes the valid zone data definitions.
zone_dict = {
"FINE": -1,
Expand All @@ -21,3 +26,27 @@
"Z150": 150,
"Z200": 200,
}

try:
from pathlib import Path
except ImportError:
from pathlib2 import Path

pkg_dir = Path(HERE)

_compose_folder = pkg_dir / "utils" / "docker" / "compose_files" / "abb"
docker_compose_paths = {
"base": _compose_folder / "base-docker-compose.yml",
"abb_driver": _compose_folder / "abb-driver-docker-compose.yml",
}
robot_ips = {"real": "192.168.125.1", "virtual": "host.docker.internal"}


def ping(client, timeout=10):
feedback = client.send(Noop(feedback_level=FeedbackLevel.DONE))

try:
return feedback.result(timeout=timeout)
# TODO: Ask Philippe to change this to TimeoutError
except Exception:
raise TimeoutError
Loading

0 comments on commit 3954dd4

Please sign in to comment.