I'm finally getting around to soldering headers on my ardupilot-mega board (1280 version) and trying to get it up and talking. I downloaded the arduino-1.0.1 environment for linux 64-bit and got that up and running. I connected my FTDI cable and the board looks like it powered up. My linux system detects the cable is attached and creates /dev/ttyUSB0 as it should. I fetched the git code from code.google.com.
Now I'm trying to compile with the arduino IDE and I have a quick question (hopefully). Right out of the gate I get:
ArduPlane.cpp:1841:28: error: Mavlink_compat.h: No such file or directory
It would be nice if everything compiled clean out of the box, but I realize this is git code and it's a moving target so I won't complain too much about that. :-) But my question is, what are developers doing to get around this? This is a file out of the GCS module. Are people copying this file over to the ArduPlane directory? Is there a way to extend the search path in the arduino ide? Are there other gotcha's I need to watch out for? Has anyone created a list of work arounds?
On my system I also have newer avr tools (gcc/g++ etc) installed due to another project I'm working on. When I do the cmake compile it picks up these newer version of the avr compilers instead of what the arduino ide provides. Ideally that shouldn't be a big deal, but the newer version is apparently pickier and dies with:
Building CXX object CMakeFiles/mega2560_FastSerial.dir/home/curt/Projects/UAS/Arduino/ardupilot-mega/libraries/FastSerial/vprintf.cpp.obj
/home/curt/Projects/UAS/Arduino/ardupilot-mega/libraries/FastSerial/vprintf.cpp: In member function 'void BetterStream::_vprintf(unsigned char, const char*, va_list)':
/home/curt/Projects/UAS/Arduino/ardupilot-mega/libraries/FastSerial/vprintf.cpp:258:118: error: variable '__c' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/home/curt/Projects/UAS/Arduino/ardupilot-mega/libraries/FastSerial/vprintf.cpp:260:126: error: variable '__c' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
make[2]: *** [CMakeFiles/mega2560_FastSerial.dir/home/curt/Projects/UAS/Arduino/ardupilot-mega/libraries/FastSerial/vprintf.cpp.obj] Error 1
make[1]: *** [CMakeFiles/mega2560_FastSerial.dir/all] Error 2
make: *** [all] Error 2
That's diving into some tangled web of defines so I'm not sure the best work around here, but just a heads up for ardupilot developers if they are reading this that some newer version of the arduino tools will probably die here too when they get around to upgrading their version of avr. The version of gcc provided with arduino-1.0.1 is 4.3.2 and the version I have installed separately is 4.6.1.
Thanks,
Curt.
Tags:
Permalink Reply by Lewis W on May 29, 2012 at 9:25am Have you followed the instructions here?
The first things that come to mind are to a) ensure that you're using the right version of Arduino (there's an arduplane-specific version mentioned in the link above), and b) check that the arduplane folder and the libraries folder are in the folder that you're using for your arduino "sketches".
Hope that helps.
Permalink Reply by Curt Olson on May 29, 2012 at 9:57am Hi Lewis,
Thanks for the tip. It's often a challenge when starting cold on something new to find where the right information is located. :-)
So I have arduino-1.0.1 (for linux 64 bit) installed. Supposedly (?) this has relax patch included so I don't have to worry about that ???
I'm trying to build ArduPlane-2.34.
The compile runs through and appears to go cleanly until the final link where I get this message:
/usr/local/Arduino/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: region text is full (ArduPlane.cpp.elf section .text)
/usr/local/Arduino/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: region text is full (ArduPlane.cpp.elf section .text)
/usr/local/Arduino/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/bin/ld: region text is full (ArduPlane.cpp.elf section .text)
Anyone have any ideas? Did the relax patch not go into the linux version of arduino? Please don't tell me I have to limp around a windows system to build the arduplane code. :-)
Thanks,
Curt.
Permalink Reply by david.collett on June 5, 2012 at 5:03am The changelog says that relax is there, so it should be.
I suspect the problem could be that the code is simply too big (despite relax patch) for the 1280 board. I believe the 2560 is the main target for the devs these days, and you may have to disable a few things to get a build that fits into the 2560. I suggest asking the question over in the Arduplane 2.x forum.
Dave
Permalink Reply by Curt Olson on June 6, 2012 at 6:36am Ok, yes, when I compile for the 2560 then all is good, except my board here is a 1280. I have a 2560 v2.0 kit on order so my plan is to move forward and not spend too much time trying to make the older stuff work.
Ultimately, my plan is to turn the ardupilot-mega into a "mega" sensor head. In other words, the ardupilot hardware spends all it's time reading sensors and running the RC system and handing the data up a layer to a higher end CPU. All the high level stuff: kalman filtering, autopilot PID, navigation, guidance, control, ground station communication, payload communication, etc. will live one layer up. This will allow me to use higher level coding constructs, posix/linux api's, hardware floating point operations, a real file system, etc. The ardupilot is growing by leaps and bounds in capabilities, so asking why I want to do this is a legitimate question, and there are some shades of gray here, but ultimately I like the portability of higher level code and I like the idea of keeping the bare metal stuff as contained as possible.
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.183 members
1278 members
182 members
24 members
51 members
© 2013 Created by Chris Anderson.
Powered by
