WPILibC++  2020.3.2-60-g3011ebe
frc::Field2d Class Reference

2D representation of game field (for simulation). More...

#include <Field2d.h>

Public Member Functions

void SetRobotPose (const Pose2d &pose)
 Set the robot pose from a Pose object. More...
 
void SetRobotPose (units::meter_t x, units::meter_t y, Rotation2d rotation)
 Set the robot pose from x, y, and rotation. More...
 
Pose2d GetRobotPose ()
 Get the robot pose. More...
 

Detailed Description

2D representation of game field (for simulation).

In non-simulation mode this simply stores and returns the robot pose.

The robot pose is the actual location shown on the simulation view. This may or may not match the robot's internal odometry. For example, if the robot is shown at a particular starting location, the pose in this class would represent the actual location on the field, but the robot's internal state might have a 0,0,0 pose (unless it's initialized to something different).

As the user is able to edit the pose, code performing updates should get the robot pose, transform it as appropriate (e.g. based on simulated wheel velocity), and set the new pose.

Member Function Documentation

◆ GetRobotPose()

Pose2d frc::Field2d::GetRobotPose ( )

Get the robot pose.

Returns
2D pose

◆ SetRobotPose() [1/2]

void frc::Field2d::SetRobotPose ( const Pose2d pose)

Set the robot pose from a Pose object.

Parameters
pose2D pose

◆ SetRobotPose() [2/2]

void frc::Field2d::SetRobotPose ( units::meter_t  x,
units::meter_t  y,
Rotation2d  rotation 
)

Set the robot pose from x, y, and rotation.

Parameters
xX location
yY location
rotationrotation

The documentation for this class was generated from the following file: