コード例 #1
0
 def __init__(self):
     self.leftEnc = wpilib.Encoder(
         robot_map.LEFT_ENC_ONE, robot_map.LEFT_ENC_TWO, True, wpilib.Encoder.EncodingType.k4X)
     self.rightEnc = wpilib.Encoder(
         robot_map.RIGHT_ENC_ONE, robot_map.RIGHT_ENC_TWO, True, wpilib.Encoder.EncodingType.k4X)
     self.elevatorEnc = wpilib.Encoder(
         robot_map.ELEVATOR_ENC_ONE, robot_map.ELEVATOR_ENC_TWO, False, wpilib.Encoder.EncodingType.k4X)
     self.ahrs = AHRS.create_i2c()
コード例 #2
0
 def __init__(self, navx_type):
     self.prev_x_accel = 0
     self.prev_y_accel = 0
     if navx_type is robotmap.NavXType.I2C:
         self.navx = AHRS.create_i2c()
     elif navx_type is robotmap.NavXType.SPI:
         self.navx = AHRS.create_spi()
     else:
         print("warning navx instaniated with unknown navx_type")