@@ -254,7 +254,7 @@ DataAdapter::OutputTables XsensDataReader::extendRead(
254
254
255
255
// Ensure all files have the same size, update rate, and rotation
256
256
// format
257
- std::vector<size_t > line_lengths (imus.size ());
257
+ std::vector<int > line_lengths (imus.size ());
258
258
std::vector<double > update_rates (imus.size ());
259
259
std::vector<std::string> rotation_formats (imus.size ());
260
260
@@ -293,30 +293,29 @@ DataAdapter::OutputTables XsensDataReader::extendRead(
293
293
" format!" );
294
294
295
295
// These have all been checked for uniformity
296
- const size_t n_lines = line_lengths[0 ];
296
+ const int n_lines = line_lengths[0 ];
297
297
const double sampling_rate = update_rates[0 ];
298
298
const std::string rotation_format = rotation_formats[0 ];
299
299
300
300
// Will read data into pre-allocated Matrices in-memory rather than
301
301
// appendRow on the fly to avoid the overhead of
302
- OPENSIM_THROW_IF (n_lines > std::numeric_limits<int >::max (), IOError,
303
- " Too many lines in file to fit in SimTK::Matrix_<T> dimensions." );
304
-
305
- SimTK::Matrix_<SimTK::Quaternion> rotationsData{
306
- static_cast <int >(n_lines), n_imus};
307
- SimTK::Matrix_<SimTK::Vec3> linearAccelerationData{
308
- static_cast <int >(n_lines), n_imus};
309
- SimTK::Matrix_<SimTK::Vec3> magneticHeadingData{
310
- static_cast <int >(n_lines), n_imus};
311
- SimTK::Matrix_<SimTK::Vec3> angularVelocityData{
312
- static_cast <int >(n_lines), n_imus};
313
-
314
- const bool has_acc = std::all_of (imus.begin (), imus.end (),
315
- [&n_lines](const auto & imu) { return imu.acc .size () == n_lines; });
316
- const bool has_gyr = std::all_of (imus.begin (), imus.end (),
317
- [&n_lines](const auto & imu) { return imu.gyr .size () == n_lines; });
318
- const bool has_mag = std::all_of (imus.begin (), imus.end (),
319
- [&n_lines](const auto & imu) { return imu.mag .size () == n_lines; });
302
+ SimTK::Matrix_<SimTK::Quaternion> rotationsData{n_lines, n_imus};
303
+ SimTK::Matrix_<SimTK::Vec3> linearAccelerationData{n_lines, n_imus};
304
+ SimTK::Matrix_<SimTK::Vec3> magneticHeadingData{n_lines, n_imus};
305
+ SimTK::Matrix_<SimTK::Vec3> angularVelocityData{n_lines, n_imus};
306
+
307
+ const bool has_acc =
308
+ std::all_of (imus.begin (), imus.end (), [&n_lines](const auto & imu) {
309
+ return imu.acc .size () == static_cast <std::size_t >(n_lines);
310
+ });
311
+ const bool has_gyr =
312
+ std::all_of (imus.begin (), imus.end (), [&n_lines](const auto & imu) {
313
+ return imu.gyr .size () == static_cast <std::size_t >(n_lines);
314
+ });
315
+ const bool has_mag =
316
+ std::all_of (imus.begin (), imus.end (), [&n_lines](const auto & imu) {
317
+ return imu.mag .size () == static_cast <std::size_t >(n_lines);
318
+ });
320
319
321
320
// We use a vector of row indices to transform over the rows (i.e., the time
322
321
// steps)
@@ -341,15 +340,18 @@ DataAdapter::OutputTables XsensDataReader::extendRead(
341
340
n_imus, SimTK::Vec3 (SimTK::NaN));
342
341
const bool has_quat = std::all_of (
343
342
imus.begin (), imus.end (), [&n_lines](const auto & imu) {
344
- return imu.quat .size () == n_lines;
343
+ return imu.quat .size () ==
344
+ static_cast <std::size_t >(n_lines);
345
345
});
346
346
const bool has_euler = std::all_of (
347
347
imus.begin (), imus.end (), [&n_lines](const auto & imu) {
348
- return imu.euler .size () == n_lines;
348
+ return imu.euler .size () ==
349
+ static_cast <std::size_t >(n_lines);
349
350
});
350
351
const bool has_rot_mat = std::all_of (
351
352
imus.begin (), imus.end (), [&n_lines](const auto & imu) {
352
- return imu.rot_mat .size () == n_lines;
353
+ return imu.rot_mat .size () ==
354
+ static_cast <std::size_t >(n_lines);
353
355
});
354
356
if (has_acc) {
355
357
std::transform (imus.begin (), imus.end (),
0 commit comments