This year, I am a novice programmer on my school's FIRST Robotics team, though it's my second year, and it looks like next year I will be the lead programmer for the team. The problem is, though, I don't know how to develop logic and problem solve for robotics programming. The language required by FIRST is C++, and my native language is Java (I specialize in information programming), so I'm not worried about learning C++ syntax so much as learning how to develop my logic and problem solving abilities for a focus on robotics programming, mainly for FRC (FIRST Robotics Competition).
Can anyone either walk me through the logic for programming a drive train, reading sensor data, programming gyros, servos and other essential components on the robot or provide me with an online resource that can help me with this? Thanks to everyone in advance for your help.
I apologize if I wasn't clear in my question, so let me clarify. I'm not looking for a C++ syntax tutorial, but instead a robotics programming tutorial with C++ as the language used.
There's no real tutorial, each team uses different coding styles. And everything is contained inside a class this year, so you could do drive(30,.5); to mean "drive forward at power level 30, making a half turn right"
The only thing to do is examine the libraries you get very carefully...
That's hard to do without actually having the code with me right now, but ASAIK everything's inside a class so you just do Ultrasonic ultrasensor; and then the ultrasonic sensor takes care of the rest...Driving is as eassy as the above, check out the code once you get it...I've found times where they enum'd and set each enum value incrementally manually xD