WPILibC++ 2024.3.2
frc::TrajectoryUtil Class Reference

Trajectory utilities. More...

#include <frc/trajectory/TrajectoryUtil.h>

Public Member Functions

 TrajectoryUtil ()=delete
 

Static Public Member Functions

static void ToPathweaverJson (const Trajectory &trajectory, std::string_view path)
 Exports a Trajectory to a PathWeaver-style JSON file. More...
 
static Trajectory FromPathweaverJson (std::string_view path)
 Imports a Trajectory from a JSON file exported from PathWeaver. More...
 
static std::string SerializeTrajectory (const Trajectory &trajectory)
 Deserializes a Trajectory from JSON exported from PathWeaver. More...
 
static Trajectory DeserializeTrajectory (std::string_view jsonStr)
 Serializes a Trajectory to PathWeaver-style JSON. More...
 

Detailed Description

Trajectory utilities.

Constructor & Destructor Documentation

◆ TrajectoryUtil()

frc::TrajectoryUtil::TrajectoryUtil ( )
delete

Member Function Documentation

◆ DeserializeTrajectory()

static Trajectory frc::TrajectoryUtil::DeserializeTrajectory ( std::string_view  jsonStr)
static

Serializes a Trajectory to PathWeaver-style JSON.

Parameters
jsonStrthe string containing the serialized JSON
Returns
the trajectory represented by the JSON

◆ FromPathweaverJson()

static Trajectory frc::TrajectoryUtil::FromPathweaverJson ( std::string_view  path)
static

Imports a Trajectory from a JSON file exported from PathWeaver.

Parameters
pathThe path of the json file to import from.
Returns
The trajectory represented by the file.

◆ SerializeTrajectory()

static std::string frc::TrajectoryUtil::SerializeTrajectory ( const Trajectory trajectory)
static

Deserializes a Trajectory from JSON exported from PathWeaver.

Parameters
trajectorythe trajectory to export
Returns
the string containing the serialized JSON

◆ ToPathweaverJson()

static void frc::TrajectoryUtil::ToPathweaverJson ( const Trajectory trajectory,
std::string_view  path 
)
static

Exports a Trajectory to a PathWeaver-style JSON file.

Parameters
trajectorythe trajectory to export
paththe path of the file to export to

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