File tree Expand file tree Collapse file tree 5 files changed +23
-18
lines changed
robotpy_ext/common_drivers/navx Expand file tree Collapse file tree 5 files changed +23
-18
lines changed Original file line number Diff line number Diff line change 2
2
validation_root = robotpy_ext/common_drivers/navx
3
3
exclude_commits_file = devtools/exclude_commits_navx
4
4
upstream_root = ../navxmxp
5
- upstream_commit = 09abe90221cb9d0ae104776af037d0b8a7f2d720
5
+ upstream_commit = d8fa37624f03379ed0e2a8f6f458e3cecbb59247
6
6
Original file line number Diff line number Diff line change
1
+ d34b079bfaeab387915436946233367d6bedb370 # enableLogging method
Original file line number Diff line number Diff line change 1
- # validated: 2017 -02-19 DV a2358399f5a3 roborio/java/navx_frc/src/com/kauailabs/navx/frc/AHRS.java
1
+ # validated: 2018 -02-11 DV d8fa37624f03 roborio/java/navx_frc/src/com/kauailabs/navx/frc/AHRS.java
2
2
#----------------------------------------------------------------------------
3
3
# Copyright (c) Kauai Labs 2015. All Rights Reserved.
4
4
#
@@ -996,7 +996,13 @@ def getFirmwareVersion(self):
996
996
:returns: The firmware version in the format [MajorVersion].[MinorVersion]
997
997
"""
998
998
return '%s.%s' % (self .fw_ver_major , self .fw_ver_minor )
999
-
999
+
1000
+ def getGyroFullScaleRangeDPS (self ) -> int :
1001
+ return self .gyro_fsr_dps
1002
+
1003
+ def getAccelFullScaleRangeG (self ) -> int :
1004
+ return self .accel_fsr_g
1005
+
1000
1006
#
1001
1007
# Internal API
1002
1008
#
@@ -1069,14 +1075,9 @@ def _yawResetComplete(self):
1069
1075
self .yaw_angle_tracker .reset ()
1070
1076
1071
1077
#
1072
- # LiveWindow
1078
+ # LiveWindow
1073
1079
#
1074
-
1075
- def getSmartDashboardType (self ):
1076
- return "Gyro"
1077
-
1078
- def updateTable (self ):
1079
- table = self .getTable ()
1080
- if table is not None :
1081
- table .putNumber ("Value" , self .getYaw ())
1082
-
1080
+
1081
+ def initSendable (self , builder ):
1082
+ builder .setSmartDashboardType ("Gyro" )
1083
+ builder .addDoubleProperty ("Value" , self .getAngle , None )
Original file line number Diff line number Diff line change 1
- # validated: 2017 -02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java
1
+ # validated: 2018 -02-11 DV d8fa37624f03 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java
2
2
#----------------------------------------------------------------------------
3
3
# Copyright (c) Kauai Labs 2015. All Rights Reserved.
4
4
#
@@ -219,8 +219,8 @@ def getCurrentData(self):
219
219
board_state .selftest_status = curr_data [IMURegisters .NAVX_REG_SELFTEST_STATUS - first_address ]
220
220
board_state .sensor_status = AHRSProtocol .decodeBinaryUint16 (curr_data ,IMURegisters .NAVX_REG_SENSOR_STATUS_L - first_address )
221
221
board_state .update_rate_hz = curr_data [IMURegisters .NAVX_REG_UPDATE_RATE_HZ - first_address ]
222
- board_state .gyro_fsr_dps = AHRSProtocol .decodeBinaryUint16 (curr_data ,IMURegisters .NAVX_REG_GYRO_FSR_DPS_L )
223
- board_state .accel_fsr_g = curr_data [IMURegisters .NAVX_REG_ACCEL_FSR_G ]
222
+ board_state .gyro_fsr_dps = AHRSProtocol .decodeBinaryUint16 (curr_data ,IMURegisters .NAVX_REG_GYRO_FSR_DPS_L - first_address )
223
+ board_state .accel_fsr_g = curr_data [IMURegisters .NAVX_REG_ACCEL_FSR_G - first_address ]
224
224
board_state .capability_flags = AHRSProtocol .decodeBinaryUint16 (curr_data ,IMURegisters .NAVX_REG_CAPABILITY_FLAGS_L - first_address )
225
225
self .notify_sink ._setBoardState (board_state )
226
226
Original file line number Diff line number Diff line change 1
- # validated: 2017 -02-19 DS 3b0fc57cd0e0 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO_I2C.java
1
+ # validated: 2018 -02-11 DV 73aa4ea84010 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO_I2C.java
2
2
#----------------------------------------------------------------------------
3
3
# Copyright (c) Kauai Labs 2015. All Rights Reserved.
4
4
#
@@ -37,7 +37,10 @@ def init(self):
37
37
38
38
def write (self , address , value ):
39
39
with self .mutex :
40
- return self .port .write (address | 0x80 , value )
40
+ aborted = self .port .write (address | 0x80 , value )
41
+ if aborted :
42
+ logger .warn ("navX-MXP I2C write error" )
43
+ return not aborted
41
44
42
45
def read (self , first_address , count ):
43
46
buffer = []
You can’t perform that action at this time.
0 commit comments