step.motion.arc

Classes

Arc

Step wrapper around the native ArcMotion controller.

DriveArcLeft

Drive along a circular arc curving to the left.

DriveArcRight

Drive along a circular arc curving to the right.

DriveArc

Drive along a circular arc with explicit direction (internal use only).

StrafeArcLeft

Strafe along a circular arc curving to the left.

StrafeArcRight

Strafe along a circular arc curving to the right.

StrafeArc

Strafe along a circular arc with explicit direction (internal use only).

Module Contents

class step.motion.arc.Arc(config: raccoon.motion.ArcMotionConfig)

Bases: step.motion.motion_step.MotionStep

Step wrapper around the native ArcMotion controller.

config
to_simulation_step() step.SimulationStep

Convert this step to a simulation-friendly summary.

The default implementation uses timing history only when it can query the tracker synchronously; otherwise it returns conservative defaults. Override in subclasses that know their motion delta or exact duration.

on_start(robot: raccoon.robot.api.GenericRobot) None

Called once before the loop. Override to set up motion/velocity.

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

Called each cycle with dt in seconds. Return True when motion is complete.

class step.motion.arc.DriveArcLeft(radius_cm: float, degrees: float, speed: float = 1.0)

Bases: Arc

Drive along a circular arc curving to the left.

The robot drives forward while simultaneously turning counter-clockwise, tracing a circular arc of the given radius. The motion completes when the robot has turned by the specified number of degrees.

Parameters:
  • radius_cm – Turning radius in centimeters (center of arc to robot center).

  • degrees – Arc angle in degrees (how much the robot turns).

  • speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).

Returns:

A DriveArcLeft step configured for a left (CCW) arc.

Example:

from raccoon.step.motion import drive_arc_left

# Quarter-circle left with 30 cm radius
drive_arc_left(radius_cm=30, degrees=90)

# Gentle wide arc at half speed
drive_arc_left(radius_cm=50, degrees=45, speed=0.5)
class step.motion.arc.DriveArcRight(radius_cm: float, degrees: float, speed: float = 1.0)

Bases: Arc

Drive along a circular arc curving to the right.

The robot drives forward while simultaneously turning clockwise, tracing a circular arc of the given radius. The motion completes when the robot has turned by the specified number of degrees.

Parameters:
  • radius_cm – Turning radius in centimeters (center of arc to robot center).

  • degrees – Arc angle in degrees (how much the robot turns).

  • speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).

Returns:

A DriveArcRight step configured for a right (CW) arc.

Example:

from raccoon.step.motion import drive_arc_right

# Quarter-circle right with 30 cm radius
drive_arc_right(radius_cm=30, degrees=90)
class step.motion.arc.DriveArc(radius_cm: float, degrees: float, speed: float = 1.0)

Bases: Arc

Drive along a circular arc with explicit direction (internal use only).

Positive degrees = counter-clockwise (left), negative = clockwise (right).

class step.motion.arc.StrafeArcLeft(radius_cm: float, degrees: float, speed: float = 1.0)

Bases: Arc

Strafe along a circular arc curving to the left.

The robot strafes laterally (to the right) while simultaneously turning counter-clockwise, tracing a circular arc of the given radius. The motion completes when the robot has turned by the specified number of degrees.

Internally uses a profiled PID on heading and derives the lateral velocity from the angular velocity command: vy = |omega| * radius. This produces coordinated acceleration along the arc.

Prerequisites:

Requires a mecanum or omni-wheel drivetrain capable of lateral motion.

Parameters:
  • radius_cm – Turning radius in centimeters (center of arc to robot center).

  • degrees – Arc angle in degrees (how much the robot turns).

  • speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).

Returns:

A StrafeArcLeft step configured for a left (CCW) strafe arc.

Example:

from raccoon.step.motion import strafe_arc_left

# Quarter-circle strafe arc to the left with 30 cm radius
strafe_arc_left(radius_cm=30, degrees=90)

# Gentle wide strafe arc at half speed
strafe_arc_left(radius_cm=50, degrees=45, speed=0.5)
class step.motion.arc.StrafeArcRight(radius_cm: float, degrees: float, speed: float = 1.0)

Bases: Arc

Strafe along a circular arc curving to the right.

The robot strafes laterally (to the left) while simultaneously turning clockwise, tracing a circular arc of the given radius. The motion completes when the robot has turned by the specified number of degrees.

Internally uses a profiled PID on heading and derives the lateral velocity from the angular velocity command: vy = |omega| * radius. This produces coordinated acceleration along the arc.

Prerequisites:

Requires a mecanum or omni-wheel drivetrain capable of lateral motion.

Parameters:
  • radius_cm – Turning radius in centimeters (center of arc to robot center).

  • degrees – Arc angle in degrees (how much the robot turns).

  • speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).

Returns:

A StrafeArcRight step configured for a right (CW) strafe arc.

Example:

from raccoon.step.motion import strafe_arc_right

# Quarter-circle strafe arc to the right with 30 cm radius
strafe_arc_right(radius_cm=30, degrees=90)
class step.motion.arc.StrafeArc(radius_cm: float, degrees: float, speed: float = 1.0)

Bases: Arc

Strafe along a circular arc with explicit direction (internal use only).

Positive degrees = counter-clockwise (left), negative = clockwise (right).