I have an arduino wired to an MPU6050 breakout board. The arduino continuously collects accelerometer and gyroscope data from the MPU6050 and calculates angle and velocity.

Simply plotting the vector components (x,y,z) of this data does not allow one to reason about the motion of the sensor or robot. It's possible, though not easy, to do sanity checks (Is the sensor oriented as expected? Is gravity working?). But it's very difficult to look at a x,y,z plot of accelerometer log data and imagine what the robot did for instance.

I was wondering if there is some sort of tool or Python library to visualise accelerometer and gyro, or IMU data? (I'm looking for something like this- https://youtu.be/6ijArKE8vKU)

  • 1
    $\begingroup$ Have a look at this question. $\endgroup$ – Jakob Jun 16 '16 at 7:08
  • 1
    $\begingroup$ I think the op is specifically interested in how to visualize the 3D vectors associated with these transducers. I've had the same problem myself in the past and am looking forward to the answers. $\endgroup$ – hauptmech Jun 16 '16 at 8:34
  • $\begingroup$ @hauptmech yes that's exactly what I'm looking for! $\endgroup$ – Shubham Jha Jun 16 '16 at 8:36
  • $\begingroup$ I've added some detail to clarify, let me know if it's enough. Line plots are insufficient for this type of data. When I've tried to deal with this, I usually fire up a heavyweight solution, like ros rviz. Commercial IMU's, ground station software and camera gimbals software often present the data with 3D models animated with the data. youtube.com/watch?v=DtUdlfKq6_U There are approaches to do 3D plots youtube.com/watch?v=6ijArKE8vKU but depending on the size of the dataset and context of the data, there may be better approaches than what first come to mind. $\endgroup$ – hauptmech Jun 17 '16 at 2:26
  • 1
    $\begingroup$ @hauptmech yes. Exactly!! I'm looking for something like this- youtube.com/watch?v=6ijArKE8vKU $\endgroup$ – Shubham Jha Jun 17 '16 at 22:10

I'm sure you've tried this, but if you follow the links in that YouTube video, you'll see that its author has posted the source code. See:

Yes, it's written in MATLAB, but "for anything MATLAB can do, there's a corresponding Python library". :) In particular, you might want to investigate the quaternion package(s) in NumPy -- that's where the magic happens.

That should get you started.

| improve this answer | |
  • $\begingroup$ Do you know how can I count steps via Python? Already, I have the data, but I can not count peaks. $\endgroup$ – Emad Aghayi Nov 16 '17 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.