Skip to content

Commit

Permalink
feat: minor changes to fit demo actions etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ZdenekM authored and ZdenekM committed Feb 24, 2025
1 parent 26e666f commit 5ad032f
Show file tree
Hide file tree
Showing 23 changed files with 73 additions and 63 deletions.
6 changes: 3 additions & 3 deletions build-support/install_ur_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

apt-get install -y -q --no-install-recommends \
ros-jazzy-ros-base=0.11.0-1noble.20241018.114811 \
ros-jazzy-ur=2.4.13-1noble.20241118.195218 \
ros-jazzy-moveit-py=2.10.0-1noble.20241108.205840
ros-jazzy-ros-base=0.11.0-1noble.20250115.204954 \
ros-jazzy-ur=3.0.2-1noble.20250202.035908 \
ros-jazzy-moveit-py=2.12.1-1noble.20250202.033533
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 @@ -100,7 +100,7 @@ services:
- ./calibration.yaml:/root/calibration.yaml

fit-demo-dobot-magician:
image: arcor2/arcor2_dobot:1.3.0
image: arcor2/arcor2_dobot:1.3.1
container_name: fit-demo-dobot-magician
depends_on:
fit-demo-scene:
Expand All @@ -116,7 +116,7 @@ services:
- ARCOR2_DOBOT_MODEL=magician

fit-demo-dobot-magician2:
image: arcor2/arcor2_dobot:1.3.0
image: arcor2/arcor2_dobot:1.3.1
container_name: fit-demo-dobot-magician2
depends_on:
fit-demo-scene:
Expand All @@ -132,7 +132,7 @@ services:
- ARCOR2_DOBOT_MODEL=magician

fit-demo-dobot-m1:
image: arcor2/arcor2_dobot:1.3.0
image: arcor2/arcor2_dobot:1.3.1
container_name: fit-demo-dobot-m1
depends_on:
fit-demo-scene:
Expand Down Expand Up @@ -212,7 +212,7 @@ services:
- fit-demo-asset

fit-demo-upload-object-types:
image: arcor2/arcor2_upload_fit_demo:1.5.0
image: arcor2/arcor2_upload_fit_demo:1.5.1
container_name: "fit-demo-upload-object-types"
depends_on:
fit-demo-project:
Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_3d_mouse/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM python:3.11.10-bookworm
# curl is for healthcheck
RUN apt-get update \
&& apt-get -f satisfy ffmpeg -y \
&& apt-get install -y -q --no-install-recommends sudo=1.9.13p3-1+deb12u1 libhidapi-dev=0.13.1-1 libpulse0=16.1+dfsg1-2+b1 libasound2=1.2.8-1+b1 libasound2-plugins=1.2.7.1-1 curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends sudo=1.9.13p3-1+deb12u1 libhidapi-dev=0.13.1-1 libpulse0=16.1+dfsg1-2+b1 libasound2=1.2.8-1+b1 libasound2-plugins=1.2.7.1-1 curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_arserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN PEX_TOOLS=1 /usr/local/bin/python /binary.pex venv --scope=srcs --compile /b
FROM python:3.11.10-bookworm

RUN apt-get update \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.80.0-6ubuntu3.2 \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.74.6-2+deb12u5 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM python:3.11.10-bookworm

# curl is for healthcheck
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.80.0-6ubuntu3.2 curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.74.6-2+deb12u5 curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_calibration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM python:3.11.10-bookworm
# libgomp1 and libusb-1.0-0 are because of Open3D
# curl is for healthcheck
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.80.0-6ubuntu3.2 libgomp1=12.2.0-14 libusb-1.0-0=2:1.0.26-1 curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.74.6-2+deb12u5 libgomp1=12.2.0-14 libusb-1.0-0=2:1.0.26-1 curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

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.3.0"])
docker_image(name="arcor2_dobot", repository="arcor2/arcor2_dobot", image_tags=["1.3.1"])
2 changes: 1 addition & 1 deletion src/docker/arcor2_dobot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM python:3.11.10-bookworm

# curl is for healthcheck
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.80.0-6ubuntu3.2 libgomp1=12.2.0-14 libusb-1.0-0=2:1.0.26-1 curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.74.6-2+deb12u5 libgomp1=12.2.0-14 libusb-1.0-0=2:1.0.26-1 curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_execution/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN PEX_TOOLS=1 PYTHONOPTIMIZE=1 /usr/local/bin/python /binary.pex venv --scope=
FROM python:3.11.10-bookworm

RUN apt-get update \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.80.0-6ubuntu3.2 \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.74.6-2+deb12u5 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_execution_proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN mkdir -p /root/tokens \

# curl is for healthcheck
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_fanuc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM python:3.11.10-bookworm

