Skip to content

Commit

Permalink
fix(arcor2_dobot): bias conv to mm for dobot
Browse files Browse the repository at this point in the history
  • Loading branch information
ZdenekM committed Feb 20, 2024
1 parent fbe9ce0 commit 1f79def
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 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-08: [1.1.0](https://github.com/robofit/arcor2/releases/tag/arcor2_dobot%2F1.1.0) ([docker](https://hub.docker.com/r/arcor2/arcor2_dobot/tags?page=1&ordering=last_updated&name=1.1.0), [pypi](https://pypi.org/project/arcor2-dobot/1.1.0/)).
- 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/)).

### arcor2_execution

Expand Down
8 changes: 4 additions & 4 deletions compose-files/fit-demo/docker-compose.lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ services:
fit-demo-dobot-magician:
environment:
- ARCOR2_DOBOT_MOCK=false
- ARCOR2_DOBOT_BIAS_X=0.06
- ARCOR2_DOBOT_BIAS_Z=-0.06
- ARCOR2_DOBOT_BIAS_X=0.0597
- ARCOR2_DOBOT_BIAS_Z=0.06
devices:
- /dev/dobotMagician:/dev/dobot
fit-demo-dobot-magician2:
environment:
- ARCOR2_DOBOT_MOCK=false
- ARCOR2_DOBOT_BIAS_X=0.06
- ARCOR2_DOBOT_BIAS_Z=-0.06
- ARCOR2_DOBOT_BIAS_X=0.0597
- ARCOR2_DOBOT_BIAS_Z=0.06
devices:
- /dev/dobotMagician2:/dev/dobot

Expand Down
6 changes: 3 additions & 3 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.0
image: arcor2/arcor2_dobot:1.1.1
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.0
image: arcor2/arcor2_dobot:1.1.1
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.0
image: arcor2/arcor2_dobot:1.1.1
container_name: fit-demo-dobot-m1
depends_on:
fit-demo-scene:
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.0"])
docker_image(name="arcor2_dobot", repository="arcor2/arcor2_dobot", image_tags=["1.1.1"])
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.1.1] - 2024-02-20

### Fixed

- Biases are now converted to millimeters when sent to robot.

## [1.1.0] - 2024-02-08

### Changed
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.0
1.1.1
7 changes: 6 additions & 1 deletion src/python/arcor2_dobot/dobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
BIAS_Y = get_float("ARCOR2_DOBOT_BIAS_Y", 0.0)
BIAS_Z = get_float("ARCOR2_DOBOT_BIAS_Z", 0.0)

assert BIAS_X > 0
assert BIAS_Y > 0
assert BIAS_Z > 0


class DobotException(RobotException):
pass
Expand Down Expand Up @@ -52,7 +56,8 @@ def __init__(self, pose: Pose, port: str = "/dev/dobot", simulator: bool = False
except DobotApiException as e:
raise DobotApiException("Could not connect to the robot.") from e

self._dobot.set_end_effector_params(BIAS_X, BIAS_Y, BIAS_Z)
# bias has to be converted to millimeters
self._dobot.set_end_effector_params(BIAS_X * 1000, BIAS_Y * 1000, BIAS_Z * 1000)

else:
self._joint_values: list[Joint] = [] # has to be set to some initial value in derived classes
Expand Down
2 changes: 1 addition & 1 deletion src/python/arcor2_dobot/magician.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DobotMagician(Dobot):
link_2_length = 0.135
link_3_length = 0.147
link_4_length = BIAS_X
end_effector_length = -BIAS_Z
end_effector_length = BIAS_Z

def __init__(self, pose: Pose, port: str = "/dev/dobot", simulator: bool = False) -> None:
super(DobotMagician, self).__init__(pose, port, simulator)
Expand Down

0 comments on commit 1f79def

Please sign in to comment.