Launch Distance Arrays

Hello Everyone!

I present to you some code that should accompany X, Y Positioning Code.

These have to be loaded onto the robot beforehand, but the great thing is that you don’t have to change it afterwards.

Starting with what it outputs: http://pastebin.com/wZVDGFcq
This outputs a ready made RobotC array ready to load onto your robot.

This code generates the JSON file off of Nathan’s API: http://pastebin.com/2pY8fKn7

This code converts that JSON list into the array: [http://pastebin.com/KVjAs3gJ

In the converter be sure to replace the placeholder JSON list.
This code is pretty dumb, so it doesn’t stop creating entries into the JSON file.](http://pastebin.com/KVjAs3gJ)

Remember that this is only for one launch angle, and you didn’t mention what it is! Looking at the code you wrote it’s 44 degrees, but you should really have stated that in the post too :stuck_out_tongue:

Through some comparison, we have found that 44 degrees is the optimal launch angle for a robot launching balls under 18".

However, Nathan is completely correct, I should’ve mentioned it. And if you know how to use python you can utilize these scripts and generate arrays based off of custom angles!

I might be wrong but I think that angle probably won’t work too well for the high goal if you are right up against the goal.

That is true, but for anywhere else, it should work just fine!

That “optimal” angle also is only when shooting from the area around your starting tiles. Playing around with the calculator it looks like from the middle of the field that “optimal” angle is about 51 degrees.

Hi Nathan

How are you defining “optimal”?
Are you considering the angle of entry into the goal, or just minimum launch speed required?

Great job with the calculator :slight_smile:

I’m pretty sure that Harrison was using minimum launch speed required for his definition of “optimal” (hence my use of it in quotes, because I don’t think it’s the only thing to consider when saying it’s optimal), so that’s what I used too.

Just a note that all these values will be incorrect because of an error I had in the calculations :frowning:

See this post for more information.

Sorry!

Here is a BRAND NEW version that does everything for you, and it does it alot faster.

You can customize the variables that nathan’s website allows you to customize!

The link to the python code is here: http://pastebin.com/6qtVg1Wa