step.motion.custom_velocity =========================== .. py:module:: step.motion.custom_velocity .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: step.motion.custom_velocity.VelocityFn Classes ------- .. autoapisummary:: step.motion.custom_velocity.CustomVelocity Module Contents --------------- .. py:data:: VelocityFn .. py:class:: CustomVelocity(velocity_fn: VelocityFn, until: Optional[raccoon.step.condition.StopCondition] = None) Bases: :py:obj:`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()``. .. py:method:: on_start(robot: raccoon.robot.api.GenericRobot) -> None .. py:method:: on_update(robot: raccoon.robot.api.GenericRobot, dt: float) -> bool