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¶
Classes¶
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.MotionStepMotion 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 optionaluntilcondition fires, at which point the baseMotionStepcallson_stopand executesrobot.drive.hard_stop().