Skip to content

feat(back): create packages for ROS2 exec#3

Open
KelianHalleray wants to merge 1 commit intodevelopmentfrom
feature/back-end
Open

feat(back): create packages for ROS2 exec#3
KelianHalleray wants to merge 1 commit intodevelopmentfrom
feature/back-end

Conversation

@KelianHalleray
Copy link
Copy Markdown

No description provided.

@KelianHalleray KelianHalleray self-assigned this Apr 20, 2026
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Create ROS2 packages for robocoop backend and bringup

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Create Python package setup for robocoop_backend with dependencies
• Create ROS2 bringup package with launch and config files
• Define package metadata and build configuration for both packages
Diagram
flowchart LR
  A["Project Structure"] --> B["robocoop_backend Package"]
  A --> C["robocoop_bringup Package"]
  B --> D["Python Setup Configuration"]
  C --> E["ROS2 CMake Build"]
  C --> F["Package Metadata"]
  D --> G["Dependencies: websockets, pyyaml, rclpy"]
  E --> H["Install launch/config/scripts"]
  F --> I["ROS2 Message Dependencies"]
Loading

Grey Divider

File Changes

1. src/robocoop_backend/setup.py ⚙️ Configuration changes +17/-0

Python package setup with dependencies

src/robocoop_backend/setup.py


2. src/robocoop_bringup/CMakeLists.txt ⚙️ Configuration changes +11/-0

ROS2 CMake build configuration

src/robocoop_bringup/CMakeLists.txt


3. src/robocoop_bringup/package.xml ⚙️ Configuration changes +16/-0

ROS2 package metadata and dependencies

src/robocoop_bringup/package.xml


View more (22)
4. src/robocoop_backend/robocoop_backend/__init__.py Additional files +0/-0

...

src/robocoop_backend/robocoop_backend/init.py


5. src/robocoop_backend/robocoop_backend/tests/fixtures/__init__.py Additional files +0/-0

...

src/robocoop_backend/robocoop_backend/tests/fixtures/init.py


6. src/robocoop_backend/robocoop_backend/tests/integration/__init__.py Additional files +0/-0

...

src/robocoop_backend/robocoop_backend/tests/integration/init.py


7. src/robocoop_backend/robocoop_backend/tests/unit/__init__.py Additional files +0/-0

...

src/robocoop_backend/robocoop_backend/tests/unit/init.py


8. src/robocoop_bringup/config/backend.params.yaml Additional files +0/-0

...

src/robocoop_bringup/config/backend.params.yaml


9. src/robocoop_bringup/config/common.params.yaml Additional files +0/-0

...

src/robocoop_bringup/config/common.params.yaml


10. src/robocoop_bringup/config/m3pro_topics.yaml Additional files +0/-0

...

src/robocoop_bringup/config/m3pro_topics.yaml


11. src/robocoop_bringup/config/mock.params.yaml Additional files +0/-0

...

src/robocoop_bringup/config/mock.params.yaml


12. src/robocoop_bringup/config/real.params.yaml Additional files +0/-0

...

src/robocoop_bringup/config/real.params.yaml


13. src/robocoop_bringup/config/security.params.yaml Additional files +0/-0

...

src/robocoop_bringup/config/security.params.yaml


14. src/robocoop_bringup/config/sim.params.yaml Additional files +0/-0

...

src/robocoop_bringup/config/sim.params.yaml


15. src/robocoop_bringup/launch/backend_debug.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/backend_debug.launch.py


16. src/robocoop_bringup/launch/backend_mock.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/backend_mock.launch.py


17. src/robocoop_bringup/launch/backend_real.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/backend_real.launch.py


18. src/robocoop_bringup/launch/backend_sim.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/backend_sim.launch.py


19. src/robocoop_bringup/launch/includes/monitoring.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/includes/monitoring.launch.py


20. src/robocoop_bringup/launch/includes/robot_runtime.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/includes/robot_runtime.launch.py


21. src/robocoop_bringup/launch/includes/ros_bridges.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/includes/ros_bridges.launch.py


22. src/robocoop_bringup/launch/includes/websocket.launch.py Additional files +0/-0

...

src/robocoop_bringup/launch/includes/websocket.launch.py


23. src/robocoop_bringup/scripts/run_mock.sh Additional files +0/-0

...

src/robocoop_bringup/scripts/run_mock.sh


24. src/robocoop_bringup/scripts/run_real.sh Additional files +0/-0

...

src/robocoop_bringup/scripts/run_real.sh


25. src/robocoop_bringup/scripts/run_sim.sh Additional files +0/-0

...

src/robocoop_bringup/scripts/run_sim.sh


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 20, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Broken package.xml manifest 🐞 Bug ≡ Correctness
Description
src/robocoop_bringup/package.xml uses an invalid tag (<n> instead of <name>) and declares a
<maintainer> without the required email attribute, which will prevent ROS2 tooling (ament/colcon)
from parsing/building the package. This blocks building/using robocoop_bringup in the repo’s ROS2
environment.
Code

src/robocoop_bringup/package.xml[R3-6]

