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
lower_to_segments() list
on_start(robot: raccoon.robot.api.GenericRobot) None
on_update(robot: raccoon.robot.api.GenericRobot, dt: float) bool
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 (default 1.0). The sign sets the travel direction: positive drives the arc forwards, negative drives it backwards along the same circle (the arc centre stays on the same side, the robot reverses and its heading turns the opposite way). The magnitude is clamped to [0.01, 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 (default 1.0). The sign sets the travel direction: positive drives the arc forwards, negative drives it backwards along the same circle (the arc centre stays on the same side, the robot reverses and its heading turns the opposite way). The magnitude is clamped to [0.01, 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 (default 1.0). The sign sets the travel direction: positive drives the arc forwards, negative drives it backwards along the same circle (the arc centre stays on the same side, the robot reverses and its heading turns the opposite way). The magnitude is clamped to [0.01, 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 (default 1.0). The sign sets the travel direction: positive drives the arc forwards, negative drives it backwards along the same circle (the arc centre stays on the same side, the robot reverses and its heading turns the opposite way). The magnitude is clamped to [0.01, 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).