Quote:
Originally Posted by adf0221
We have the first two of our gyros working with that code, however the third one cannot perform that code because there are only two FPGA ports that are active on the crio. We need to write an integral to take the rate that plugging the gyro into the analog port and using the analogchannel in the code.
|
You could try using simple trapezoidal integration:
Code:
read the new_rate
new_position = ½(new_rate + previous_rate)*cycle_time
previous_rate = new_rate
"cycle_time" would be 0.02 seconds if you're doing this in TeleOp
Is that what you meant?