From fff46f0ade71b1d10ba1a4a89124c24cf5e623c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=93=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=B0=D1=80=D1=8C?= Date: Mon, 25 May 2026 13:16:33 +1000 Subject: [PATCH] feat: add rosdep.yaml handling and iiwa_web package to Dockerfiles --- cobot/commands/local_setup.py | 19 +++++++++++++++++++ docker/jazzy/ros-iiwa7-webots/Dockerfile | 7 ++++++- docker/jazzy/ros-iiwa7/Dockerfile | 7 ++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/cobot/commands/local_setup.py b/cobot/commands/local_setup.py index 7ce8c51..16ea8cc 100644 --- a/cobot/commands/local_setup.py +++ b/cobot/commands/local_setup.py @@ -239,6 +239,25 @@ def _task_build(screen: LogScreen) -> None: screen.set_progress(0, "Installing dependencies...") screen.write("[bold]Step 1 / 2 - rosdep install[/bold]\n") + + rosdep_yaml = _PROJECT_DIR / "rosdep.yaml" + sources_list = Path("/etc/ros/rosdep/sources.list.d/50-kuka-local.list") + rosdep_entry = f"yaml file://{rosdep_yaml}\n" + if rosdep_yaml.exists() and ( + not sources_list.exists() or sources_list.read_text() != rosdep_entry + ): + try: + sources_list.write_text(rosdep_entry) + screen.write(f"Registered local rosdep source: {rosdep_yaml}") + _run_logged(["rosdep", "update"], screen.write, env=env, cwd=_PROJECT_DIR) + except PermissionError: + _run_logged( + ["sudo", "bash", "-c", + f"echo '{rosdep_entry.strip()}' > {sources_list}"], + screen.write, env=env, + ) + _run_logged(["rosdep", "update"], screen.write, env=env, cwd=_PROJECT_DIR) + _run_logged( ["rosdep", "install", "--from-paths", "src", "-i", "-r", "-y"], screen.write, diff --git a/docker/jazzy/ros-iiwa7-webots/Dockerfile b/docker/jazzy/ros-iiwa7-webots/Dockerfile index 4180928..059ba98 100644 --- a/docker/jazzy/ros-iiwa7-webots/Dockerfile +++ b/docker/jazzy/ros-iiwa7-webots/Dockerfile @@ -47,8 +47,13 @@ COPY src/iiwa_description src/iiwa_description COPY src/iiwa_msgs src/iiwa_msgs COPY src/iiwa_planning src/iiwa_planning COPY src/iiwa_utils src/iiwa_utils +COPY src/iiwa_web src/iiwa_web +COPY rosdep.yaml rosdep.yaml -RUN apt-get update && \ +RUN echo "yaml file:///ros2_ws/rosdep.yaml" \ + > /etc/ros/rosdep/sources.list.d/50-kuka-local.list && \ + rosdep update && \ + apt-get update && \ rosdep install --from-paths src -i -r -y && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/jazzy/ros-iiwa7/Dockerfile b/docker/jazzy/ros-iiwa7/Dockerfile index f66d1c7..1d87d08 100644 --- a/docker/jazzy/ros-iiwa7/Dockerfile +++ b/docker/jazzy/ros-iiwa7/Dockerfile @@ -24,8 +24,13 @@ COPY src/iiwa_description src/iiwa_description COPY src/iiwa_msgs src/iiwa_msgs COPY src/iiwa_planning src/iiwa_planning COPY src/iiwa_utils src/iiwa_utils +COPY src/iiwa_web src/iiwa_web +COPY rosdep.yaml rosdep.yaml -RUN apt-get update && \ +RUN echo "yaml file:///ros2_ws/rosdep.yaml" \ + > /etc/ros/rosdep/sources.list.d/50-kuka-local.list && \ + rosdep update && \ + apt-get update && \ rosdep install --from-paths src -i -r -y && \ rm -rf /var/lib/apt/lists/*