Hi Grace,
Apologies for not responding to your original post, but glad that you can load the trajectory now.
You're not getting the orientation signals because orientations are of type Quaternion, but you're using the 'analyzeVec3' utility, which will only extract a TimeSeriesTableVec3 (a table of Vec3 values). We currently don't have an equivalent 'analyzeQuaternion', so you'll have to get them via the AnalyzeTool or create the table yourself.
Regarding the AnalyzeTool, if you don't specify the controls from your simulation to the model when computing accelerations, you will get different results. (This is because the model has to realize to Stage::Acceleration within the AnalyzeTool, which requires realizing to Stage::Dynamics first. In Stage::Dynamics, all the model forces are computed, include those associated with model controls.) However, you can enable the following flag to compute the correct accelerations when controls are unknown:
Code: Select all
IMUDataReporter IMUs;
// other calls to setup your IMUDataReporter here
IMUs.set_compute_accelerations_without_forces(true);
analyzeIMU.updAnalysisSet().cloneAndAppend(IMUs);
For some reason, MocoAngularVelocityTrackingGoal has not been added to scripting, so currently you won't be able to access it via Matlab or Python. Sorry about that, but thanks for pointing out the bug. We'll add it in for the next OpenSim release.
Lastly, for setting up MocoOrientationTrackingGoal, you have this line:
Code: Select all
IMUOrient.setRotationReference(rotations);
but I think you meant to use the TimeSeriesTableQuaternion 'orientSignals' here? I'm not sure what type 'rotations' is, but it's not the correct type for this goal (TimeSeriesTableQuaternion).
I have noticed the column labels for the frame paths are different and not grouped by IMU and was wondering if this was the issue and if so if there was a relatively simple method to reorder and rename these?
I'm not sure exactly what you mean here, but the order of the columns in the tracking reference doesn't matter as long as the labels are correct. But if you think you need to reorder/rename columns, you can use `table.getColumnLabels()`, `table.setColumnLabels(labels)`, `table.removeColumn(label)`, `table.appendColumn(label, columnData)`, etc.
Best,
-Nick