Copyright 2020 Jonathan Bayless.
More...
|
| 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) |
| |
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.
◆ deserialize_path()
| std::optional< std::vector< ProfilePoint > > squiggles::deserialize_path |
( |
std::istream & |
in | ) |
|
Converts CSV data into a path.
- Parameters
-
| in | The 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
-
| left | The input stream containing the left wheels' CSV data. This is usually a file. |
| right | The 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 |
◆ serialize_path()
| int squiggles::serialize_path |
( |
std::ostream & |
out, |
|
|
std::vector< ProfilePoint > |
path |
|
) |
| |
Writes the path data to a CSV file.
- Parameters
-
| out | The output stream to write the CSV data to. This is usually a file. |
| path | The path to serialized |
- Returns
- 0 if the path was serialized succesfully or -1 if an error occurred.
◆ sgn()
template<class T >
| int squiggles::sgn |
( |
T |
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.