Skip to content

Add fixes from 26 Nov#80

Merged
energy-in-joles merged 15 commits intomainfrom
fix_real
Dec 4, 2025
Merged

Add fixes from 26 Nov#80
energy-in-joles merged 15 commits intomainfrom
fix_real

Conversation

@energy-in-joles
Copy link
Copy Markdown
Member

@energy-in-joles energy-in-joles commented Nov 26, 2025

Real changes made on 26 Nov:

  • Fix real robot controller to handle robot responses as empty for now
  • Fix replay to work with non-sequential robot id
  • Fix real robot controller to work with non-sequential robot id

Copy link
Copy Markdown
Contributor

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

This pull request implements fixes and enhancements made on November 26th, including new strategy examples, robot controller updates, and configuration changes for real robot hardware.

  • Adds four new strategy example implementations (startup, defense, go-to-ball, robot placement)
  • Updates real robot controller with get_robots_responses() method and modified test code
  • Increases REAL_PARAMS values for better real robot performance
  • Changes serial port configuration from /dev/ttyACM0 to /dev/ttyUSB0

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
utama_core/team_controller/src/controllers/real/real_robot_controller.py Adds get_robots_responses() stub method, imports for testing, and updates test code with timing and loop changes
utama_core/strategy/examples/startup_strategy.py New strategy for moving robots to starting formation positions
utama_core/strategy/examples/one_robot_placement_strategy.py New strategy for testing single robot movement between positions
utama_core/strategy/examples/go_to_ball_ex.py New example strategy demonstrating go-to-ball behavior with possession checking
utama_core/strategy/examples/defense_strategy.py New defensive strategy with blocking, goalkeeping, and role assignment
utama_core/strategy/examples/init.py Exports the new strategy classes for external use
utama_core/config/settings.py Updates serial port from ACM0 to USB0 for real robot communication
utama_core/config/robot_params.py Significantly increases REAL_PARAMS velocity and acceleration limits
main.py Updates import path to use new strategy.examples module structure
Comments suppressed due to low confidence (1)

utama_core/strategy/examples/one_robot_placement_strategy.py:48

  • This assignment to 'friendly_robots' is unnecessary as it is redefined before this value is used.
        friendly_robots = game.friendly_robots

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 26, 2025 21:34
energy-in-joles and others added 2 commits November 26, 2025 21:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.

Comments suppressed due to low confidence (1)

utama_core/strategy/examples/one_robot_placement_strategy.py:48

  • This assignment to 'friendly_robots' is unnecessary as it is redefined before this value is used.
        friendly_robots = game.friendly_robots

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

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

utama_core/strategy/examples/one_robot_placement_strategy.py:79

  • The variable cmd is only assigned inside the if switch: block (lines 55-72) but is used unconditionally at line 79. This will cause an UnboundLocalError when switch is False on the first update. The command creation logic should be moved outside the if block, or cmd should be initialized before the condition.

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

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

utama_core/strategy/examples/one_robot_placement_strategy.py:81

  • The variable cmd is only defined inside the if switch: block (lines 67-73), but it's used unconditionally on line 80. When switch is False (i.e., when error >= 0.05), this will raise a NameError: name 'cmd' is not defined.

Solution: Move the cmd assignment (lines 67-73) outside the if switch: block so it's always defined, or ensure cmd is defined before the conditional block.


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

Copilot AI review requested due to automatic review settings November 26, 2025 22:34
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

utama_core/strategy/examples/one_robot_placement_strategy.py:80

  • The variable cmd is only assigned inside the if switch: block (line 67), but is used unconditionally at line 80. This will cause a NameError: name 'cmd' is not defined when switch is False (i.e., when the robot is not within 0.05m of the target). The cmd assignment should be moved outside the if switch: block to ensure it's always defined before use.

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

@energy-in-joles energy-in-joles merged commit b48216d into main Dec 4, 2025
4 checks passed
@energy-in-joles energy-in-joles deleted the fix_real branch December 4, 2025 13:26
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