Planning

Documentation for each planning module in the main NUbots codebase
Updated 25 Aug 2024

FallingRelaxPlanner

Description

The FallingRelaxPlanner module is used to detect when the robot is actively falling over and run a relax action to remove torque to the servos. This is done to prevent damage when the robot impacts the ground, hopefully saving many gear set changes The script to use for relaxing is configurable, for the case where simulations cannot handle the relax script and need something else, eg a stand script.

Usage

Emit a message::plan::RelaxWhenFalling as a Task. Make sure that it has a lower challenge priority than the GetUp, otherwise it may trigger in the middle of the getup resulting in an infinite loop of falling and half getting up.

Consumes

  • message::input::Sensors to determine when the robot is actively falling over
  • message::plan::RelaxWhenFalling as a Task to activate this module allowing it to relax when the robot is falling over

Emits

  • message::actuation::BodySequence containing the script to use when relaxing

Dependencies

  • The Script extension

GetUpPlanner

Description

The GetUpPlanner module is used to automatically trigger a get up when the robot has fallen over. It monitors the robot to see when it is lying down and has been relatively still for the past n frames before triggering a getup action.

Usage

Emit a message::plan::GetUpWhenFallen as a Task. Make sure that it has higher challenge priority than other recovery related tasks such as falling relax! If relax has higher priority it may trigger mid getup

Consumes

  • message::input::Sensors to determine when the robot is in an appropriate state to get up
  • message::plan::GetUpWhenFallen as a Task to activate this module to watch for when to run a getup

Emits

  • message::skill::GetUp as a task to trigger a get up action when appropriate

Dependencies

  • A module that can provide GetUp

PlanKick

Description

The module plans when to kick the ball, using information about the position of the ball relative to the robot and where the robot would like to kick to. It only uses recent ball measurements.

It checks

  1. If the robot is close enough to the ball.
  2. If the robot is facing the ball.
  3. If the robot is facing the target to kick to.

If these checks pass, it will emit a Kick Task, specifying the leg to kick with based on which foot the ball is closer to.

There are configuration values that allow some flexibility with this method.

  1. The third check can be skipped with the align configuration value.
  2. A particular kick leg can be forced instead of checking the position using the kick_leg configuration value.

Usage

Emit a KickTo Task with the position to kick to. The contents of the message (position to kick to) is not important if the align configuration value is set to false. The reaction requires localisation ball measurements.

Consumes

  • message::planning::KickTo a signal to kick the ball when conditions are met, with the location to kick the ball to in the message.
  • message::localisation::Ball for information on where the ball is.

Emits

  • message::skill::Kick a signal to execute a kick movement, containing information on what leg to kick with.

Dependencies

  • The reaction will not run without localisation ball messages.

PlanLook

Description

Plans how to look around. Follows a search pattern to find objects.

Usage

Add this module to your role to make the robot look around when requested.

Consumes

  • message::planning::LookAround a Task requesting to run the search pattern to look around

Emits

  • message::skill::Look a Task requesting to look in a direction
  • message::planning::LookAround a Task requesting to run the search pattern to look around the environment

Dependencies

PlanWalkPath

Description

Plans a walk path based on information given. Three types of walk path planning are in this module

  1. Walking towards a particular point. This uses a point in robot space and walks to it, aligning with the direction to face at the target and avoiding robots. It avoids robots by finding the first robot that intersects with the path, grouping it with any close by robots, then walking to a spot to the left or right of the group. Once its cleared the group, it continues on to either avoid another robot or walk straight to the target
  2. Turn on the spot. Without moving translationally, turn on the spot. Supports both directions.
  3. Rotate around the ball. Rotate such that the ball stays in front of the robot, and the robot turns such that it changes the direction it is aligned towards. Supports both directions.

Usage

Include this module in the role and emit the provide Task for either reaction. The reactions cannot run at the same time, since they both Need the Walk.

Consumes

  • message::planning::WalkTo Task requesting to walk towards a given point.
  • message::planning::TurnOnSpot Task requesting to turn on the spot.
  • message::planning::PivotAroundPoint Task requesting to rotate around the ball, to align with a direction.
  • message::localisation::Robots to find any robots to avoid when path planning to a target.
  • message::input::Sensors to transform robot points into (our own) robot space.

Emits

  • message::skill::Walk Task requesting to run the walk engine, giving the xy velocity (m/s) and rotational velocity (radians/s).

Dependencies

  • The walk engine
  • Mathematics comparison utility
  • Mathematics intersection utility
Modules
Output
Modules
Platform
NUbots acknowledges the traditional custodians of the lands within our footprint areas: Awabakal, Darkinjung, Biripai, Worimi, Wonnarua, and Eora Nations. We acknowledge that our laboratory is situated on unceded Pambalong land. We pay respect to the wisdom of our Elders past and present.
Copyright © 2024 NUbots - CC-BY-4.0
Deploys by Netlify