Hello all,

         I was trying to compile ArduPlane Code from Arduino IDE. I got following errors: Could you please help me out?

In file included from C:\Users\dawadea\Documents\ardupilot\libraries\AP_Progmem/AP_Progmem.h:5,
from ArduPlane.ino:35:
C:\Users\dawadea\Documents\ardupilot\libraries\AP_HAL/AP_HAL_Boards.h:91:2: error: #error "Unknown CONFIG_HAL_BOARD type"
In file included from C:\Users\dawadea\Documents\ardupilot\libraries\AP_Compass/AP_Compass_HMC5843.h:9,
from C:\Users\dawadea\Documents\ardupilot\libraries\AP_Compass/AP_Compass.h:6,
from ArduPlane.ino:41:
C:\Users\dawadea\Documents\ardupilot\libraries\AP_Compass/Compass.h:37:3: error: #error "You must define a default compass orientation for this board"
In file included from C:\Users\dawadea\Documents\ardupilot\libraries\AP_Notify/AP_Notify.h:22,
from ArduPlane.ino:74:
C:\Users\dawadea\Documents\ardupilot\libraries\AP_Notify/AP_BoardLED.h:64:2: error: #error "Unknown board type in AP_Notify"
In file included from ArduPlane.ino:85:
C:\Users\dawadea\AppData\Local\Temp\build7441579889674349359.tmp\/config.h:128:4: error: #error "CONFIG_BARO not set"
C:\Users\dawadea\AppData\Local\Temp\build7441579889674349359.tmp\/config.h:132:4: error: #error "CONFIG_COMPASS not set"
ArduPlane.ino:216:3: error: #error Unrecognized CONFIG_BARO setting
ArduPlane.ino:226:3: error: #error Unrecognized CONFIG_COMPASS setting
ArduPlane.ino:278:4: error: #error Unrecognised CONFIG_INS_TYPE setting.
ArduPlane.ino:263: error: 'void delay(uint32_t)' was declared 'extern' and later 'static'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:133: error: previous declaration of 'void delay(long unsigned int)'
ArduPlane.ino:265: error: 'uint32_t millis()' was declared 'extern' and later 'static'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:131: error: previous declaration of 'long unsigned int millis()'
ArduPlane.ino:266: error: 'uint32_t micros()' was declared 'extern' and later 'static'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:132: error: previous declaration of 'long unsigned int micros()'
ArduPlane.ino:104: error: 'AP_HAL_BOARD_DRIVER' was not declared in this scope
ArduPlane.ino:285: error: 'ins' was not declared in this scope
ArduPlane.ino:285: error: 'barometer' was not declared in this scope
ArduPlane.ino:706: error: 'barometer' was not declared in this scope
ArduPlane.ino: In function 'void loop()':
ArduPlane.ino:861: error: 'ins' was not declared in this scope
ArduPlane.ino: In function 'void update_compass()':
ArduPlane.ino:952: error: 'compass' was not declared in this scope
ArduPlane.ino: In function 'void compass_accumulate()':
ArduPlane.ino:969: error: 'compass' was not declared in this scope
ArduPlane.ino: In function 'void barometer_accumulate()':
ArduPlane.ino:978: error: 'barometer' was not declared in this scope
ArduPlane.ino: In function 'void compass_save()':
ArduPlane.ino:1087: error: 'compass' was not declared in this scope
ArduPlane.ino: In function 'void update_GPS_10Hz()':
ArduPlane.ino:1179: error: 'compass' was not declared in this scope
ArduPlane.ino: In function 'void update_alt()':
ArduPlane.ino:1472: error: 'barometer' was not declared in this scope
ArduPlane.ino: At global scope:
ArduPlane.ino:1508: error: expected constructor, destructor, or type conversion before ';' token
Attitude.ino: In function 'void stabilize()':
Attitude.ino:347: error: 'barometer' was not declared in this scope
sensors.ino: In function 'void init_barometer()':
sensors.ino:6: error: 'barometer' was not declared in this scope
setup.ino: In function 'int8_t setup_declination(uint8_t, const Menu::arg*)':
setup.ino:353: error: 'compass' was not declared in this scope
setup.ino: In function 'int8_t setup_accel_scale(uint8_t, const Menu::arg*)':
setup.ino:398: error: 'ins' was not declared in this scope
setup.ino: In function 'int8_t setup_compass(uint8_t, const Menu::arg*)':
setup.ino:414: error: 'compass' was not declared in this scope
setup.ino:424: error: 'compass' was not declared in this scope
setup.ino: In function 'void report_compass()':
setup.ino:467: error: 'compass' was not declared in this scope
setup.ino:487: error: 'compass' was not declared in this scope
setup.ino: In function 'void print_accel_offsets_and_scaling()':
setup.ino:611: error: 'ins' was not declared in this scope
setup.ino: In function 'void print_gyro_offsets()':
setup.ino:625: error: 'ins' was not declared in this scope
system.ino: In function 'void init_ardupilot()':
system.ino:116: error: 'barometer' was not declared in this scope
system.ino:170: error: 'compass' was not declared in this scope
system.ino: In function 'void startup_INS_ground(bool)':
system.ino:469: error: 'ins' was not declared in this scope
test.ino: In function 'int8_t test_ins(uint8_t, const Menu::arg*)':
test.ino:432: error: 'ins' was not declared in this scope
test.ino:453: error: 'compass' was not declared in this scope
test.ino: In function 'int8_t test_mag(uint8_t, const Menu::arg*)':
test.ino:485: error: 'compass' was not declared in this scope
test.ino:492: error: 'compass' was not declared in this scope
test.ino:496: error: 'ins' was not declared in this scope
test.ino: In function 'int8_t test_pressure(uint8_t, const Menu::arg*)':
test.ino:592: error: 'barometer' was not declared in this scope

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Thanks Aakash and Randy.  I came to the same conclusion as you, Randy.  There are 25 warnings when I compile with the defaults, about twice that many when I disable the things I don't need.  To me, that's a bazillion. ;-)

  • When I compile, I get a bazillion warnings about variables declared and never defined, or defined but never used.  Is there any reason not to go in and clean those up?

    -Don

    • Developer

      Some warnings are caused by the arduino pre-processor which parses the code and adds function declarations.  It's not smart enough however to recognise when those functions are hidden behind #defines so it tends to create declarations for functions/features that are disabled.  The TradHeli functions are an example of this - we don't need those in the multicopter builds but the pre-processor creates them anyway.

      There are bazillions of them though, maybe 20 or so.  If it's more than that then it's perhaps a different problem like the one Aakash mentions.

      • Randy I was able to upload the 3.2 dev

        and connect via mavlink  was fine

        but when I try use CLI terminal , afterconnect

        and opening port , there was gable message.Tried tos stop by pressing enter , it didn't work

        and I put back older firmware ( stable 3.1.3) become normal. again (terminal and Mavlink fine)

        forgot to tell you when I compiled there was warning

        AP_GPS_SBP.cpp

        and HardwareSerial.cpp

        3702649880?profile=originalThank you

        Naitsuga

    • Hi Don,
      Did you select proper board and comm port?
      Also did you choose correct directory in files->preferences menu?
      Make sure you restart the IDE.
      I hope this helps.
  • Developer

    Aakash,

        You followed the instructions on this wiki page to setup your Arduino environment?

    • Randy

      I was trying to take a chance compiling 3.2 base on the wiki

      the sketch too big

      Binary sketch size is 263,264 bytes (of 258,048 bytes maximum)

      attached my APM_config.h

      Can you take a look

      Thank you very much





      • Developer

        Naitsuga,Yes the code is too big to fit on the apm2 now.  Try disabling optical flow.  It's in that list of features.  If that fails just try disabling even more features until it fits.

        • Randy

          Thank you for your response

          Is it the optical flow disabled by default?

          I did disable gimbal , camera trigger , sonar ?

          need about 5K lesser now

          and will disable fence

          and can I disable the HIL with

          #define HIL_MODE HIL_MODE_DISABLED

          and also I'm flying TBS will the V tail  is hard coded and as an option at the library?

          and just check it at the MP?

          and I believe I can't define APM2 in this config

          #define CONFIG_APM_HARDWARE APM_HARDWARE_APM2

          is this correct?

          So let //#define FRAME_CONFIG QUAD_FRAME commented ?

          at the option will be pick at the MP?

          could you help to take a look of my define (attached ) especially for HIL_MODE_DISABLED

          Thank you

          Naitsuga

          APM_Config.h

          https://storage.ning.com/topology/rest/1.0/file/get/3702756122?profile=original
          • Developer

            Naitsuga,

                You know, i've just tried compiling master and it's 245,298 bytes.  That should fit on an APM2.  I wonder if maybe you missed a step on that wiki page.  Sorry, I'm not sure what's different about my compile environment vs yours but something is different it seems.  Nobody else is complaining so I'm at a bit of a loss on how to help.  best of luck.

This reply was deleted.

Activity