So I recently built an X drive for the first time and took a while programming it, but here are some problems I have
Whenever driving forward, it drives backward (I don’t know how to fix it)
I don’t know how to program it to drive it diagonally and rotate (I’m trying to rotate using the right joy stick that moves left or right to rotate)
The motors are off by one, but if I changed the ports by one, the names wouldn’t be correct (like front right would be back right, and bottom right would be top right)
If you could correct my code and give me some advice, I would appreciate it
my questions:
what value does the right joystick return and how can I use that value to rotate the robot left or right?
2.How do I rebind the motor ports to make it straight?
Are macros allowed in FRC matches, so like if I were to press a button on my controller, can it automatically go to a coordinate on the field without input from the driver?
As you can see, to turn clockwise, the top left and bottom left motor spins forward while the top right and bottom right motor spins backward. You can incorporate turning by adding another turn component into your original code like this:
For any question about the legality of something, we must turn to the game manual (or the Official Q&A). As you read the game manual (https://link.vex.com/docs/2022-2023/vrc-spin-up/GameManual ), keep in mind that the game manual tells you things that you must do, and things that you are prohibited from doing. It can’t tell you everything you might do, so if the game manual does not prohibit an action, then it is generally legal.
In regards to your question, what rule in the game manual make you think you cannot have a macro?
update: I changed some some of the + and - signs and moved some ports around and now I can drive forward and backward but not side ways, but when I turn the joy stick left, I rotate left and when I turn the joystick right, it turns right.
before:
after:
But isn’t this not just a tank drive on one joystick?
well, no…“tank drive” is a very specific drive method which uses two single-axis control sticks, one for each non-steerable wheel/track set. It’s the most common industrial drive for tracked-vehicles (such as tanks and earth-moving vehicles) as well as small equipment (like a “bobcat” machine) where it is often called “skid steer.”
Ok so I managed to solve problem 1 and half of problem 2, by switching some + and = signs. The final problem I have is rotating while strafing or driving forward (I can include Inertial Sensor if needed) . What I’m trying to incorporate now, is a holonomic X-drive.