|
Re: pic: Chantilly Academy's 4 Wheel Drive 4 Wheel Steering!!!!
the joystick values are from 0-255 in the x direction we convert the x-value into a degree measure from -45 to 45 degrees, then after some math, we have the new angles that the wheels need to be, then on the same joystick in the 0-255 y direction, the speed will be controlled, the speed is controlled based on the 0-255 value and on the angle the wheels are currently oriented, the arrays to hold the values were quite large, and to do it on the fly would be too slow, so we had to do some creative handling of the values to keep memory low
so in short:
-each (0-255)x value corresponds to a relative angle with 127 being straight ahead
-each (0-255)y value creates the velocity for the robot by combining aspects of the angle and its value
what i would like to do on sunday monday and tuesday, not saturday and tomorrow b/c we have to get ready for the DC scrimmage is make a steering wheel out of potentiometers, a gas pedal with a potentiometer that would give a value 0-255, and a shifter for forward and reverse, the steering wheel would work exactly the same, the pedal would be halved to give us a 0-127 value, and the shifter would say if in reverse add nothing to the 0-127, otherwise if in forward add 127, however this is largely time consuming and for right now we want to make sure that the basics are perfect,
hope that answers your question
also, i believe on another thread with a pic there is a description of the math involved
|