Post

3 followers Follow
0
Avatar

How do I get IMU data via USB in real time?

Hi,

I try to communicate with the MTi-300 via USB(Xsens converter) using example_mti_receive_data.cpp on Linux(Ubuntu 1604).

But I cannot get data in real time.

When I look at the output, it seems that it is receiving some data at once, not every measurement.
And, it is confirmed from the log data made by the sample program that the data has been correctly acquired in the IMU at 400 Hz.
Is there a way to get data in real time?

kato naoki
0
Avatar

Hello Kato,

This is a known issue that is related to the FTDI drivers of the converter. It was reported earlier by another user here

Unfortunately we do not have a fix for this problem at the moment. Possible workarounds would however be:

  • Use a direct USB cable instead of a USB-to-RS232 converter cable;
  • Lower the output data rate of the MTi - this will decrease/eliminate the buffering effect;
  • Make use of the MTi timestamps instead of the Linux timestamps for your calculations.
Steven Gies 0 votes
Comment actions Permalink
0
Avatar

Hi Steven,

 

Thank you for your reply.

And sorry I missed the post.

 

I want to get data in real time and as frequently as possible.

Am I correct in understanding that  "using direct USB cable or Serial communication" is the most likely?

  • Use a direct USB cable instead of a USB-to-RS232 converter cable

If so, I'll try it first.

 

Best Regards,

kato naoki 0 votes
Comment actions Permalink
0
Avatar

Hello Kato,

Yes, if you have a direct USB cable available for the MTi then that should already reduce the buffering or eliminate it. 

Steven Gies 0 votes
Comment actions Permalink
0
Avatar

Not sure if this is still relevant to you but I post here for future readers.

I was able to fix the "chunk" output problem using the USB-to-RS232 cable by setting the USB port to low latency mode.

In Ubuntu 16.04 (probably applicable to other versions as well):

1. install setserial if not already

2. command line: setserial /path/to/xsens/port low_latency

Remember that you have to reset the USB to low latency mode after rebooting so you might want to create an udev rule to avoid that.

For Windows, I got this answer from Scott:

 

Tuan Le 0 votes
Comment actions Permalink
0
Avatar

Hello Tuan Le,

Thank you for sharing this. I can confirm that this greatly reduces the buffering effect on Linux machines. 

Steven Gies 0 votes
Comment actions Permalink
0
Avatar

Hello Steven, Tuan

 

Sorry for the late reply.

Thank you for your very attractive proposal.
I would like to try that way again.

Thank you again.

 

Best Regards,

 

kato naoki 0 votes
Comment actions Permalink

Please sign in to leave a comment.

6 comments