by Bullit » Wed Jun 07, 2006 3:07 am
by Bullit
Wed Jun 07, 2006 3:07 am
Here's my code - mostly from other's postings here.
I use "F" and "G" keys on the IR remote to turn the gyro on and off manually and then I have some routines that turn it on and off at different places. This allows me to experiment with how the gyro effects things like the standard_pose. My gyro is mounted on the right shoulder right now so that if responds to back and front motion.
I zero my robot with the gyro off. I then turn on the gyro and adjust the gain and center on the gyro. When you increase the gyro's gain pot the center shifts so you need to re adjust the center to get back to the zero position. Once this is all done it doesn't seem to drift much. I find more gain on carpet is better. On carpet its better to have the robot shake a little but not fall. The default punch move is very cool with the gyro on. He's locked and loaded rock solid on any surface. Have fun.
gyro_off:
GYROSET G6A, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSET G6D, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSET G6C, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSET G6B, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSENSE G6A, 0,0,0, 0, 0, 0
GYROSENSE G6D, 0,0,0, 0, 0, 0
GYROSENSE G6C, 0,0,0, 0, 0, 0
GYROSENSE G6B, 0,0,0, 0, 0, 0
RETURN
gyro_on:
GYROSET G6A, 0, 1, 1, 0, 0, 0
GYROSET G6D, 0, 1, 1, 0, 0, 0
GYROSET G6C, 0, 0, 0, 0, 0, 0
GYROSET G6B, 0, 0, 0, 0, 0, 0
GYRODIR G6A, 1, 0, 0, 0, 0, 0
GYRODIR G6D, 1, 0, 0, 0, 0, 0
GYRODIR G6C, 1, 0, 0, 0, 0, 0
GYRODIR G6B, 1, 0, 0, 0, 0, 0
GYROSENSE G6A, 0,200,200, 0, 0, 0
GYROSENSE G6D, 0,200,200, 0, 0, 0
RETURN
Here's my code - mostly from other's postings here.
I use "F" and "G" keys on the IR remote to turn the gyro on and off manually and then I have some routines that turn it on and off at different places. This allows me to experiment with how the gyro effects things like the standard_pose. My gyro is mounted on the right shoulder right now so that if responds to back and front motion.
I zero my robot with the gyro off. I then turn on the gyro and adjust the gain and center on the gyro. When you increase the gyro's gain pot the center shifts so you need to re adjust the center to get back to the zero position. Once this is all done it doesn't seem to drift much. I find more gain on carpet is better. On carpet its better to have the robot shake a little but not fall. The default punch move is very cool with the gyro on. He's locked and loaded rock solid on any surface. Have fun.
gyro_off:
GYROSET G6A, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSET G6D, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSET G6C, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSET G6B, 0, 0, 0, 0, 0, 0 ' set Gyro to use (0=no Gyro)
GYROSENSE G6A, 0,0,0, 0, 0, 0
GYROSENSE G6D, 0,0,0, 0, 0, 0
GYROSENSE G6C, 0,0,0, 0, 0, 0
GYROSENSE G6B, 0,0,0, 0, 0, 0
RETURN
gyro_on:
GYROSET G6A, 0, 1, 1, 0, 0, 0
GYROSET G6D, 0, 1, 1, 0, 0, 0
GYROSET G6C, 0, 0, 0, 0, 0, 0
GYROSET G6B, 0, 0, 0, 0, 0, 0
GYRODIR G6A, 1, 0, 0, 0, 0, 0
GYRODIR G6D, 1, 0, 0, 0, 0, 0
GYRODIR G6C, 1, 0, 0, 0, 0, 0
GYRODIR G6B, 1, 0, 0, 0, 0, 0
GYROSENSE G6A, 0,200,200, 0, 0, 0
GYROSENSE G6D, 0,200,200, 0, 0, 0
RETURN