I'm the lead programmer on a FIRST robotics team, and this is our first year using C++. I have some experience, but I don't exactly know where to begin in this particular area. For the competition, we have to launch Frisbees through a target mounted approximately 9 feet above the ground. Based on what I've researched, the equations for determining the trajectory of a Frisbee are sketchy at best, not to mention the fact that they could strike terror into even the best programmer. Because of this, I would like to make a data table with the distance from the wall and the angle to hit the target instead of using the formulas. Everything except the angle of the launcher will be constant. Basically, we'll park our launcher x" from the wall and manually figure out the angle to hit the target, then record it in our "data table" (I'm not completely sure if this is the term I'm trying to convey). What I think I would have to do is create a matrix with the distance (in inches) on top and the angle (in degrees) on the bottom. Probably 2x30 or so. This is my first problem. If using a matrix actually sounds like a good method of storing this information, I would like to learn how to make one in C++. If not, could someone suggest another method (I can't store data in a text file because we're communicating with a cRIO)? After that, I need it to print the corresponding angle when given the distance. Ultimately, we'll be acquiring the distance with an ultrasonic rangefinder, and measuring the angle with a gyroscope (a really accurate one), so that the robot can automatically change the angle of the launcher based on the closest integer to the range finder's output value (in real-time). I just need to know how to store and link two corresponding data sets. I already know how to program all the hardware (for the most part). Let it be known that I'm 15 and in no way an expert at programming. I'm not trying to "cheat" at anything, so please don't tear me apart like S**ckOverfl*w did. I know this seems like a lot of information, but It's the only way I know of how to describe my situation. (By the way, this is all just optional for the robot, but I really want to become good at programming, and this is something I would really love to learn how to do). I would really appreciate any help I can get. Thanks!
1 Replies - 316 Views - Last Post: 09 January 2013 - 07:57 PM
Replies To: Using data tables in place of trajectory equations
Page 1 of 1