WPILibC++  2020.3.2
TrajectoryUtil.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2019 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <string>
11 
12 #include <wpi/StringRef.h>
13 #include <wpi/Twine.h>
14 
15 #include "frc/trajectory/Trajectory.h"
16 
17 namespace frc {
19  public:
20  TrajectoryUtil() = delete;
21 
30  static void ToPathweaverJson(const Trajectory& trajectory,
31  const wpi::Twine& path);
39  static Trajectory FromPathweaverJson(const wpi::Twine& path);
40 
48  static std::string SerializeTrajectory(const Trajectory& trajectory);
49 
58 };
59 } // namespace frc
frc::TrajectoryUtil::DeserializeTrajectory
static Trajectory DeserializeTrajectory(wpi::StringRef json_str)
Serializes a Trajectory to PathWeaver-style JSON.
frc::TrajectoryUtil::ToPathweaverJson
static void ToPathweaverJson(const Trajectory &trajectory, const wpi::Twine &path)
Exports a Trajectory to a PathWeaver-style JSON file.
frc::TrajectoryUtil::SerializeTrajectory
static std::string SerializeTrajectory(const Trajectory &trajectory)
Deserializes a Trajectory from PathWeaver-style JSON.
frc::TrajectoryUtil::FromPathweaverJson
static Trajectory FromPathweaverJson(const wpi::Twine &path)
Imports a Trajectory from a PathWeaver-style JSON file.
frc::TrajectoryUtil
Definition: TrajectoryUtil.h:18
wpi::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
frc::Trajectory
Represents a time-parameterized trajectory.
Definition: Trajectory.h:34
frc
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
wpi::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:85