Tetrix Gamepads. One Gamepad stick for moving in all directions Pro Preview

  • #518
  • 24 Apr 2017
  • 4:35


Another way to control your FIRST Technical Challenge robot with the gamepad is to use just one stick. And with this one stick you control both moving forward - backward and turning. So, it would look like this. We have only the left stick. We move forward, backward or we turn.

Or we can move and turn.

Okay, let's see how we develop it and then we'll discuss the program and the result. In our OpMode what we do is to change the formula with which we calculate the left power and the right power. And we'll use another formula. This formula should include only the left stick and again we'll use the 'y' for moving forward and 'x' for turning. What I'll do is remove the division by 2 and here and use just the left stick. In this way a part of the result of the power comes from the left stick - its 'y' access and a part comes from the 'x' access. And we have the same thing for the right motor. And we have left_stick_x. This is our new formula for controlling the powers of the motor. Again, you can modify them based on your robot and find the correct values and the correct formula that is working correctly for your robot. One disadvantage of this approach of course is that we are not controlling the speed of the motors we are controlling their power. And this is a large subject - what is the speed and what is the power of the motors and for controlling the speed we must use the encoders but this is a subject for another video. For now it's important to know that there is another formula with which you can control the whole robot using only one of the sticks. And this one is the left stick. Let's return and discuss the end result. Moving forward. We haven't started the OpMode. I'll start it on the phone. Moving forward, moving backward, turning. Now, there are a couple of disadvantages. First, it is difficult with this kind of calculation to rotate around one of the wheels. You can do an arc or you can rotate around the center of the axle between the two wheels but you cannot do a turn around one of the wheels. So, it is not possible to set the power of one of the motors to 0 with this kind of calculation which might be a disadvantage depending on your construction and how it works. But what we can do I don't have enough space to show a full arc turn here on the camera and it would be difficult to record this. But if I move it forward and turn slightly to the left. Again I'll try to move forward and turn slightly to the left.

Now, this is something that's difficult to control with this robot.

You can but it's difficult. At least we have another way for building a software, for building a program for your gamepad and with this gamepad using only one of the sticks you can control how the robot moves. Actually, I set it to move the robot on the floor so that we can have more space and record the robot on the floor and it is difficult but it is possible to make the robot rotate around one of the wheels. We have two wheels and around one of the wheels. So, let's see how we do this on the floor.