LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
squiggles Namespace Reference

Copyright 2020 Jonathan Bayless. More...

Classes

struct  Constraints
 
class  ControlVector
 
class  PassthroughModel
 
class  PhysicalModel
 
class  Pose
 
struct  ProfilePoint
 
class  QuinticPolynomial
 
class  SplineGenerator
 
class  TankModel
 

Functions

int serialize_path (std::ostream &out, std::vector< ProfilePoint > path)
 Writes the path data to a CSV file.
 
std::optional< std::vector< ProfilePoint > > deserialize_path (std::istream &in)
 Converts CSV data into a path.
 
std::optional< std::vector< ProfilePoint > > deserialize_pathfinder_path (std::istream &left, std::istream &right)
 Converts CSV data from the Pathfinder library's format to a Squiggles path.
 
template<class T >
int sgn (T v)
 Returns the sign value of the given value.
 
bool nearly_equal (const double &a, const double &b, double epsilon=1e-5)
 

Detailed Description

Copyright 2020 Jonathan Bayless.

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

Function Documentation

◆ deserialize_path()

std::optional< std::vector< ProfilePoint > > squiggles::deserialize_path ( std::istream &  in)

Converts CSV data into a path.

Parameters
inThe input stream containing the CSV data. This is usually a file.
Returns
The path specified by the CSV data or std::nullopt if de-serializing the path was unsuccessful.

◆ deserialize_pathfinder_path()

std::optional< std::vector< ProfilePoint > > squiggles::deserialize_pathfinder_path ( std::istream &  left,
std::istream &  right 
)

Converts CSV data from the Pathfinder library's format to a Squiggles path.

NOTE: this code translates data from Jaci Brunning's Pathfinder library. The source for that library can be found at: https://github.com/JaciBrunning/Pathfinder/

Parameters
leftThe input stream containing the left wheels' CSV data. This is usually a file.
rightThe input stream containing the right wheels' CSV data. This is usually a file.
Returns
The path specified by the CSV data or std::nullopt if de-serializing the path was unsuccessful.

◆ nearly_equal()

bool squiggles::nearly_equal ( const double &  a,
const double &  b,
double  epsilon = 1e-5 
)
inline

Definition at line 25 of file utils.hpp.

◆ serialize_path()

int squiggles::serialize_path ( std::ostream &  out,
std::vector< ProfilePoint path 
)

Writes the path data to a CSV file.

Parameters
outThe output stream to write the CSV data to. This is usually a file.
pathThe path to serialized
Returns
0 if the path was serialized succesfully or -1 if an error occurred.

◆ sgn()

template<class T >
int squiggles::sgn ( v)
inline

Returns the sign value of the given value.

Returns
1 if the value is positive, -1 if the value is negative, and 0 if the value is 0.

Definition at line 20 of file utils.hpp.