OpenSim Moco
0.1.0-preprint
Solve optimal control problems with OpenSim models
|
This class describes a workflow for processing a table using TableOperators.
The user must provide a source table either as a filepath to a table or an in-memory TimeSeriesTable. In C++, one can easily chain together the operators in a processor using the C++ pipe operator:
#include <Moco/Moco/Common/TableProcessor.h>
Public Member Functions | |
OpenSim_DECLARE_PROPERTY (filepath, std::string, "File path to a TimeSeriesTable.") | |
OpenSim_DECLARE_LIST_PROPERTY (operators, TableOperator, "Operators to apply to the source table of this processor.") | |
TableProcessor () | |
This constructor is only for use when reading (deserializing) from an XML file. | |
TableProcessor (TimeSeriesTable table) | |
Use an in-memory TimeSeriesTable as the source table. More... | |
TableProcessor (std::string filepath) | |
Use a filepath as the source table. More... | |
TimeSeriesTable | process (std::string relativeToDirectory, const Model *model=nullptr) const |
Process and obtain the table. More... | |
TimeSeriesTable | process (const Model *model=nullptr) const |
Same as above, but paths are evaluated with respect to the current working directory. | |
bool | empty () const |
Returns true if neither a filepath nor an in-memory table have been provided. | |
TableProcessor & | append (const TableOperator &op) |
Append an operation to the end of the operations in this processor. | |
TableProcessor & | append (const TableProcessor &traj) |
Append all operations in another processor to this processor. More... | |
TableProcessor & | operator| (const TableOperator &right) |
This operator allows one to write the following code in C++: More... | |
|
inline |
Use an in-memory TimeSeriesTable as the source table.
Since this constructor is not explicit, you can provide a TimeSeriesTable to any function that takes a TableProcessor (in C++).
|
inline |
Use a filepath as the source table.
Since this constructor is not explicit, you can provide a string filepath to any function that takes a TableProcessor.
|
inline |
Append all operations in another processor to this processor.
The source table of the provided trajectory is ignored.
|
inline |
This operator allows one to write the following code in C++:
|
inline |
Process and obtain the table.
If a filepath is provided, it will be evaluated relative relativeToDirectory
. If a model is provided, it is used to convert columns from degrees to radians (if the table has a header with inDegrees=yes) before any operations are performed. This model is accessible by any TableOperators that require it.