Ok here I need help with coding a X-drive to get mobile goal and bring it back. Problem is our school doesn’t own a field so I’m limited of how accurate I can code. In addition, we don’t own any cones or mobile goals so wondering if anyone has a code for autonomous for an X-Drive with 4 motors.
If you download the game manual, included is the game field decisions, including distances. With no field, or elements you’re shooting blind. But this is at least a good start. There is also an older program online that will assist you getting some of your code and distances.
We are still a very young team, we just passed our 1 year mark, and the softmore slump has hit us hard. We are still learning a lot, coding is our second biggest issue and we are learning it slowly.
We have all the tools, read, spend hours learning, you have to have the tools and parts or its never going to work correctly. although you may get lucky, We did.
You can use math to find how many rotations the wheels need to go to get to the mobile goal, and back again. Then, just put them into the program somewhat like this:
while (rotations is less than the target) {
(set wheels to some speed)}
Or, you can calculate how fast your robot is in ft/s, then find the distance from starting bar to mogo. Then divide speed of robot by distance and that’s your time, and then base your program off time
If you have encoders on your motors, you can pretty easily write some code to calculate the number of ticks you’d need to travel a certain distance. I’m assuming you already know the basic calculations for making an X-Drive move in driver control. By doing some basic math, you can determine your tick to inch ratio. Once you have that, you’ll be able to multiply that number by sqrt(2) to see the number of ticks you’d need to travel. This was a little vague, if you need more information, feel free to ask
Thanks everyone, I did use math and it worked and I did good in my recent competitions. Did the math and did some slight changes to make it work just took me some time figuring some off balances of our robot.
I am in the exact situation. I know TI-BASIC, so I know code but not all the syntax and commands of RobotC or PROS. Which is also why I’m doing the free RobotC tutorial that @Luke323Z is making.