I wired up PIX4FLOW to my test rig, knocked together some test code, set up the I2C baudrate to 400kbps to make sure it worked at the same rate as the IMU needs.
I took it for a walk around the garden: from the office to the garden via the hallway, then an anticlockwise 6m diameter circle around the garden before returning back to the office. The code was sampling at about 20Hz, with the test rig about 60cm from the ground with the Y axis always pointing away from me. The walk took about 80s.
Here’s the X, Y distance graph based upon integrating the velocities the PIX4FLOW gives.
A quick walk through:
- 0,0 is in the office
- throughout the test the Y axis pointed away from me
- beyond the 4m point, I walked in an anti-clockwise circle
- once complete I doubled back and headed back to the office.
I’m delighted with the garden section; because the y axis was always facing forwards, from the PX4FLOW point of view, it always went forwards, but when transformed to the earth frame using the gyro readings, it shows a really accurate plot shape. Given this was just a green grass surface, I’m amazed the down facing camera did such a good job
Here’s the height graph from the inbuilt URF:
It’s good except for the spikes – I may need LEDDAR to make this better. On the plus side, the height is not integrated, so the spikes do not have a persistent effect.
There were a few problems or inaccuracies:
- the sensors should timestamp each read, but the register value did not change so I had to do this myself with time.time() – I have a second sensor on the way to see if it’s the sensors faul (ebay PX4FLOW to find them)
- the scale of the circle is wrong: the graph shows the circle to be about 3m diameter, but it should be more like 6m – this may just be a problem in my maths
- the end of the walk should return to the start, yet it’s 6m out – the shape of the walk out of and back to the office match, but there’s a 30° error by the end of the flight. I suspect only compass will fix this.
One unexpected positive was that although I’ve heard the I2C SMBus only supports 32 byte buffers, it seemed fine reading the 77 byte registers in a single sequence.
Overall then as a first trial I’m pretty delighted to the extent it’s now worth getting the new PCB for Chloe / Hermione.