Skip to content

Feature/ht kick#936

Merged
jgueldenstein merged 31 commits into
mainfrom
feature/ht_kick
Jul 4, 2026
Merged

Feature/ht kick#936
jgueldenstein merged 31 commits into
mainfrom
feature/ht_kick

Conversation

@jgueldenstein

@jgueldenstein jgueldenstein commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

Include kick policy from hightorque in our rl framework

called via an action, incorporation in behavior pending

the policy could also do walking but I propose to walk to a suitable position with our own policy and activate the kick policy from there.

preliminary tests on robot worked well, kick direction is not so accurate, kick strength matters quite a lot.

Checklist

  • Run pixi run build
  • Write documentation
  • Test on your machine
  • test in simulation
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

TODO:

  • switch between policies when action is called
  • cleanup

@github-project-automation github-project-automation Bot moved this to 🆕 New in Software Jun 29, 2026
@jgueldenstein jgueldenstein moved this from 🆕 New to 🏗 In progress in Software Jun 29, 2026
@jgueldenstein jgueldenstein marked this pull request as draft June 29, 2026 11:30
@jgueldenstein

Copy link
Copy Markdown
Member Author

closes #937

@jgueldenstein

Copy link
Copy Markdown
Member Author

tested on the robot and working well, does not do anything as long as the action is not called.
transition out of kick is still missing, the policy should run with a zero comand for a set time after the kick, but feel free to review already

@jgueldenstein jgueldenstein marked this pull request as ready for review June 30, 2026 08:34
@jgueldenstein jgueldenstein requested review from Flova and jaagut June 30, 2026 08:34
// Forward the kick goal to the motors if we are in a state that allows it.
// CONTROLLABLE lets the first goal through (which then transitions us to
// KICKING), and KICKING keeps the following goals flowing.
if (current_state_ == bitbots_msgs::msg::RobotControlState::CONTROLLABLE ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a bit risky as the walking also talks during controllable. The state essentially is "walking ready to give up control". And the argument that we would drop the first tick otherwise also only applies of we kick if we are in controllable (e
g. standing stable for one second or more). In all other situations the first tick is indeed dropped. The line here could enable a situation where both talk during controllable which might be pretty bad.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The state is changed to kicking after the a tick of the hcm dsd

Comment thread src/bitbots_misc/bitbots_bringup/launch/simulator_teamplayer.launch Outdated
Comment thread src/bitbots_motion/bitbots_rl_motion/handlers/ball_handler.py Outdated
Comment thread src/bitbots_motion/bitbots_rl_motion/handlers/ball_handler.py Outdated
Comment thread src/bitbots_motion/bitbots_rl_motion/handlers/ball_handler.py Outdated
Comment thread src/bitbots_motion/bitbots_rl_motion/handlers/soccer_command_handler.py Outdated
result = Kick.Result()

while self._node.get_clock().now() < end:
if goal_handle.is_cancel_requested:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might want to cancel ourselves if we are in the wrong robot state. Especially with the fast standup it could happen that we fall and standup before the kick has finished leading to weird behavior. It would be easier to self cancel in that case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

please make a future work issue

Comment thread src/bitbots_motion/bitbots_rl_motion/launch/rl_motion.launch Outdated

# MultiThreadedExecutor so the kick action's timed execute callback (its own
# reentrant callback group) runs concurrently with the 50 Hz control timer.
executor = MultiThreadedExecutor()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is really dangerous. For both performance and reliability reasons never use the multi threaded executor. You can use async for the action server callback and have a future
that is awaited inside it. This frees the executor while it is waiting for the kick to finish. Then you have a tick / update that is called by the main policy timer. This checks a shared reference of the action goal for things like cancelation etc, sets feedback and sets the result of the future if we are finished/canceled and want to continue with the action callback to the end. This way you gain the advantage of a much more controlled update schedule with significant lowers risks for deadlocks and improved performance.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

please make an issue for future work, the kick works reasonably well with this setup

Comment thread src/bitbots_simulation/bitbots_mujoco_sim/xml/pi_plus.xml Outdated
Comment thread src/bitbots_misc/bitbots_bringup/launch/simulator_teamplayer.launch Outdated
@jgueldenstein jgueldenstein mentioned this pull request Jul 4, 2026
6 tasks
@jgueldenstein jgueldenstein merged commit bc2b353 into main Jul 4, 2026
0 of 3 checks passed
@jgueldenstein jgueldenstein deleted the feature/ht_kick branch July 4, 2026 00:18
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in Software Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants