Society of Robots - Robot Forum

Software => Software => Topic started by: Kelpy on September 08, 2010, 12:57:41 PM

Title: What language is all this stuff written in?
Post by: Kelpy on September 08, 2010, 12:57:41 PM
I'm getting really, really frustrated with all this.
I've bought the AXON2, and so far have managed to get the Photovore program to run, but really haven't a clue.
I have tried 3 different versions of the Sharp IR .hex code on this site, and none of them work with my robot/axon2.
I'm about to throw in the towel and give it all up.
Is there some recommended reading to try and decipher what you are all talking about, because this site is obviously not aimed at complete beginners? The commenting in all the code, assumes a rudimentary understanding of the coding, which I don't have.

Non-cryptic, in plain English, advice would be appreciated.
Title: Re: What language is all this stuff written in?
Post by: madsci1016 on September 08, 2010, 01:32:53 PM
Use Webbotlib, it's much friendlier to start with.

Follow my tutorial below on how to use project designer to get you started with Webbotlib on Axon 2 and it will also give you example code to use your sensors.

Report back.

Tutorial:

Axon 2, Webbotlib and Project Designer Tutorial (http://www.youtube.com/watch?v=FPhMES0PFEw#ws)
Title: Re: What language is all this stuff written in?
Post by: Kelpy on September 09, 2010, 08:33:09 AM
Wonderful!
Thank you so much, madsci1016, I'm sure this will help me to understand. You do make it look so easy, though.
I wonder why I haven't seen this Project Designer before. Is it mentioned on SoR?
I'll have a play, and let you know how I get on.
(Calmed down a bit today ;) )
Title: Re: What language is all this stuff written in?
Post by: dunk on September 09, 2010, 10:04:40 AM
in answer to your original question,
this stuff is all programmed in C.

even if you use Project Designer, consider getting a book on C.
most books on the subject will presume you are programming a PC but that is fine as the basic syntax and program structure is the same whatever the platform.


dunk.
Title: Re: What language is all this stuff written in?
Post by: Kelpy on September 10, 2010, 08:44:32 AM
Thanks, dunk.

I guessed as much, and have ordered a book on C (rightly or wrongly, C for Dummies).

I used Basic about 35 years ago, for a short time, and the basic concept is beginning to come back to me, and I can recognize some of the procedures in C.

Awful long way to go, though, especially when the compiler tells me of errors that I haven't a clue of the meaning.

Onwards and upwards.
Title: Re: What language is all this stuff written in?
Post by: madsci1016 on September 10, 2010, 09:05:04 AM
Next time I suggest the Primer Plus (http://www.amazon.com/Primer-Plus-5th-Stephen-Prata/dp/0672326965) series of books. Lot less cartoon-y then the dummies book, and makes a good reference after you read through it once.
Title: Re: What language is all this stuff written in?
Post by: jaime on September 10, 2010, 12:01:26 PM
You need The C Programming Language book. (http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628)

It's often referred to as "the c bible".  I don't recommend you have it; I demand it  ;D.
Title: Re: What language is all this stuff written in?
Post by: waltr on September 10, 2010, 12:18:27 PM
Yep, that is the ONLY book to use for C. Had mine for 25 years and still use it and have trashed all the other C books I've bought.
Title: Re: What language is all this stuff written in?
Post by: madsci1016 on September 10, 2010, 12:22:08 PM
Yep, that is the ONLY book to use for C. Had mine for 25 years and still use it and have trashed all the other C books I've bought.

25 years? Then it doesn't cover C99, or even C90!!

To each his own, but the primer is the bible where I work.
Title: Re: What language is all this stuff written in?
Post by: madsci1016 on September 10, 2010, 12:24:45 PM
You need The C Programming Language book. (http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628)

It's often referred to as "the c bible".  I don't recommend you have it; I demand it  ;D.
'

Woah, 1988 publishing date? You are missing multiple revisions of the C standard then, this book is old school.
Title: Re: What language is all this stuff written in?
Post by: jaime on September 10, 2010, 02:14:38 PM
You need The C Programming Language book. (http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628)

It's often referred to as "the c bible".  I don't recommend you have it; I demand it  ;D.
'

Woah, 1988 publishing date? You are missing multiple revisions of the C standard then, this book is old school.

To be honest, I don't track C revisions.  Everything he needs to know to get started in C is in this book.  What exactly are you worried about him missing?

This book is one of the most eloquently written programming books I've ever read.  Each snippet of code in the book is incredibly concise and easy to follow.  It's a shame that most technical writers can't reach this level of brevity.

Don't knock it till you've tried it  ;) -- this book is *WONDERFUL*.
Title: Re: What language is all this stuff written in?
Post by: madsci1016 on September 10, 2010, 02:38:02 PM
What exactly are you worried about him missing?

Quote
C99 introduced several new features, many of which had already been implemented as extensions in several compilers:
inline functions
intermingled declarations and code, variable declaration no longer restricted to file scope or the start of a compound statement (block)
several new data types, including long long int, optional extended integer types, an explicit boolean data type, and a complex type to represent complex numbers
variable-length arrays
support for one-line comments beginning with //, as in BCPL or C++
new library functions, such as snprintf
new header files, such as stdbool.h, complex.h and inttypes.h
type-generic math functions (tgmath.h)
improved support for IEEE floating point
designated initializers
compound literals
support for variadic macros (macros of variable arity)
restrict qualification to allow more aggressive code optimization
universal character names, which allows user variables to contain other characters than the standard character set

And that's just some of C99.

What I like most about Primer plus is many examples have the standard C version, and then the updated C99 version of the example.

I'm sure it was a great book back in the day. But i would never suggest a 25 year old book that mises two major revisions of a modern language to anyone new; it just doesn't make sense. If you are gonna learn, might as well learn the modern revision.
Title: Re: What language is all this stuff written in?
Post by: Kelpy on September 11, 2010, 11:17:05 AM
Hmmm.....Can Of Worms springs to mind.....

Anyway, thanks for all your input. I will explore all my choices....eventually.

To be honest, when I was learning Basic, in the early seventies, I found the easiest way, for me, to start, was by taking programs already written, with an expected outcome, and modifying them at random, and learning from the results.

The problem I am finding is that C ( as with php) is modular, and I get confused with all the different files which are needed to include, in the eventual compiled program. This in those days did not happen. WYSIWYGot, was a Basic program then.

All I really need is a working IR follow code for the Axon II, which I can then disect and modify to my own needs (specifically an IR AVOIDANCE code).

None of the packages I have downloaded actually work with my Axon II, even though I have seen the videos showing them working. Obviously, the .hex file to make it work will be no good to me, as I need to be able to read all the files and learn what each one does, and compile my own .hex file.

Thanks for your help, guys, the book arrived today, so I will try and see if I can do it on my own. (OR, maybe I haven't got enough grey cells left ::))
Title: Re: What language is all this stuff written in?
Post by: madsci1016 on September 11, 2010, 12:03:57 PM
I get confused with all the different files which are needed to include, in the eventual compiled program.

Webbotlib and project manager should take care of this for you.

Quote
All I really need is a working IR follow code for the Axon II, which I can then disect and modify to my own needs (specifically an IR AVOIDANCE code).

something like the robot in my tutorial? That's an Axon II after all.