File-By-File
CircleSurrounder

CircleSurrounder

A helper class that simplifies the use of CircleSurround. It holds a Voyager instance and the circle's properties (center and radius) to easily command a robot to move to the edge of the circle.

Methods

CircleSurrounder(Voyager voyager, PointXY center, double radius)

Constructs a new CircleSurrounder instance.

  • voyager: The Voyager instance that will be used to control the robot.
  • center: The center point of the circle to surround.
  • radius: The radius of the circle.

surround()

Calculates the closest point on the circle from the robot's current position and commands the Voyager instance to follow a LinearTrajectory to that point. The robot will orient itself to face the center of the circle.

fastSurround()

Similar to surround(), but it generates and follows a FastTrajectory instead of a LinearTrajectory. This is typically used for quicker, less precise movements.