TouristGuest
New member
I'm working with a Vector VN100 IMU using an object-oriented approach on the platform IO, and I'd appreciate some suggestions regarding an issue I'm encountering.
Here's the flow of my program:
Any suggestions on how to resolve this would be greatly appreciated.
For example:
Here's the flow of my program:
- Serial Communication Initialization: The IMU class is initialized with a default baud rate. After flushing old messages from the IMU buffer, the baud rate is increased for faster communication.
- Timer Setup: A timer is configured to send data requests to the IMU at a frequency of 100Hz.
- Data Requesting Mechanism: The program alternates between requesting raw IMU data (accelerometer, gyroscope, etc.) and quaternion data (orientation).
- Data Reception and Parsing: When data is received from the IMU, it parses the strings to extract values like accelerometer readings, gyro data, and quaternion components. All data is saved in a global structure.
Any suggestions on how to resolve this would be greatly appreciated.
For example:
C++:
// This is OK, getData() also calls printData() method
void loop() {
// Print IMU Data
imu = imuSensor->getData();
}
// This print but data is not being updated
void loop() {
// Print IMU Data
imu = imuSensor->getData();
Serial.println(imu.accelX, 6); Serial.print(",");
}