# curl is for healthcheck
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion src/docker/arcor2_scene/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM python:3.11.10-bookworm
# libgomp1 and libusb-1.0-0 are because of Open3D
# curl is for healthcheck
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.80.0-6ubuntu3.2 libgomp1=12.2.0-14 libusb-1.0-0=2:1.0.26-1 curl=7.88.1-10+deb12u5 \
&& apt-get install -y -q --no-install-recommends libgl1-mesa-glx=22.3.6-1+deb12u1 libglib2.0-0=2.74.6-2+deb12u5 libgomp1=12.2.0-14 libusb-1.0-0=2:1.0.26-1 curl=7.88.1-10+deb12u8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
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.5.0"])
docker_image(name="arcor2_upload_fit_demo", repository="arcor2/arcor2_upload_fit_demo", image_tags=["1.5.1"])
2 changes: 1 addition & 1 deletion src/docker/arcor2_ur/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ COPY build-support/install_ur_dependencies.sh /root/install_ur_dependencies.sh
RUN apt-get update \
&& /root/install_ur_dependencies.sh \
&& apt-get install -y -q --no-install-recommends \
libglib2.0-0=2.80.0-6ubuntu3.2 \
libglib2.0-0=2.74.6-2+deb12u5 \
libgomp1=14.2.0-4ubuntu2~24.04 libusb-1.0-0=2:1.0.27-1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down
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.3.1] - 2025-02-24

### Fixed

- Conveyor belt direction.

## [1.3.0] - 2024-04-11

### Changed
Expand Down
10 changes: 5 additions & 5 deletions src/python/arcor2_dobot/scripts/dobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ def put_conveyor_distance() -> RespT:
name: direction
schema:
type: string
default: forward
default: left
enum:
- forward
- backwards
- left
- right
description: Direction
responses:
204:
Expand All @@ -245,11 +245,11 @@ def put_conveyor_distance() -> RespT:
"""

speed = float(request.args.get("velocity", default=50.0))
direction = request.args.get("direction", default="forward")
direction = request.args.get("direction", default="left")
distance = float(request.args.get("distance", default=0.1))

assert _dobot is not None
_dobot.conveyor_distance(speed, distance * 1000, 1 if direction == "forward" else -1)
_dobot.conveyor_distance(speed, distance * 1000, 1 if direction == "left" else -1)
return Response(status=204)


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.5.1] - 2025-02-24

### Changed

- Some actions were renamed, etc.

## [1.5.0] - 2024-04-11

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/python/arcor2_fit_demo/object_types/abstract_dobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def home(self, *, an: None | str = None) -> None:
def move(
self,
pose: Pose,
move_type: MoveType,
move_type: MoveType = MoveType.JOINTS,
velocity: float = 50.0,
acceleration: float = 50.0,
safe: bool = True,
Expand Down
4 changes: 2 additions & 2 deletions src/python/arcor2_fit_demo/object_types/conveyor_belt.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def set_velocity(

set_velocity.__action__ = ActionMetadata() # type: ignore

def set_distance(
def move_distance(
self,
velocity: float = 0.5,
distance: float = 0.55,
Expand All @@ -91,4 +91,4 @@ def set_distance(
params={"velocity": velocity * 100, "distance": distance, "direction": direction},
)

set_distance.__action__ = ActionMetadata() # type: ignore
move_distance.__action__ = ActionMetadata() # type: ignore
26 changes: 0 additions & 26 deletions src/python/arcor2_fit_demo/object_types/milling_machine.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import time

from arcor2.data.common import ActionMetadata
from arcor2.object_types.abstract import CollisionObject
from arcor2.object_types.abstract import GenericWithPose


class OpticalQualityControl(CollisionObject):
mesh_filename = "kinect_azure.dae"
class OpticalQualityControl(GenericWithPose):
_ABSTRACT = False

def measure_quality(self, *, an: None | str = None) -> bool:
Expand Down
29 changes: 29 additions & 0 deletions src/python/arcor2_fit_demo/object_types/weighing_machine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import random
import time

from arcor2.data.common import ActionMetadata
from arcor2.object_types.abstract import CollisionObject


class WeighingMachine(CollisionObject):
_ABSTRACT = False

def check_weight(self, required: float = 1.0, max_diff: float = 0.1, *, an: None | str = None) -> bool:
"""Returns true if weight of an object being measured is within.
<required-max_diff, required+max_diff>.
:param required: Required (target) weight.
:param max_diff: Maximal allowed difference.
:param an:
:return: True if object weight is OK.
"""

if random.uniform(0, 1) > 0.3:
time.sleep(1)
return True
else:
time.sleep(1)
return False

check_weight.__action__ = ActionMetadata() # type: ignore
10 changes: 3 additions & 7 deletions src/python/arcor2_fit_demo/scripts/upload_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from arcor2_fit_demo.object_types.dobot_magician import DobotMagician
from arcor2_fit_demo.object_types.erp import Erp
from arcor2_fit_demo.object_types.fit_common_mixin import FitCommonMixin
from arcor2_fit_demo.object_types.milling_machine import MillingMachine
from arcor2_fit_demo.object_types.optical_quality_control import OpticalQualityControl
from arcor2_fit_demo.object_types.weighing_machine import WeighingMachine


def main() -> None:
Expand All @@ -26,12 +26,8 @@ def main() -> None:
upload_whatever(FitCommonMixin)

upload_def(Erp)
upload_def(MillingMachine, Box(MillingMachine.__name__, 0.1, 0.1, 0.1))
upload_def(
OpticalQualityControl,
Mesh(OpticalQualityControl.__name__, OpticalQualityControl.mesh_filename),
file_to_upload=get_data(OpticalQualityControl.mesh_filename),
)
upload_def(WeighingMachine, Box(WeighingMachine.__name__, 0.15, 0.15, 0.17))
upload_def(OpticalQualityControl)


if __name__ == "__main__":
Expand Down

0 comments on commit 5ad032f

Please sign in to comment.