XV LIdar controller code does not build on current Arduino/Teensyduino releases.

37 views
Skip to first unread message

Kurt Eckhardt

unread,
Nov 22, 2016, 12:09:05 PM11/22/16
to devel...@arduino.cc

There is a thread up on pjrc forum (https://forum.pjrc.com/threads/39855-Error-compiling-for-board-Teensy-2-0)  that a user is trying to compile code from github to control his XV Lidar, that uses a Teensy 2.0.

 

The project is: https://github.com/getSurreal/XV_Lidar_Controller

 

Since I have one of these, that will soon be going back on one of my robots and back many months ago I could program the Teensy, I thought I would take a look.

Sure, enough, it will not build on Arduino 1.6.12 with Teensyduino 1.31. 

 

Note this project is setup with a main sketch and has a libraries subdirectory, where it has several libraries (EEPromAnything, PID, SerialCOmmand, TimerThree). 

 

His program then several includes that expects to find these files, that look like:

#include "libraries/TimerThree/TimerThree.h" // used for ultrasonic PWM motor control

#include "libraries/PID/PID.h"

#include <EEPROM.h>

#include "libraries/EEPROMAnything/EEPROMAnything.h"

#include "libraries/SerialCommand/SerialCommand.h"

 

Some of these sub-directories also include source files. 

 

I was curious, so I downloaded Arduino 1.6.9, which I installed on my windows machine (non-installer), and then istalled Teensyduino 1.31 and the project built without an error.

 

I obviously can get this to work on my machine with current stuff, by moving the libraries into my Arduino libraries folder, probably edit the .ino file not to have the libraries stuff in it, but I was wondering if there if there is some new standard way for an application to have their own libraries, such that one can post an issue to that project (or better yet a Pull request) to allow it to work on the current Arduino builds as well as the older ones.

 

Thanks

Andrew Kroll

unread,
Nov 22, 2016, 1:10:28 PM11/22/16
to devel...@arduino.cc
The idea of using double quotes v.s. '<>' is to change the search order. Double quotes will search the current directory first, which should be the sketch directory, whereas <> scans the current directory last. I think someone doesn't know the different implications/reasons between the two, and this happens all the time.

Really, the correct fix that should work best with both is the whole libraries/ part removed and enclosed in <>, then it should work on both. If this project is expecting private libraries under ~/Arduino, that is also automatically handled correctly too, if you use <>, and Arduino builder will choose the user-installed private ones first. If the libraries are no-where installed, but they are in the user directory, then, and only then will they be used. Briefly, the right thing to do is have a user install the libraries required where they belong-- in the user's private ~/Arduino directory, AKA where sketches are stored.






--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.



--
Visit my github for awesome Arduino code @ https://github.com/xxxajk

Matthijs Kooijman

unread,
Nov 22, 2016, 1:15:07 PM11/22/16
to devel...@arduino.cc
Hey Andrew,

> Double quotes will search the current directory first, which should be the
> sketch directory, whereas <> scans the current directory last.
I believe that <> only scans the include path and skips the current
directory altogether (unless of course the current directory is put on
the include path, but I think that at least Arduino does not doe this).

Gr.

Matthijs
signature.asc

Kurt Eckhardt

unread,
Nov 22, 2016, 2:00:08 PM11/22/16
to devel...@arduino.cc

Sorry, the errors I believe are mainly about things that are not being compiled as part of the build.   

 

That is, a lot of errors that look like:

Linking everything together...

"C:\arduino-1.6.12\hardware\teensy/../tools/avr/bin/avr-gcc" -Os -Wl,--gc-sections,--relax  -mmcu=atmega32u4 -o "C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995/XV_Lidar_Controller.ino.elf" "C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\XV_Lidar_Controller.ino.cpp.o" "C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\libraries\EEPROM\EEPROM.cpp.o" "C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995/core\core.a" "-LC:\Users\Kurt\AppData\Local\Temp\arduino_build_54995" -lm

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\XV_Lidar_Controller.ino.cpp.o: In function `setAngle()':

 

C:\Users\Kurt\Documents\GitHub\XV_Lidar_Controller/XV_Lidar_Controller.ino:952: undefined reference to `SerialCommand::next()'

 

C:\Users\Kurt\Documents\GitHub\XV_Lidar_Controller/XV_Lidar_Controller.ino:953: undefined reference to `SerialCommand::readSerial()'

 

C:\Users\Kurt\Documents\GitHub\XV_Lidar_Controller/XV_Lidar_Controller.ino:954: undefined reference to `SerialCommand::next()'

 

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\XV_Lidar_Controller.ino.cpp.o: In function `TimerThree::pwm(char, unsigned int)':

 

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\libraries/TimerThree/TimerThree.h:122: undefined reference to `TimerThree::clockSelectBits'

 

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\XV_Lidar_Controller.ino.cpp.o: In function `TimerThree::setPwmDuty(char, unsigned int)':

 

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\libraries/TimerThree/TimerThree.h:102: undefined reference to `TimerThree::pwmPeriod'

 

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\libraries/TimerThree/TimerThree.h:102: undefined reference to `TimerThree::pwmPeriod'

 

As I mentioned, the libraries are thought of to be private to this .INO file.   Side note: I have this sketch not part of my may Arduino folder, but in my <documents>/github

Folder.

 

I at first thought maybe the files were not copied down to the temp directory, but they are:

 

The issue appears to be that the .cpp files that are copied down as part of a subdirectory, in this current build attempt:

C:\Users\Kurt\AppData\Local\Temp\arduino_build_54995\sketch\libraries\TimerThree

Was not built, but in the 1.6.09 build, the TimerThree.cpp file that was copied down to

C:\Users\Kurt\AppData\Local\Temp\buildd37155301db0c75193e6bd747adc38df.tmp\sketch\libraries\TimerThree

Was built, likewise for some of the other directories.

--

To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.




--

Visit my github for awesome Arduino code @ https://github.com/xxxajk

--

You received this message because you are subscribed to the Google Groups "Developers" group.

To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.

Reply all
Reply to author
Forward
0 new messages