Multi IMU with their IDs

20 views
Skip to first unread message

7096...@qq.com

unread,
Feb 5, 2016, 8:13:10 AM2/5/16
to libfreespace
Hello,
I want to get data from 2 IMUs and when I ran the Motion_async, I found out that it print 2 IMUs data with their IDS altogether. While I need the individual data from each IMU and have some calculation combining them together. I first try to code like this so I can get only one set of data from one IMU each time but then I found out each time I unplug and plug the IMU again, the ID is different. 
      if (message->messageType == FREESPACE_MESSAGE_MOTIONENGINEOUTPUT) {
        rc = freespace_util_getAcceleration(&(message->motionEngineOutput), &acc);
        if (rc == 0&&id==9) {


            printf ("X: % 6.2f, Y: % 6.2f, Z: % 6.2f\n", acc.x, acc.y, acc.z);
        }
Can anyone helps that if each IMU has its own fixed ID like its name and How can I get it and use it to identify and get the set of data from a IMU of specific ID? 
Thanks a lot.
Wei Zhang

Merrill

unread,
Feb 12, 2016, 10:08:28 AM2/12/16
to libfreespace
Hello Wei,

Sorry for the slow reply.  This got trapped in my spam box for some reason.

Each FSM-9 has a unique Tracking Number, so you can use this to determine which device you are communicating with.  At startup you will probably need to correlate the ID to the tracking number but I think this will solve your issue.

The tracking number is stored in a record system called Flash Record System.  You can see an example about how to read FRS records in the frs_prop_example.c file.  Look at the Tracking Number FRS record which is accessed via the FRS Read Request message inside the function on Line 125 (look at Case 0 of the switch statement).  You should see that each of your devices has a unique Tracking Number and it is stored in persistent flash.

Let me know if I can help with anything else.  Thanks.

-Merrill

7096...@qq.com

unread,
Feb 16, 2016, 6:10:30 AM2/16/16
to libfreespace
Hello  Merrill
Thanks for your help. I will try to combine it later on.
Best regards
Wei Zhang



在 2016年2月12日星期五 UTC+1下午4:08:28,Merrill写道:
Reply all
Reply to author
Forward
0 new messages