Quote:
Originally Posted by mcchev
Is this programmed like a mechanum drive train? If you program in java, can you send me your example code? Thanks!
-mcchev
|
not at all. the programming is actually a little tricky and requires a sensor to give you an off robot reference like a gyro or compass. We've used a compass and that seems to work pretty well but there's room for improvement so we're looking into different IMU/AHRS platforms. I also did it in labview but I can explain my approach.
Step 0: robot boots up and takes a heading reading, this will be the "forward" direction for robot
Step1: take the x and y axis values from joystick and convert those into a magnitude and angle
Step2: Add the joystick angle to the robot's angle(the current minus the start up reference) and an offsets if required. For example one offset for our robot was 45* since that's how the wheels were mounted from "forward" and another offset depending how you calculated the joystick angle(you may be off by 90* +/- depending how you did the math. Break that back down into x and y components of the triangle and multiply by joystick magnitude to give you the motor values for the two sets of omnis(each set are two parallel wheels, so you have an X value for motors and Y value). For rotation it's very simply just turning all motor in same direction and we used a second analog stick to rotate. We used a 360 controller so the left stick was direction and speed while the right stick was rotation