Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improved FIT objects #852

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The following video by [Kinali](https://www.kinali.cz/en/) shows the use case (o

[README](src/python/arcor2_dobot/README.md) | [CHANGELOG](src/python/arcor2_dobot/CHANGELOG.md)

- 2024-02-20: [1.1.1](https://github.com/robofit/arcor2/releases/tag/arcor2_dobot%2F1.1.1) ([docker](https://hub.docker.com/r/arcor2/arcor2_dobot/tags?page=1&ordering=last_updated&name=1.1.1), [pypi](https://pypi.org/project/arcor2-dobot/1.1.1/)).
- 2024-03-26: [1.2.0](https://github.com/robofit/arcor2/releases/tag/arcor2_dobot%2F1.2.0) ([docker](https://hub.docker.com/r/arcor2/arcor2_dobot/tags?page=1&ordering=last_updated&name=1.2.0), [pypi](https://pypi.org/project/arcor2-dobot/1.2.0/)).

### arcor2_execution

Expand Down Expand Up @@ -108,7 +108,7 @@ The following video by [Kinali](https://www.kinali.cz/en/) shows the use case (o

[README](src/python/arcor2_fit_demo/README.md) | [CHANGELOG](src/python/arcor2_fit_demo/CHANGELOG.md)

- 2024-03-25: [1.3.0](https://github.com/robofit/arcor2/releases/tag/arcor2_fit_demo%2F1.3.0) ([docker](https://hub.docker.com/r/arcor2/arcor2_upload_fit_demo/tags?page=1&ordering=last_updated&name=1.3.0), [pypi](https://pypi.org/project/arcor2-fit-demo/1.3.0/)).
- 2024-03-26: [1.4.0](https://github.com/robofit/arcor2/releases/tag/arcor2_fit_demo%2F1.4.0) ([docker](https://hub.docker.com/r/arcor2/arcor2_upload_fit_demo/tags?page=1&ordering=last_updated&name=1.4.0), [pypi](https://pypi.org/project/arcor2-fit-demo/1.4.0/)).

### arcor2_kinect_azure

Expand Down
8 changes: 4 additions & 4 deletions compose-files/fit-demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ services:
- ./calibration.yaml:/root/calibration.yaml

fit-demo-dobot-magician:
image: arcor2/arcor2_dobot:1.1.1
image: arcor2/arcor2_dobot:1.2.0
container_name: fit-demo-dobot-magician
depends_on:
fit-demo-scene:
Expand All @@ -114,7 +114,7 @@ services:
- ARCOR2_DOBOT_MODEL=magician

fit-demo-dobot-magician2:
image: arcor2/arcor2_dobot:1.1.1
image: arcor2/arcor2_dobot:1.2.0
container_name: fit-demo-dobot-magician2
depends_on:
fit-demo-scene:
Expand All @@ -130,7 +130,7 @@ services:
- ARCOR2_DOBOT_MODEL=magician

fit-demo-dobot-m1:
image: arcor2/arcor2_dobot:1.1.1
image: arcor2/arcor2_dobot:1.2.0
container_name: fit-demo-dobot-m1
depends_on:
fit-demo-scene:
Expand Down Expand Up @@ -210,7 +210,7 @@ services:
- fit-demo-asset

fit-demo-upload-object-types:
image: arcor2/arcor2_upload_fit_demo:1.3.0
image: arcor2/arcor2_upload_fit_demo:1.4.0
container_name: "fit-demo-upload-object-types"
depends_on:
fit-demo-project:
Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_dobot/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker_image(name="arcor2_dobot", repository="arcor2/arcor2_dobot", image_tags=["1.1.1"])
docker_image(name="arcor2_dobot", repository="arcor2/arcor2_dobot", image_tags=["1.2.0"])
2 changes: 1 addition & 1 deletion src/docker/arcor2_upload_fit_demo/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker_image(name="arcor2_upload_fit_demo", repository="arcor2/arcor2_upload_fit_demo", image_tags=["1.3.0"])
docker_image(name="arcor2_upload_fit_demo", repository="arcor2/arcor2_upload_fit_demo", image_tags=["1.4.0"])
6 changes: 6 additions & 0 deletions src/python/arcor2_dobot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [1.2.0] - 2024-03-26

### Changed

- Setting belt distance is now blocking operation.

## [1.1.1] - 2024-02-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/python/arcor2_dobot/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.2.0
7 changes: 5 additions & 2 deletions src/python/arcor2_dobot/dobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ def conveyor_speed(self, speed: float, direction: int = 1) -> None:
if not self.simulator:
self._dobot.conveyor_belt(speed, direction)

def conveyor_distance(self, speed: float, distance: float, direction: int = 1) -> None:
self._dobot.conveyor_belt_distance(speed, distance, direction)
def conveyor_distance(self, speed: float, distance: float, direction: int = 1, blocking=True) -> None:
idx = self._dobot.conveyor_belt_distance(speed, distance, direction)

if blocking:
self._dobot.wait_for_cmd(idx)

@property
def hand_teaching_mode(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions src/python/arcor2_dobot/dobot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,11 @@ def _set_stepper_motor(self, speed: int, interface: int = 0, motor_control=True)
msg.params.extend(bytearray(struct.pack("i", speed)))
return self._send_command(msg)

def conveyor_belt_distance(self, speed: float, distance: float, direction: int = 1, interface: int = 0) -> None:
def conveyor_belt_distance(self, speed: float, distance: float, direction: int = 1, interface: int = 0) -> int:
if 0.0 <= speed <= 100.0 and (direction == 1 or direction == -1):
motor_speed = speed * STEP_PER_CIRCLE / MM_PER_CIRCLE * direction
steps = (distance * STEP_PER_CIRCLE / MM_PER_CIRCLE) / HUNGARIAN_CONSTANT
self._set_stepper_motor_distance(int(motor_speed), int(steps), interface)
return self._extract_cmd_index(self._set_stepper_motor_distance(int(motor_speed), int(steps), interface))
else:
raise DobotApiException("Wrong conveyor belt parameters.")

Expand Down
6 changes: 6 additions & 0 deletions src/python/arcor2_fit_demo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [1.4.0] - 2024-03-26

### Changed

- Minor changes to ObjectTypes.

## [1.3.0] - 2024-03-25

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/python/arcor2_fit_demo/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.4.0
8 changes: 4 additions & 4 deletions src/python/arcor2_fit_demo/object_types/conveyor_belt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


class Direction(StrEnum):
FORWARD: str = "forward"
BACKWARDS: str = "backwards"
LEFT: str = "left"
RIGHT: str = "right"


@dataclass
Expand Down Expand Up @@ -45,7 +45,7 @@ def __init__(
raise Arcor2Exception("Failed to connect to the Dobot Service.")

def set_velocity(
self, velocity: float = 0.5, direction: Direction = Direction.FORWARD, *, an: None | str = None
self, velocity: float = 0.5, direction: Direction = Direction.RIGHT, *, an: None | str = None
) -> None:
"""Belt will move indefinitely with given velocity.

Expand All @@ -69,7 +69,7 @@ def set_distance(
self,
velocity: float = 0.5,
distance: float = 0.55,
direction: Direction = Direction.FORWARD,
direction: Direction = Direction.RIGHT,
*,
an: None | str = None,
) -> None:
Expand Down
5 changes: 2 additions & 3 deletions src/python/arcor2_fit_demo/object_types/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ class Erp(Generic):

_ABSTRACT = False

def log_production_step(self, step: str, success: bool, *, an: None | str = None) -> None:
"""Logs finished production step.
def log_production_step(self, success: bool = True, *, an: None | str = None) -> None:
"""Logs finished production step (described by action name).
:param step: Name of the production step.
:param success: Indicates whether the step was successful.
:param an:
:return:
Expand Down
Loading