+  <n>robocoop_bringup</n>
+  <version>0.1.0</version>
+  <description>Launch files and parameter configs for Robocoop.</description>
+  <maintainer>Robocoop Team</maintainer>
Evidence
The manifest currently has an invalid package name element and an incomplete maintainer element; the
repo includes a ROS2 container that installs colcon, so this manifest will be consumed during ROS2
builds.

src/robocoop_bringup/package.xml[1-16]
sim_env/docker-container-ros2/ros2/Dockerfile[39-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`src/robocoop_bringup/package.xml` is not valid for ROS2 tooling because it uses `<n>` instead of `<name>` and the maintainer tag omits the required `email` attribute.

## Issue Context
This will prevent `ament/colcon` from parsing the package manifest, blocking builds and installs.

## Fix Focus Areas
- src/robocoop_bringup/package.xml[1-8]

## Suggested change
- Replace `<n>robocoop_bringup</n>` with `<name>robocoop_bringup</name>`
- Change maintainer to include email, e.g. `<maintainer email="dev@robocoop.example">Robocoop Team</maintainer>` (use the real email)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Tests not excluded from wheel 🐞 Bug ⚙ Maintainability
Description
src/robocoop_backend/setup.py uses find_packages(exclude=["tests*"]) which does not match the actual
package names under robocoop_backend.tests, so test code will be included in the built distribution.
This increases shipped surface area and can pull in unintended test-only imports/data.
Code

src/robocoop_backend/setup.py[R5-7]

+    version="0.1.0",
+    packages=find_packages(exclude=["tests*"]),
+    install_requires=[
Evidence
The repository’s tests are packaged under the robocoop_backend.tests namespace (they have
__init__.py), but the exclude pattern only targets top-level tests* package names and won’t match
robocoop_backend.tests*.

src/robocoop_backend/setup.py[3-7]
src/robocoop_backend/robocoop_backend/tests/init.py[1-1]
src/robocoop_backend/robocoop_backend/tests/unit/init.py[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`find_packages(exclude=["tests*"])` does not exclude `robocoop_backend.tests*`, so tests will be included in the distribution.

## Issue Context
The tests directories are Python packages (they contain `__init__.py`), so `find_packages()` will discover them unless excluded correctly.

## Fix Focus Areas
- src/robocoop_backend/setup.py[4-7]

## Suggested change
Update the exclude list to match the discovered package names, e.g.:
- `exclude=["robocoop_backend.tests", "robocoop_backend.tests.*"]`
(or keep `tests*` too if you also have top-level tests in the future).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Installed server import fails 🐞 Bug ≡ Correctness
Description
By adding setup.py, robocoop_backend becomes installable, but robocoop_backend/app/server.py imports
websocket_handler as a top-level module (from websocket_handler import handler), which will fail
when executed as an installed package/module. This leads to ModuleNotFoundError in typical packaged
execution paths (e.g., python -m robocoop_backend.app.server or a future console_script).
Code

src/robocoop_backend/setup.py[R3-7]

+setup(
+    name="robocoop_backend",
+    version="0.1.0",
+    packages=find_packages(exclude=["tests*"]),
+    install_requires=[
Evidence
setup.py now packages the robocoop_backend modules, but server.py uses a non-relative import even
though websocket_handler.py is in the same package directory, which only works when running from
that directory on sys.path (not when imported as a package).

src/robocoop_backend/setup.py[3-7]
src/robocoop_backend/robocoop_backend/app/server.py[11-18]
src/robocoop_backend/robocoop_backend/app/websocket_handler.py[7-13]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`robocoop_backend.app.server` uses `from websocket_handler import handler`, which will not resolve when the backend is installed as a package.

## Issue Context
The PR introduces `setup.py`, making it likely users will run the code via module/package execution rather than from the app directory.

## Fix Focus Areas
- src/robocoop_backend/robocoop_backend/app/server.py[11-17]

## Suggested change
- Replace `from websocket_handler import handler` with `from .websocket_handler import handler`
Optionally (future-proofing): add an `entry_points.console_scripts` in `setup.py` to provide a stable executable, and ensure imports remain package-relative.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@damnthonyy damnthonyy requested a review from Copilot April 20, 2026 13:39
@damnthonyy
Copy link
Copy Markdown
Member

/copilot

Comment on lines +3 to +6
<n>robocoop_bringup</n>
<version>0.1.0</version>
<description>Launch files and parameter configs for Robocoop.</description>
<maintainer>Robocoop Team</maintainer>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Broken package.xml manifest 🐞 Bug ≡ Correctness

src/robocoop_bringup/package.xml uses an invalid tag (<n> instead of <name>) and declares a
<maintainer> without the required email attribute, which will prevent ROS2 tooling (ament/colcon)
from parsing/building the package. This blocks building/using robocoop_bringup in the repo’s ROS2
environment.
Agent Prompt
## Issue description
`src/robocoop_bringup/package.xml` is not valid for ROS2 tooling because it uses `<n>` instead of `<name>` and the maintainer tag omits the required `email` attribute.

## Issue Context
This will prevent `ament/colcon` from parsing the package manifest, blocking builds and installs.

## Fix Focus Areas
- src/robocoop_bringup/package.xml[1-8]

## Suggested change
- Replace `<n>robocoop_bringup</n>` with `<name>robocoop_bringup</name>`
- Change maintainer to include email, e.g. `<maintainer email="dev@robocoop.example">Robocoop Team</maintainer>` (use the real email)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces initial scaffolding for ROS2 execution by adding a robocoop_bringup package (launch/config/scripts) and adding packaging metadata for the Python robocoop_backend.

Changes:

  • Add robocoop_bringup ROS2 package skeleton (CMake/package.xml) and install rules.
  • Add placeholder launch entrypoints/includes and environment-specific config placeholders.
  • Add setup.py to package robocoop_backend for pip installation.

Reviewed changes

Copilot reviewed 3 out of 25 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/robocoop_bringup/scripts/run_sim.sh Placeholder script intended to launch sim backend.
src/robocoop_bringup/scripts/run_real.sh Placeholder script intended to launch real backend.
src/robocoop_bringup/scripts/run_mock.sh Placeholder script intended to launch mock backend.
src/robocoop_bringup/package.xml New ROS2 package manifest for bringup package.
src/robocoop_bringup/launch/includes/websocket.launch.py Placeholder include for WebSocket node launch.
src/robocoop_bringup/launch/includes/ros_bridges.launch.py Placeholder include for ROS bridge nodes.
src/robocoop_bringup/launch/includes/robot_runtime.launch.py Placeholder include for hardware-only runtime nodes.
src/robocoop_bringup/launch/includes/monitoring.launch.py Placeholder include for monitoring/observability nodes.
src/robocoop_bringup/launch/backend_sim.launch.py Placeholder sim backend launch entrypoint.
src/robocoop_bringup/launch/backend_real.launch.py Placeholder real backend launch entrypoint.
src/robocoop_bringup/launch/backend_mock.launch.py Placeholder mock backend launch entrypoint.
src/robocoop_bringup/launch/backend_debug.launch.py Placeholder debug backend launch entrypoint.
src/robocoop_bringup/config/sim.params.yaml Placeholder sim configuration spec.
src/robocoop_bringup/config/security.params.yaml Placeholder security configuration spec.
src/robocoop_bringup/config/real.params.yaml Placeholder real-hardware configuration spec.
src/robocoop_bringup/config/mock.params.yaml Placeholder mock configuration spec.
src/robocoop_bringup/config/m3pro_topics.yaml Placeholder topic mapping spec.
src/robocoop_bringup/config/common.params.yaml Placeholder common configuration spec.
src/robocoop_bringup/config/backend.params.yaml Placeholder backend/WebSocket configuration spec.
src/robocoop_bringup/CMakeLists.txt Adds ament package definition + installs launch/config/scripts.
src/robocoop_backend/setup.py Adds setuptools packaging for Python backend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

setup(
name="robocoop_backend",
version="0.1.0",
packages=find_packages(exclude=["tests*"]),
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_packages(exclude=["tests*"]) will not exclude robocoop_backend.tests... because the pattern only matches packages that start with tests. As a result, the test packages are likely to be included in the distribution; use an exclude pattern like robocoop_backend.tests* (or drop the exclude if you intend to ship tests).

Suggested change
packages=find_packages(exclude=["tests*"]),
packages=find_packages(exclude=["robocoop_backend.tests*"]),

Copilot uses AI. Check for mistakes.
<n>robocoop_bringup</n>
<version>0.1.0</version>
<description>Launch files and parameter configs for Robocoop.</description>
<maintainer>Robocoop Team</maintainer>
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<maintainer> is missing the required email attribute (e.g., <maintainer email="...">...). Many ROS2/ament checks treat this as an error, and it also makes it hard for users to contact the maintainer.

Suggested change
<maintainer>Robocoop Team</maintainer>
<maintainer email="team@robocoop.example.com">Robocoop Team</maintainer>

Copilot uses AI. Check for mistakes.
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>nav_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bringup package contains Python launch files, but package.xml does not declare runtime dependencies on launch/launch_ros. Without these, rosdep may not install the required launch system packages when building from source.

Suggested change
<exec_depend>std_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +10
DIRECTORY launch config scripts
DESTINATION share/${PROJECT_NAME}
)

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install(DIRECTORY ... scripts ...) may install the shell scripts without executable permissions depending on source file modes. If these are meant to be runnable entrypoints, prefer install(PROGRAMS scripts/*.sh DESTINATION lib/${PROJECT_NAME}) (or similar) to ensure they are executable after installation.

Suggested change
DIRECTORY launch config scripts
DESTINATION share/${PROJECT_NAME}
)
DIRECTORY launch config
DESTINATION share/${PROJECT_NAME}
)
install(
PROGRAMS scripts/*.sh
DESTINATION lib/${PROJECT_NAME}
)

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<package format="3">
<n>robocoop_bringup</n>
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.xml uses <n> instead of the required <name> tag. This makes the manifest invalid and will cause ROS2 tooling (colcon/ament) to fail parsing the package.

Suggested change
<n>robocoop_bringup</n>
<name>robocoop_bringup</name>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants