Conversation
Changed project name to 'py-swarm-robot', updated authors and emails in pyproject.toml, and revised copyright year and holder in LICENSE.
Added a full-featured Robot base class that initializes and manages an MQTT client, coordinate tracker, and RobotMQTT helper. Implemented a robust RobotMqttClient wrapper for paho-mqtt with connection management, message queues, and callback support. RobotMQTT helper now provides a constructor and a placeholder for handling incoming messages. These changes provide a structured foundation for robot lifecycle management and MQTT-based communication.
Expanded RobotMQTT with management topic handling, message routing, and coordinate publishing. Implemented a dead-reckoning MotionController with drive, move, and rotate methods, including kinematic calculations. Minor formatting and constructor updates in Robot base class to support new helpers.
This commit corrects whitespace and formatting issues in robot_mqtt.py, mqtt_client.py, and robot_base.py for improved code consistency and readability. Also updates VSCode settings to add custom dictionary words for spell checking.
Removed unnecessary return statements in the management command handler of RobotMQTT. This streamlines the control flow and clarifies intent, especially for the START and RESET commands.
Introduces a DummyMqttClient for testing and expands test_motion.py to include instantiation of MotionController with dependencies, as well as a test for the Robot base class's run and shutdown behavior.
Added 'testbot' to the cSpell.words list in VSCode settings. Fixed minor whitespace formatting in test_motion.py for consistency.
Changed the initialization of robot_id in RobotMQTT to store it as a string instead of an integer. This may improve compatibility with systems expecting robot_id as a string.
Replaced placeholder sensor classes with full implementations for ColorSensor, DistanceSensor, and ProximitySensor using MQTT request/response patterns. Each sensor now supports synchronous data retrieval with timeouts, internal caching, and handler registration for incoming MQTT messages. Also updated test_motion.py to patch the MQTT connection in test_robot_base_run_and_shutdown, preventing real network calls during tests.
Replaces the NeoPixel placeholder with a full-featured controller class supporting MQTT-based commands for color, pixel, blink, and pulse control, as well as optional acknowledgment handling. Adds input validation, thread safety, and resource cleanup. Also updates VSCode settings to add 'neopixel' to cSpell words.
Added full implementations for DirectedCommunication and SimpleCommunication classes, supporting inter-robot messaging via MQTT with callback and queue APIs. Replaced the Coordinate placeholder with a dataclass providing pose tracking, odometry updates, frame conversions, and publishing utilities.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive robot framework with MQTT-based communication for the Pera-Swarm system. It adds core components including sensors, motion control, communication modules, and a base robot class with lifecycle management.
- Adds complete MQTT client wrapper with queued publishing and message routing
- Implements sensor modules for proximity, distance, and color with request/response patterns
- Introduces motion controller with differential drive kinematics and coordinate tracking
- Adds communication modules for simple broadcast and directed robot-to-robot messaging
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_motion.py | Adds tests for MotionController instantiation and Robot base class run/shutdown with MQTT mocking |
| src/robot/sensors/proximity.py | Implements proximity sensor with MQTT request/response protocol supporting multiple angles |
| src/robot/sensors/distance.py | Implements distance sensor with correlation ID-based request/response pattern |
| src/robot/sensors/color.py | Implements color sensor for RGB and ambient light readings via MQTT |
| src/robot/robot_base.py | Adds base Robot class with MQTT client, coordinate tracking, and lifecycle management |
| src/robot/mqtt_client.py | Implements MQTT client wrapper with connection management and message queuing |
| src/robot/motion.py | Adds motion controller with differential drive kinematics and dead-reckoning |
| src/robot/indicators/neopixel.py | Implements NeoPixel LED controller with various animation modes |
| src/robot/helpers/robot_mqtt.py | Adds high-level MQTT helper for robot state management and message routing |
| src/robot/helpers/coordinate.py | Implements coordinate tracking with odometry and frame conversion utilities |
| src/robot/communication/simple_comm.py | Adds simple broadcast communication module |
| src/robot/communication/directed_comm.py | Implements directed one-to-one robot communication |
| .vscode/settings.json | Adds spell check words for technical terms |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
No description provided.