using namespace OpenSim;
using namespace std;
C3DFileAdapter c3dFileAdapter{};
auto tables = c3dFileAdapter.read(filename);
std::shared_ptr<TimeSeriesTableVec3> marker_table = c3dFileAdapter.getMarkersTable(tables);
std::shared_ptr<TimeSeriesTableVec3> force_table = c3dFileAdapter.getForcesTable(tables);
std::shared_ptr<TimeSeriesTable> analog_table = c3dFileAdapter.getAnalogDataTable(tables);
const std::string marker_file = base + "_markers.trc";
const std::string forces_file = base + "_grfs.sto";
const std::string analogs_file = base + "_analog.sto";
TRCFileAdapter trc_adapter{};
trc_adapter.write(*marker_table, marker_file);
force_table->updTableMetaData().setValueForKey("Units",
std::string{"mm"});
STOFileAdapter sto_adapter{};
sto_adapter.write((force_table->flatten()), forces_file);
sto_adapter.write(*analog_table, analogs_file);
|