step.motion.custom_velocity

Motion step driven by a user-supplied velocity function.

Each update cycle the function is called with the current robot and dt; it returns (vx, vy, omega) as fractions of each axis’s configured max velocity (-1.0 to 1.0) and these are scaled before being forwarded to the drive velocity controller. Stops when the optional stop condition triggers or when an external combinator (e.g. do_until_checkpoint) cancels it.

Attributes

VelocityFn

Classes

CustomVelocity

Motion step driven by a user-supplied velocity function.

Module Contents

step.motion.custom_velocity.VelocityFn
class step.motion.custom_velocity.CustomVelocity(velocity_fn: VelocityFn, until: raccoon.step.condition.StopCondition | None = None)

Bases: step.motion.motion_step.MotionStep

Motion step driven by a user-supplied velocity function.

Each update cycle velocity_fn(robot, dt) is called and the returned (vx_pct, vy_pct, omega_pct) fractions (-1.0 to 1.0) are multiplied by the configured max velocities for each axis before being applied to the drive velocity controller. The loop runs until the optional until condition fires, at which point the base MotionStep calls on_stop and executes robot.drive.hard_stop().

on_start(robot: raccoon.robot.api.GenericRobot) None
on_update(robot: raccoon.robot.api.GenericRobot, dt: float) bool