FieldObject2d
- class wpilib.FieldObject2d
Bases:
pybind11_objectGame field object on a Field2d.
- get_pose() wpimath._wpimath.Pose2d
Get the pose.
- Returns:
2D pose, or 0,0,0 if unknown / does not exist
- get_poses() list[wpimath._wpimath.Pose2d]
Get multiple poses.
- Returns:
vector of 2D poses
- set_pose(*args, **kwargs)
Overloaded function.
set_pose(self: wpilib._wpilib.FieldObject2d, pose: wpimath._wpimath.Pose2d) -> None
Set the pose from a Pose object.
- Parameters:
pose – 2D pose
set_pose(self: wpilib._wpilib.FieldObject2d, x: wpimath.units.meters, y: wpimath.units.meters, rotation: wpimath._wpimath.Rotation2d) -> None
Set the pose from x, y, and rotation.
- Parameters:
x – X location
y – Y location
rotation – rotation
- set_poses(poses: List[wpimath._wpimath.Pose2d]) None
Set multiple poses from an array of Pose objects. The total number of poses is limited to 85.
- Parameters:
poses – array of 2D poses
- set_trajectory(*args, **kwargs)
Overloaded function.
set_trajectory(self: wpilib._wpilib.FieldObject2d, trajectory: wpimath._wpimath.DifferentialTrajectoryBase) -> None
Sets poses from a trajectory.
- Parameters:
trajectory – The trajectory from which poses should be added.
set_trajectory(self: wpilib._wpilib.FieldObject2d, trajectory: wpimath._wpimath.DrivetrainSplineTrajectoryBase) -> None
Sets poses from a trajectory.
- Parameters:
trajectory – The trajectory from which poses should be added.
set_trajectory(self: wpilib._wpilib.FieldObject2d, trajectory: wpimath._wpimath.HolonomicTrajectoryBase) -> None
Sets poses from a trajectory.
- Parameters:
trajectory – The trajectory from which poses should be added.