rosflight_firmware icon indicating copy to clipboard operation
rosflight_firmware copied to clipboard

IMU timing problem

Open prasgane opened this issue 5 years ago • 7 comments

Hello, I flashed the latest version of ROSFlight onto a Flip32 board and I subscribe to the IMU topic (imu/data) and it looks like the accel values are reporting nan.

Upon closer inspection it looks like the dt used in get_filtered_IMU function is zeros. This could be because the function could be called twice before an IMU transaction occurs. We get a zero dt (and hence a nan accel) every ~5 secs.

I have verified this on two separate boards. This could be happening with the gyro too but we have not verified it. This looks like a big error and we hope you could fix this soon.

prasgane avatar Jul 30 '19 15:07 prasgane

Thanks for reporting this. We'll work on adding a check to make sure this doesn't happen. In addition:

  • We highly recommend switching to an F4 flight controller. The F1 is no longer actively supported
  • Are you streaming IMU at 1000Hz? This timing issue should only happen if you're streaming at full rate. For most applications that's overkill, so you could reduce your IMU streaming rate to something like 250Hz

dpkoch avatar Aug 05 '19 17:08 dpkoch

Thank you for your response.

We were actually streaming the IMU at 500Hz. I dont think the IMU rate is a problem because when we tried running our application with the old firmware (1.2.0) we did not face this issues (even when streaming at 500Hz). So I think there might be problem when the firmware was update.

Additionally, we are also experience problems when closing the loop by publishing to the /command topic. The new firmware causes an erratic behavior for the same code that ran smoothly on 1.2.0.

I am not sure if these two issues are related.

prasgane avatar Aug 05 '19 18:08 prasgane

Interesting. What is the erratic behavior you are seeing?

dpkoch avatar Aug 06 '19 16:08 dpkoch

Erratically meaning, the response is not smooth and the quad flip over.

The quad flies "fine" (the PID gains have to be tuned) when flying manually using an RC controller.

prasgane avatar Aug 07 '19 14:08 prasgane

I can try getting bag file and a video if it helps.

prasgane avatar Aug 08 '19 14:08 prasgane

That would be helpful. Do you also happen to have an F4 board available? I'm curious if the issues you're seeing happen on both boards, or only on the F1.

dpkoch avatar Aug 08 '19 16:08 dpkoch

I'm not sure if this is still an issue, but it's probably worth checking before closing.

bsutherland333 avatar Oct 04 '23 20:10 bsutherland333