Society of Robots - Robot Forum
Software => Software => Topic started by: Canabots on March 21, 2010, 04:00:43 PM
-
So I'm going to be making my 2DOF leg quadruped into 3DOF. This means that I will be rewriting my gait software (it was pretty bad coding anyways...)
But the point is, I want to convert to WebbotLib. The problem: I'm using Ubuntu, and while I'm fairly certain I've read read somewhere on the forum that you can use Kontrollerlab with WebbotLib, I can't seem to figure it out myself (I used to just program with a notepad and compiler in Ubuntu)
So does anyone know how I could set up WebbotLib in Kontrollerlab? I'm completely new to it, so I need more of a step by step approach.
Thanks in advance!
-
I don't have Unix/Ubuntu so I'd be interested to know what Kontrollerlab brings to the party.
As I see it: you need an IDE. The basics are a notepad/text editor, or something mid-range like AVRStudio (Win only) or something higher range like Eclipse(cross platform) - all free.
This stuff just helps you to write your C code and you can write the same code with any of them.
WebbotLib - is just a pre-compiled library to feed into avr-gcc and is also cross platform.
The avr-gcc compiler tool chain - which has no gui as it just compiles stuff - and is available cross platform. Also has a 'make' command to compile your code and link in libraries like WebbotLib.
Once again - not sure where Kontrollerlab fits into the above build process bit since WebbotLib is cross platform then it shouldn't be a problem - but I cant give you any pointers!
If you crack it then let me know if its worth adding to the WebbotLib FAQs
-
so i used to use Kontrollerlab.
but when it comes to using it with WebbotLib it has a problem: there is no (easy) way to tell it to include pre-compiled libraries.
i was all set to start hacking Kontrollerlab about when i discovered Eclipse and have not looked back.
with Eclipse you can include pre-compiled libraries as well as a lot of other useful functionality you won't get with Kontrollerlab (or AVR-Studio).
Eclipse is a little complicated to set up. loads of settings.
you will want to install the AVR plug-in as well.
once you have it set up the only real down side of Eclipse is it runs on Java so is a bit of a resource hog but it's not like your going to be running many other processor intensive applications while you are programming anyway right?
dunk.
-
I used the AVR-GCC when I was using just notepad and such. It's conveniently simple for those situations.
I have decided that for now, I will be trying out Eclipse. But I'm already having issues installing the plugin!
I am trying to sort it out, and I'll get back to you if I have more issues.
Thanks already for this info!
Canabots
-
I have decided that for now, I will be trying out Eclipse. But I'm already having issues installing the plugin!
I switched to eclipse for AVR dev last week. I was using emacs + terminal. So far I like it!
Regarding the AVR plugin, I had to run eclipse as root and install the plugin. After that you
can use it with your regular user account.
Chelmi.
-
I installed the plugin finally. Turn out I just had the wrong type of Eclipse (not the C/C++ one).
As far as I can tell, I've been able to link correctly, though I'm getting an error from the _spi_common.c file :
'for' loop initial declaration outside C99 mode
In which it is reffering to this on line 25:
for(int deviceNo=0;deviceNo < bus->numDevices; deviceNo++)
And this on line 66/67:
void (*fn)(_SPI*,boolean) = (void (*)(_SPI*, boolean))pgm_read_word(&class->init);
for(int deviceNo=0;deviceNo < spi->numDevices; deviceNo++){
Any thoughts?
Thanks again.
Canabots
-
'for' loop initial declaration outside C99 mode
that's a GCC error.
declaring your variable inside the for loop is not allowed under some versions of C.
you need to set GCC to use C99 mode.
in Eclipse you find the correct knob here:
Eclipse -> Project -> Properties -> Settings -> Tool Settings -> AVR Compiler -> Language Standards -> then select ISO C99.
dunk.
-
In the project settings
goto C/C++ build, Settings
and the the AVR Compiler Language Standard to ISO C99 + GNU Extensions (-std=gnu99)
As Dunk has just said (whilst I was replying)
NB You don't need to build the library itself. You can just use the header files and then link in my pre-compiled libraries.
-
Hmmm...
I have a feeling that I'm doing a lot of things wrong.
@Webbot: I'm trying to do what you are saying but I get errors no matter how I set up the libraries/include paths. Can you guys tell me what you did? I'll be able to figure out my problem from there...
-
you have this working using make right?
compare the output from the Eclipse console (the bottom box on the screen by default) with what you get when you use the Makefile.
dunk.
-
[quote author=Canabots link=topic=10697.msg81508#msg81508 date=1269288991
@Webbot: I'm trying to do what you are saying but I get errors no matter how I set up the libraries/include paths. Can you guys tell me what you did? I'll be able to figure out my problem from there...
[/quote]
So assuming you have got your own project then open the project properties and everything is in 'C/C++ Build, Settings'
- The 'AVR Compiler','Directories' option allows you to add include directories. So add your WebbotLib directory.
- The 'AVR C Linker', 'Libraries' option allows you to add precompiled libs. So add WebbotLib to the library path. Then add the library you need eg 'Webbot-ATMega640' for the Axons.
-
- The 'AVR C Linker', 'Libraries' option allows you to add precompiled libs. So add WebbotLib to the library path. Then add the library you need eg 'Webbot-ATMega640' for the Axons.
Ah...that was my error, by the looks of it.
After reading dunk's new tutorial (thanks dunk!) and reading your last post, I had realized my error. I didn't know you only named the library while ommiting the "lib" and ".a"
Thank you so much!