Class FieldObject2d
java.lang.Object
edu.wpi.first.wpilibj.smartdashboard.FieldObject2d
- All Implemented Interfaces:
AutoCloseable
public class FieldObject2d extends Object implements AutoCloseable
Game field object on a Field2d.
-
Method Summary
Modifier and Type Method Description void
close()
Pose2d
getPose()
Get the pose.List<Pose2d>
getPoses()
Get multiple poses.void
setPose(double xMeters, double yMeters, Rotation2d rotation)
Set the pose from x, y, and rotation.void
setPose(Pose2d pose)
Set the pose from a Pose object.void
setPoses(Pose2d... poses)
Set multiple poses from a list of Pose objects.void
setPoses(List<Pose2d> poses)
Set multiple poses from a list of Pose objects.void
setTrajectory(Trajectory trajectory)
Sets poses from a trajectory.
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
setPose
Set the pose from a Pose object.- Parameters:
pose
- 2D pose
-
setPose
Set the pose from x, y, and rotation.- Parameters:
xMeters
- X location, in metersyMeters
- Y location, in metersrotation
- rotation
-
getPose
Get the pose.- Returns:
- 2D pose
-
setPoses
Set multiple poses from a list of Pose objects. The total number of poses is limited to 85.- Parameters:
poses
- list of 2D poses
-
setPoses
Set multiple poses from a list of Pose objects. The total number of poses is limited to 85.- Parameters:
poses
- list of 2D poses
-
setTrajectory
Sets poses from a trajectory.- Parameters:
trajectory
- The trajectory from which the poses should be added.
-
getPoses
Get multiple poses.- Returns:
- list of 2D poses
-