-
Notifications
You must be signed in to change notification settings - Fork 0
Angle for Rand256 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR corrects the angle calculation for the Rand256 robot in the Valetudo map parser. The change improves how negative robot angles are converted to their positive equivalents and simplifies the overall angle transformation logic.
Key changes:
- Simplified angle calculation algorithm for robot positioning
- Added special handling for -180 degree angle to avoid 360 degree output
- Updated version number to 0.1.9b60
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pyproject.toml | Version bump from 0.1.9b59 to 0.1.9b60 |
| SCR/valetudo_map_parser/map_data.py | Corrected robot angle calculation logic with improved negative angle handling |
SCR/valetudo_map_parser/map_data.py
Outdated
|
|
||
| @staticmethod | ||
| def get_rrm_robot_angle(json_data: JsonType) -> tuple: | ||
| def get_rrm_robot_angle(json_data) -> tuple: |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter type annotation was removed. The function should maintain type safety by keeping the JsonType annotation for the json_data parameter.
| def get_rrm_robot_angle(json_data) -> tuple: | |
| def get_rrm_robot_angle(json_data: JsonType) -> tuple: |
SCR/valetudo_map_parser/map_data.py
Outdated
| import numpy as np | ||
|
|
||
| from .config.types import ImageSize, JsonType | ||
| from .config.types import ImageSize, JsonType, LOGGER |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOGGER is imported but not used in the visible code changes. Consider removing unused imports to keep the code clean.
| from .config.types import ImageSize, JsonType, LOGGER | |
| from .config.types import ImageSize, JsonType |
| if angle_c == -180: | ||
| angle = 359 # -180 becomes 359 (avoiding 360) | ||
| else: | ||
| angle = 360 + angle_c # -10 -> 350, -90 -> 270 |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The special case for -180 becoming 359 seems arbitrary. Consider whether this should follow the same conversion pattern as other negative angles (360 + angle_c = 180) for consistency.
| if angle_c == -180: | |
| angle = 359 # -180 becomes 359 (avoiding 360) | |
| else: | |
| angle = 360 + angle_c # -10 -> 350, -90 -> 270 | |
| angle = 360 + angle_c # Convert all negative angles consistently |
Signed-off-by: Sandro Cantarella <sandro@fc694b21-8021-441f-8c0f-f58e8fc4533a.fritz.box>
Signed-off-by: Sandro Cantarella <sandro@fc694b21-8021-441f-8c0f-f58e8fc4533a.fritz.box>
Correction of the angle for rand 256