Python support - #4
Merged
Merged
Conversation
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds ROS 2 Python (ament_python) support by introducing a new Python “mission manager” package that mirrors the existing C++ APIs (FleetSession/RobotHandle/SimpleController) and a Python-based example deployment/mission script that reuses the existing scenario assets.
Changes:
- Introduces
easyfleet_mission_manager_py, a Python implementation of capability discovery, action-client orchestration, robot handles, and RViz status markers. - Adds a pytest-based test suite (including a fake nav capability process) plus ament linters for the new Python package(s).
- Adds
easyfleet_easynav_collaboration_simple_api_deployment_py, a Python mission-controller mirror deployment with a YAML launch file and a scripted mission.
Reviewed changes
Copilot reviewed 37 out of 42 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| easyfleet_mission_manager_py/test/test_xmllint.py | Adds ament xmllint test for the Python package. |
| easyfleet_mission_manager_py/test/test_throttle.py | Unit tests for the new Throttle helper. |
| easyfleet_mission_manager_py/test/test_pep257.py | Adds ament pep257 linter test. |
| easyfleet_mission_manager_py/test/test_nav_fake_capability.py | Provides a minimal fake navigation action server for integration tests. |
| easyfleet_mission_manager_py/test/test_fleet_session_shutdown.py | Tests FleetSession shutdown behavior with rclpy context invalidation. |
| easyfleet_mission_manager_py/test/test_fleet_session_robot_handle.py | End-to-end integration tests for FleetSession/RobotHandle/SimpleController. |
| easyfleet_mission_manager_py/test/test_flake8.py | Adds ament flake8 linter test. |
| easyfleet_mission_manager_py/test/test_copyright.py | Adds ament copyright linter test. |
| easyfleet_mission_manager_py/test/test_capability_state.py | Unit tests for CapabilityState string conversion. |
| easyfleet_mission_manager_py/test/test_capability_discovery.py | Integration tests for capability discovery over ROS topics. |
| easyfleet_mission_manager_py/test/init.py | Marks test directory as a package for relative imports. |
| easyfleet_mission_manager_py/setup.py | Declares the new Python package for installation. |
| easyfleet_mission_manager_py/setup.cfg | Configures script install locations for ament_python. |
| easyfleet_mission_manager_py/resource/easyfleet_mission_manager_py | Registers the package resource for the ament index. |
| easyfleet_mission_manager_py/package.xml | Declares ROS/package dependencies and test dependencies. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/throttle.py | Adds a thread-safe minimum-interval rate limiter. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/status_markers.py | Publishes RViz status markers for robot mission status. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/simple_controller.py | Adds a minimal controller wrapper around FleetSession. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/robot_handle.py | Implements RobotHandle for running/stopping capabilities and tracking state. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/output.py | Adds serialized printing for multi-threaded output. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/mission_helpers.py | Adds common goal builders, feedback printers, and helper utilities. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/fleet_session.py | Implements FleetSession with background executor spinning and heartbeat handling. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/detail/running_capability.py | Tracks per-capability in-flight goals and timeouts, maps outcomes to states. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/detail/init.py | Initializes the internal detail package. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/capability_state.py | Defines CapabilityState enum and string conversion helper. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/capability_info.py | Defines CapabilityInfo and pretty-printers for discovery output. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/capability_discovery.py | Implements discovery of capabilities via /capabilities and /capabilities_status. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/capability_client.py | Implements an ActionClient wrapper with outcome normalization and cancel handling. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/ansi.py | Provides ANSI formatting constants for terminal output. |
| easyfleet_mission_manager_py/easyfleet_mission_manager_py/init.py | Exposes the public Python API surface for the new package. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/test/test_xmllint.py | Adds ament xmllint test for the example Python deployment package. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/test/test_pep257.py | Adds ament pep257 linter test for the deployment package. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/test/test_flake8.py | Adds ament flake8 linter test for the deployment package. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/test/test_copyright.py | Adds ament copyright test for the deployment package. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/test/init.py | Marks deployment tests as a package. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/setup.py | Declares the deployment Python package and console entry point. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/setup.cfg | Configures script install locations for ament_python. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/resource/easyfleet_easynav_collaboration_simple_api_deployment_py | Registers the deployment package resource for the ament index. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/package.xml | Declares ROS/package dependencies for the deployment and its tests. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/launch/easynav_collaboration_launch.yaml | Launches the scenario but swaps in the Python mission controller node. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/easyfleet_easynav_collaboration_simple_api_deployment_py/mission.py | Implements the Python mission choreography against the new API. |
| easyfleet_example_deployments/easyfleet_easynav_collaboration_simple_api_deployment_py/easyfleet_easynav_collaboration_simple_api_deployment_py/init.py | Initializes the deployment Python package. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+35
to
+40
| def _spin_in_background(executor) -> threading.Thread: | ||
| thread = threading.Thread(target=executor.spin, daemon=True) | ||
| thread.start() | ||
| while not executor.is_spinning: | ||
| pass | ||
| return thread |
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This PR adds Python support for creating missions and manage the fleet