Skip to content

Conversation

Flova
Copy link
Member

@Flova Flova commented Sep 29, 2025

Summary

Make SearchBall usable again and rename it to TrackBall. So we have a head mode that tries to track the ball no matter what. If we want to search the ball or track the ball is decided by the user / the behavior to be consistent with the rest of the behavior. Duplication between the FieldFeatures and SearchBall is removed. A few small bugs in the head mover are closed.

As no localization is performed during the demo behavior, we use the tracking head mode there, as it looks better and makes the demo a bit more dynamic. The normal behavior is also adapted to use the new tracking head mode instead of the action call during passes etc..

A generic LookAt action is added to the behavior and can be used to e.g. look a specific parts of the field.

Checklist

  • Run colcon build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

Copy link
Contributor

@Copilot 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 PR renames SEARCH_BALL to TRACK_BALL in the head behavior system and refactors the head movement implementation to track the last known ball position instead of searching for it. The change improves ball tracking behavior by making it more direct and removes duplicated code between different head modes.

  • Renamed SEARCH_BALL head mode to TRACK_BALL throughout the codebase
  • Refactored head mover to track ball position using filter data instead of search patterns
  • Updated behavior files to use new tracking mode and removed outdated actions

Reviewed Changes

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

Show a summary per file
File Description
bitbots_msgs/msg/HeadMode.msg Updated message definition to rename SEARCH_BALL to TRACK_BALL
bitbots_motion/bitbots_head_mover/src/move_head.cpp Added ball position tracking, refactored head mode handling, and fixed parameter references
bitbots_motion/bitbots_head_mover/config/head_config.yml Removed deprecated search_ball configuration parameters
bitbots_misc/bitbots_teleop/scripts/teleop_keyboard.py Updated teleop to use new TRACK_BALL mode
bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/*.dsd Updated behavior files to use TrackBall and LookAtFieldFeatures actions
bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/actions/head_modes.py Replaced LookAtBall and SearchBall with new LookAt and TrackBall actions
bitbots_behavior/bitbots_blackboard/bitbots_blackboard/capsules/misc_capsule.py Updated type alias to use TRACK_BALL

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Flova Flova moved this from 🆕 New to 👀 In review in Software Sep 29, 2025
# Search for Ball and track it if found
self.head_mode_msg.head_mode = HeadMode.SEARCH_BALL
assert int(key) == HeadMode.SEARCH_BALL
self.head_mode_msg.head_mode = HeadMode.TRACK_BALL
Copy link
Member

Choose a reason for hiding this comment

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

We should also rename this in the key-binding printout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants