How to use IMU and ultrasonic for precise navigation

Frequent questions asked online, offline, in forums are answered here
Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

How to use IMU and ultrasonic for precise navigation

Postby Briser » Mon Jul 29, 2019 11:26 am

hello!
I have bought a hedgehog with IMU, I want to use IMU and ultrasonic to achieve accurate navigation and combine with Kalman filtering, but I don't know how to do. :|

smoker77
Posts: 239
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to use IMU and ultrasonic for precise navigation

Postby smoker77 » Sat Aug 03, 2019 4:54 pm

Hello,
To use IMU fusion you need to:
1. Enable IMU in 'IMU' settings section for hedgehog in dashboard
2. Execute accelerometer calibration as shown in section 10.9 of the manual:
https://marvelmind.com/pics/marvelmind_ ... manual.pdf
3. Enable output of IMU fusion data - "Processed IMU data" in 'Interfaces' section of hedgehog settings in dashboard

After that, if the map is frozen and hedgehog is tracking, hedgehog will send 100 Hz IMU fusion location data (combined by ultrasonic and IMU measurements) to USB/UART.
See section 1.5 of the protocol:
https://marvelmind.com/pics/marvelmind_ ... rfaces.pdf

The best results with IMU fusion can be achieved in combination with paired beacons feature.

Jason_L
Posts: 6
Joined: Mon Jul 22, 2019 9:28 am

Re: How to use IMU and ultrasonic for precise navigation

Postby Jason_L » Fri Aug 09, 2019 9:38 am

smoker77 wrote:Hello,
To use IMU fusion you need to:
1. Enable IMU in 'IMU' settings section for hedgehog in dashboard
2. Execute accelerometer calibration as shown in section 10.9 of the manual:
https://marvelmind.com/pics/marvelmind_ ... manual.pdf
3. Enable output of IMU fusion data - "Processed IMU data" in 'Interfaces' section of hedgehog settings in dashboard

After that, if the map is frozen and hedgehog is tracking, hedgehog will send 100 Hz IMU fusion location data (combined by ultrasonic and IMU measurements) to USB/UART.
See section 1.5 of the protocol:
https://marvelmind.com/pics/marvelmind_ ... rfaces.pdf

The best results with IMU fusion can be achieved in combination with paired beacons feature.


Hello, smoker77:

similar application on my project, but using two beacons, so I need to discriminate which incoming IMU data belongs to which beacon. I see in section 1.5 the output of IMU data should include the hedgehog address in position 32 , but when I use the the marvelmind. py, the valuesIMUdata does not include the beacon address. Can I add the HedgeAddress variable in code like:

Code: Select all

elif (isImuMessageDetected):
                                      [b] HedgeAdd[/b], x, y, z, qw, qx, qy, qz, vx, vy, vz, ax, ay, az, timestamp, usnCRC16 = struct.unpack_from ('<lllhhhhhhhhhhxxLxxxxH', strbuf, pktHdrOffset + 5)

to let the reply include the address.
My question is what lllhhhhhhhhhhxxLxxxxH means in the code, do i need to make a change to it?
and do I need to connect the second hedge to the computer running the tracking codes via usb cable(Project using one computer tracking two hedgehog position and IMUs data)

smoker77
Posts: 239
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to use IMU and ultrasonic for precise navigation

Postby smoker77 » Fri Aug 09, 2019 6:10 pm

Hello,

Yes, you can modify the Python example for parsing address of the beacon as you have shown.
Current version of our example doesn't include this.
I thing the parsing string should be:
x, y, z, qw, qx, qy, qz, vx, vy, vz, ax, ay, az, HedgeAdr, timestamp, usnCRC16 = struct.unpack_from ('<lllhhhhhhhhhhBxLxxxxH', strbuf, pktHdrOffset + 5)

Note you can get IMU data from two (or more) mobile beacons only via modem, if 'IMU via modem' function is enabled in hedgehog's settings. And the rate of these data will be not 100 Hz but same as update rate of the system (8...16 Hz or less).

100 Hz IMU data can be received only from hedgehog and only for this hedgehog.

Jason_L
Posts: 6
Joined: Mon Jul 22, 2019 9:28 am

Re: How to use IMU and ultrasonic for precise navigation

Postby Jason_L » Tue Aug 13, 2019 11:56 pm

smoker77 wrote:Hello,

Yes, you can modify the Python example for parsing address of the beacon as you have shown.
Current version of our example doesn't include this.
I thing the parsing string should be:
x, y, z, qw, qx, qy, qz, vx, vy, vz, ax, ay, az, HedgeAdr, timestamp, usnCRC16 = struct.unpack_from ('<lllhhhhhhhhhhBxLxxxxH', strbuf, pktHdrOffset + 5)

Note you can get IMU data from two (or more) mobile beacons only via modem, if 'IMU via modem' function is enabled in hedgehog's settings. And the rate of these data will be not 100 Hz but same as update rate of the system (8...16 Hz or less).

100 Hz IMU data can be received only from hedgehog and only for this hedgehog.


Hi smoker77:

Thanks for your reply, I implement the code into the marvelmind.py, did get the hedgeadr in the reply from the hedge, but the hedgeadr is always zero instead the true hedgeadr it should be, please see the reply I got:

Code: Select all

[0.766, -4.003, -1.288, -0.01, 0.2231, -0.9729, 0.0596, 0.028, -0.019, 0.045, 0.479, -0.305, -19.719, [b]0[/b], 1829225]

in which from the last second position should be the hedgeadr.
And can you explain the 'IMU via modem' which I don't find any section in manual explain that. In my understanding, the 'IMU via Modem' means if connected via an USB cable, I can not only get the IMU data from which the USB cable connect to, but also can get the data from other hedges which are not connect via USB cable physically. Am I right?

smoker77
Posts: 239
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to use IMU and ultrasonic for precise navigation

Postby smoker77 » Sat Aug 17, 2019 8:35 pm

Hello,

Yes, it seems now mobile beacon returns 0 in the addess field instead its address.
We will fix this in next software update.
But this is not so meaningful for mobile beacon, because it returns only its own IMU data.
This address field was introduced to separate different mobile beacons with enabled 'IMU via modem' function.
As you said, this allows to receive IMU data of mobile beacons from modem without physycal connection of the beacons via USB.


Return to “FAQ”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests