Following the response to /thread/126249 this thread, I have been trying to add the driver to the px4 firmware. The current setup is the Intel Aero running Ubuntu 16.04 on the compute board and PX4 on the flight controller side.
aero-get-version.py returns the following:
BIOS_VERSION = Aero-01.00.16
OS_VERSION = Ubuntu 16.04.4 LTS"
AIRMAP_VERSION = unknown
FPGA_VERSION = 0xc2
AeroFC firmware version = 1.8.0
Initially, I followed the toolchain setup in http://dev.px4.io/en/setup/dev_env_linux_ubuntu.html this document and then proceeded to download the source code as instructed http://dev.px4.io/en/setup/building_px4.html here. In the https://docs.px4.io/en/sensor/leddar_one.html LeddarOne setup page, under the Additional Setup section, it states "LeddarOne is present if the build configuration includes
drivers/distance_sensor/leddar_one (check using https://github.com/PX4/Firmware/search?utf8=%E2%9C%93&q=%22drivers/distance_sensor%22 this search)", but checking that file in the PX4 firmware source code still showed the line "drivers/distance_sensor". I make/built that firmware and uploaded it, and nothing changed, specifically the lack of the parameter to enable the LeddarOne. I remaked/rebuilt the firmware changing that line to "drivers/distance_sensor/leddar_one", and then again adding the line instead of replacing it, and neither changed anything. I am confused as to how this inclusion should change anything if the actual "Leddar driver code" isn't included in the PX4 firmware source code. I probably missed something somewhere so I'd appreciate any help.
Thank you for your interest in the Intel Aero Ready to Fly drone.
When upgrading the Firmware, could you please let me know if you have done it from the Terminal or from QGroundControl? In case you have done it from Terminal and it did not work, could you please check the instructions for Firmware upgrade in QGroundControl from this link: https://docs.qgroundcontrol.com/en/SetupView/Firmware.html ?
Looking forward to your reply!
The entire process to upgrade the firmware was completed from the terminal on the intel aero compute board. After a couple restarts, rebuilds, and playing with the values, the option now exists to enable the LeddarOne in the parameter's menu, although oddly not under the sens_enable tab section. Now the issue is that enabling the sensor still provides no section for distance values in the mavlink inspector widget. I currently have the LeddarOne wired to the telemetry port which is "supposed" to be the standard configuration. How would you go about testing to check the Leddar distance values to show that it's working and wired properly? (I know there's power because the module heats up a decent bit).
In terms of upgrading the Firmware through QGroundControl, I am not sure how to follow the https://docs.qgroundcontrol.com/en/SetupView/Firmware.html instructions you mentioned because it says to leave the device powered off. The usb port on the Aero seems to me to be connected to the compute board and thus won't power the flight controller directly, which would require you to power it on. I'm confused as to how to connect without any power. Is there an additional usb port on the flight controller? Or can you somehow do it over wifi connection?
Thank you for your patience and we apologize for the delay.
Looking at the picture you have provided, I have a question for you. Could you please confirm that TX to RX (Telemetry Pin 5 to LeddarOne Pin 4) and RX to TX (Telemetry Pin 4 to LeddarOne Pin 5)?
Once the sensor is streaming data to Aero Flight controller successfully, the distance value will appear in the qgroundcontrol analyze window.
Thank you in advance!
On that picture it looks like your TX and RX are connected in reverse (RX with RX and TX with TX, instead of RX with TX).
You'll be able to check the value in QGroundControl with the Analyze widget. The value will be displayed under DISTANCE_SENSOR.current_distance if everything is working properly.
Yep, you were right. I switched the two and now it reads very well. Thanks you.
You mentioned in the other thread that you had this working with the px4flow sensor, and I was wondering, in the OPTICAL_FLOW_RAD.distance value, does it show the distance value from the leddarOne? When I initially had the px4flow with the sonar the distance value would show up in the distance value under the optical flow rad category, but with the leddarOne connected now, it just shows 0 [I unplugged the px4flow sonar]. I was wondering if there's a way to link it together or something.
Thank you so much for your responses.
I still have the sonar connected (I didn't want to desolder it) and the optical_flow_rad.distance shows the distance measured by the sonar.
You don't need to link the leddar1 and flow measurement, the PX4 firmware takes care of it. From what I understand the PX4 firmware uses the value published by the distance_sensor and ignores optical_flow_rad.distance.
You need to set SENS_EN_LEDDAR1 = 1 to enable LeddarOne
To find it in QGroundControl search on "LEDDAR" as a search on SENS will not find it.
Also, you need to set:
EKF2_AID_MASK = 2 (note this keeps the GPS input out, if you want GPS to play then use 3)
EKFS_HGT_MODE = 2
Ok, I'm just gonna continue along this thread line. The current setup has not been changed from the last post here so the px4flow is no longer connected. I re-enabled the aero-optical-flow for the bottom facing camera and it is giving me optical_flow_rad quality values between 150 and 200. The LeddarOne is connected successfully and I can read the distance values from it with very little noise. Now my issue is that it won't allow me to switch to position control mode [REJECT POSITION CONTROL]. I've tried moving the UAV by hand and it doesn't change anything. I also noticed that the altitude in the attitude window doesn't change as I move either, not sure if it only works during flight. Is there any prerequisites I might be able to adjust to allow the position control to enable? Should I try switching to the lpe controller....again? Thanks
Please do the following changes on QGroundControl Parameters and let me know if after that you are able to switch to position control:
To start off with, I was under the impression that the LPE was no longer supported and that all position estimation had been moved to ekf2. Anyhow, according to http://discuss.px4.io/t/reject-position-control-pixhawk-2/2435 this thread, AI_B said,
BTW, LPE_GPS_ON is not longer listed by QGC when using the v1.6.0 rc1 firmware (SYS_MC_EST_GROUP set to LPE).
Anyways, I set the SYS_MC_EST_GROUP to 1, restarted the UAV and QGC and LPE_GPS_ON still doesn't show up even in
param show LPE_GPS*
in the nsh Mavlink Console. It does show all the other GPS parameters though:
nsh> param show LPE_GPS*
Symbols: x = used, + = saved, * = unsaved
x LPE_GPS_DELAY [145,314] : 0.2900
x LPE_GPS_VXY [146,315] : 0.2500
x LPE_GPS_VZ [147,316] : 0.2500
x LPE_GPS_XY [148,317] : 1.0000
x LPE_GPS_Z [149,318] : 3.0000
889 parameters total, 494 used.
Aero is using EKF2 as the estimator but PX4 may still support LPE for other products. You may be able to find a more accurate response at the PX4 community. I will go ahead and mark this thread as resolved as your issue with the LiddarOne sensor has been resolved.