G Class

Hello everyone,

I am beginning to look through the ArduPlane code and have come up with a question I cant seem to find the answer to. There is a line that says:

"Global parameters are all contained within the G class."

My question is, where can I take a look at the G class? There is a lot of code that includes

g.something = sometingElse,

and I would really like to know what it is accessing.

Thanks for any help.

Sam

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

Join diydrones

Email me when people reply –

Replies

  • Hi,

    Actually the comment is rather misleading. If you look at ArduPlane.pde you see a static variable "g" which is an instance of class "Parameters", which is defined (as one would expect for C/C++) inside the header file "Parameters.h". I guess what Jake meant in his reply is that your question indicates that your (at least object-oriented) programming experience maybe will let you be confused about other parts as well, which means it could be a good idea to first have a look at some C++ tutorials. That should get you started on the basics before attacking such a challenging and ultimately unforgiving environment such as APM.

    Just think about it.. if your program crashes on your computer you can just restart the program. If it crashed on your APM it means that your plane/copter/flying saucer and all its payload is doomed. That's just a word of warning.

    Now boldly go where no UAV enthusiast has gone before :-)

    Cheers, Andre

  • Not sure where you're at with programming knowledge, but you can find a decent explanation of classes here...

    http://en.wikipedia.org/wiki/Class_(computer_science)

    http://www.cplusplus.com/doc/tutorial/classes/

    Your best bet to start with is searching the code for: "class g {"

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…