Skip to content

Conversation

@alexbeattie42
Copy link
Contributor

@alexbeattie42 alexbeattie42 commented Nov 13, 2024

Fix IMUDataReporter Missing Import

Brief summary of changes

  • When you consume this class you have to do the following shim to account for the missing import.
#include <OpenSim/Simulation/Model/Model.h> 
#include <OpenSim/Analyses/IMUDataReporter.h>

This adds the missing import to IMUDataReporter.h so you don't have to do this

Testing I've completed

Tested locally

Looking for feedback on...


This change is Reviewable

@aymanhab
Copy link
Member

Why add another header here in the header? typically we try to keep includes to a minimum and have clients of the class include all headers they need to consume it.

@alexbeattie42 alexbeattie42 changed the title Fix IMUDataReporter Missing Import Fix IMU.h Missing Import Nov 14, 2024
@alexbeattie42
Copy link
Contributor Author

The correct place was actually in IMU.h. The model header is necessary since it is being directly used within IMU.h. Without this import the following compiler error is produced.

In member function ‘SimTK::Vec3 OpenSim::IMU::calcGyroscopeSignal(const SimTK::State&) const’:
~/opensim-core/sdk/include/OpenSim/Simulation/OpenSense/IMU.h:84:30: error: invalid use of incomplete type ‘const class OpenSim::Model’
   84 |         const auto& ground = model.getGround();
      |                              ^~~~~

Copy link
Member

@aymanhab aymanhab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Thanks @alexbeattie42

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alexbeattie42)

@alexbeattie42
Copy link
Contributor Author

What is still required to merge this?

@aymanhab aymanhab merged commit 94efbad into opensim-org:main Nov 20, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants