[examples] Enable NT Flush in Field2d examples (#3013)

This commit is contained in:
Prateek Machiraju
2020-12-30 19:12:15 -05:00
committed by GitHub
parent 78b542737a
commit 8651aa73e8
4 changed files with 17 additions and 1 deletions

View File

@@ -14,6 +14,10 @@
class Robot : public frc::TimedRobot {
public:
void RobotInit() override {
// Flush NetworkTables every loop. This ensures that robot pose and other
// values are sent during every iteration.
SetNetworkTablesFlushEnabled(true);
m_trajectory = frc::TrajectoryGenerator::GenerateTrajectory(
frc::Pose2d(2_m, 2_m, 0_rad), {}, frc::Pose2d(6_m, 4_m, 0_rad),
frc::TrajectoryConfig(2_mps, 2_mps_sq));