11 Replies Latest reply on Jul 31, 2018 12:08 PM by Intel Corporation

    Adding LeddarOne Driver to PX4 Firmware for Intel Aero

    TimChang28

      Following the response to 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 this document and then proceeded to download the source code as instructed here. In the LeddarOne setup page, under the Additional Setup section, it states "LeddarOne is present if the build configuration includes drivers/distance_sensor or drivers/distance_sensor/leddar_one (check using 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.

       

      Thanks,

      Tim

        • 1. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello Tim,

          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!

          Thank you,
          Eliza

          • 2. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
            TimChang28

            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).

             

            IMG_20180628_094834[1].jpg

             

            In terms of upgrading the Firmware through QGroundControl, I am not sure how to follow the 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?

             

            Thanks,

            Tim

            • 3. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hello Tim,

              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!
              Eliza

              • 4. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                Coline

                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.

                • 5. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                  TimChang28

                  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.

                  • 6. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                    Coline

                    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.

                    • 7. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                      edmyers

                      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

                      • 8. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                        TimChang28

                        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

                        • 9. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                          Intel Corporation
                          This message was posted on behalf of Intel Corporation

                          Hello Tim,

                          Please do the following changes on QGroundControl Parameters and let me know if after that you are able to switch to position control: 

                          • SYS_MC_ESG_GROUP=1 - reboot if it's not already set to value 1 
                          • LPE_GPS_ON=0 - reboot
                          Looking forward to your reply!

                          Regards,
                          Eliza
                          • 10. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                            TimChang28

                            Hi Eliza,

                            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 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.
                            
                            • 11. Re: Adding LeddarOne Driver to PX4 Firmware for Intel Aero
                              Intel Corporation
                              This message was posted on behalf of Intel Corporation

                              Hi Tim,

                              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. 

                              Regards,
                              Jesus