Log in

View Full Version : Good example of C++ programming?


Bitsy
16-01-2016, 16:49
I am a mentor with programming experience but I am new to programming robots.
Does anyone know of a good example of C++ programming?

Arhowk
16-01-2016, 20:35
Define "good"... the robonauts open sourced their code (https://ccisdrobonauts.org/?w=1920&h=1200&p=robots) but I doubt a new programmer could learn from it.

The best resource for new users is screensteps (http://wpilib.screenstepslive.com/s/4485/m/13810)

chloe
20-01-2016, 22:21
WPILib has its very own comprehensive (ish) documentation on C++ programming for robots (http://wpilib.screenstepslive.com/s/4485/m/13810). First you should choose which base class you're using -- IterativeRobot, SimpleRobot, or Command-based Robot. Once you have that, there are plenty of resources found in that link to get started with robot programming.

Egg 3141592654
20-01-2016, 23:58
I find that the gearsbot and pacbot examples are pretty good full examples of programming C++ with the first libraries. They are in the same place as the other examples, but under the "command based robot" examples.

After reading the introduction to the command based programming docs (url below) you can see the general development flow and layout of a working robot. If you feel that the command based approach isn't for you, the link that chloe provided heads to the same page, but the more generalized documentation for things such as iterative and simple robot based projects.

https://wpilib.screenstepslive.com/s/4485/m/13810/l/241892-what-is-command-based-programming

MichelB
21-01-2016, 08:54
Our team, 3941, programs in C++ and posts all of our code to our GitHub (here (https://github.com/Techbrick)). Feel free to take a look and email (michelfrancisb@gmail.com) with any questions.