Hello,
Randy Mackay suggested this work would be of interest to the developers group.
In moving a research system to a Navio+ Raspberry Pi 2 platform things have gone well until I got to the Pulsedlight Lidar
Lite sensor and the PX4Flow sensor. The Lidar now works acceptably once the i2c bus speed was reduced to 100kHz. Please see
However the PX4Flow still refuses to behave.
Two issues are apparent:
1. The i2c reads don't produce real data.
The integral read starting at register 0x16 produces fixed arbitrary numbers.
The sum read starting at register 0x0 produces a random sonar_interval reading and zeros otherwise.
I based the AP_OpticalFlowNavio driver on a combination of the working Lidar driver for the i2c HAL structures with Randy's
PX4Flow.h and the Arduino PX4Flow library providing data structure guidance. After trying various delays then double checking
sensor initialisation and address/register values the above results still stand. Checking for the presence of the sensor using
i2cdetect shows its presence at the correct address.
In order to check that the PX4Flow writes correctly to i2c I used the Arduino library and an Arduino Uno to act as a hardware
intermediary. While the register 0x16 read (updateIntegral) doesn't appear to work the register 0x0 read works just fine.
Hooking this test rig up to the Navio via a USB (ttyACM0) brings me to the second issue.
2. With working PX4Flow data being provided via a USB serial driver I am able to populate the backend "state" struct. Currently
this is running reliably at 2Hz. However the data doesn't appear to go any further up the software stack. Although I'm still
digging.
Following Randy's advice I moved to the current ardupilot-master and repeated the above work.
Apart from loosing the "OpFlow Init Failed." message at first start up, everything else is as reported above.
Randy tells me a number of you are working on UNIX ports at present. I'd be grateful for any advice and suggestions.
Regards,
Martin
The specs of the Navio and software follow.
Linux image used:
Linux navio-rpi 3.18.9-rt5-v7+ #1 SMP PREEMPT RT Thu Mar 26 10:31:34 UTC 2015 armv7l
Source code:
Clone from ardupilot-master 27 July 2015
Built using standard: make -j4 navio
Cross compiler as per Emlid standard build.
ArduCopter:
APM:Copter V3.4-dev ()
Free RAM: 4096
FW Ver: 120
PX4Flow sensor:
v1.3
Firmware updated 27/07/2015 using QCGroundControl
Camera focused to 3 metres as per standard setup instructions.
Optic flow data being delivered to QCGroundControl Analyze screen appears correct and predictable.
Hardware:
Raspberry Pi 2 Model B 1GB
Navio+
I2C bus speed set to 200kHz (PX4Flow supports 100-400 kHz )
Connection type:
I2C standard connector direct to Navio board.
All sensor hardware and connections pre tested using an Arduino based test rig.
No issues reported on test rig.
PX4Flow initialised and tested using USB to QCGroundControl
Power source: USB lead to Navio.
Test targets:
High contrast rich texture external scene.
Natural ambient lighting day time.
Low contrast low texture internal scene
Natural ambient lighting day time.