Skip to content

Commit 2b8b2df

Browse files
committed
Fix n_imus
1 parent b78d476 commit 2b8b2df

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: OpenSim/Common/XsensDataReader.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,9 @@ DataAdapter::OutputTables XsensDataReader::extendRead(
326326
// For all tables, will create row, stitch values from different
327327
// files then append,time and timestep are based on the first file
328328
std::transform(row_indices.begin(), row_indices.end(), row_indices.begin(),
329-
[&imus, &rotation_format, &n_lines, &has_acc, &has_gyr, &has_mag,
330-
&linearAccelerationData, &magneticHeadingData,
329+
[&imus, &n_imus, &rotation_format, &n_lines, &has_acc, &has_gyr,
330+
&has_mag, &linearAccelerationData, &magneticHeadingData,
331331
&angularVelocityData, &rotationsData](int j) {
332-
const int& n_imus = imus.size();
333332
TimeSeriesTableQuaternion::RowVector orientation_row_vector(
334333
n_imus, SimTK::Quaternion());
335334
TimeSeriesTableVec3::RowVector accel_row_vector(
@@ -399,8 +398,8 @@ DataAdapter::OutputTables XsensDataReader::extendRead(
399398
});
400399

401400
const double timeIncrement = 1.0 / sampling_rate;
402-
const auto times =
403-
createVectorLinspaceInterval(static_cast<int>(n_lines), 0.0, timeIncrement);
401+
const auto times = createVectorLinspaceInterval(
402+
static_cast<int>(n_lines), 0.0, timeIncrement);
404403
// Zero data matrices if the data is not found
405404
if (!has_acc) { linearAccelerationData.resize(0, n_imus); }
406405
if (!has_mag) { magneticHeadingData.resize(0, n_imus); }

0 commit comments

Comments
 (0)