PathPlannerLib
Loading...
Searching...
No Matches
JSONUtil.h
1#pragma once
2
3#include <wpi/json.h>
4#include <frc/geometry/Translation2d.h>
5
6namespace pathplanner {
7
8namespace JSONUtil {
9
16inline frc::Translation2d translation2dFromJson(
17 wpi::json::const_reference translationJson) {
18 auto x = units::meter_t { translationJson.at("x").get<double>() };
19 auto y = units::meter_t { translationJson.at("y").get<double>() };
20 return frc::Translation2d(x, y);
21}
22
23}
24
25}