Earlier someone posted once instantiated the sensor will take up time. Hardwaremap has remove, put, rebuilddevicenames. Would remove take the sensor out of consideration? Could you then add it back in with put and rebuild?
Announcement
Collapse
No announcement yet.
Odd problem with Core Device Interface (seems to impact both Color Sensor and ODS)
Collapse
This topic is closed.
X
X
-
Originally posted by 3805Mentor View PostEarlier someone posted once instantiated the sensor will take up time. Hardwaremap has remove, put, rebuilddevicenames. Would remove take the sensor out of consideration? Could you then add it back in with put and rebuild?
Code:[COLOR=#cc7832]import [/COLOR]com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cColorSensor[COLOR=#cc7832]; [/COLOR][COLOR=#cc7832]import [/COLOR]com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cGyro[COLOR=#cc7832]; [/COLOR][COLOR=#cc7832]import [/COLOR]com.qualcomm.robotcore.eventloop.opmode.OpMode[COLOR=#cc7832]; [/COLOR][COLOR=#cc7832] [/COLOR][COLOR=#cc7832]public class [/COLOR]TestOpMode [COLOR=#cc7832]extends [/COLOR]OpMode { [COLOR=#cc7832]public void [/COLOR][COLOR=#ffc66d]init[/COLOR]() { [COLOR=#cc7832]final [/COLOR]ModernRoboticsI2cColorSensor colorSensor = (ModernRoboticsI2cColorSensor)[COLOR=#cc7832]this[/COLOR].[COLOR=#9876aa]hardwareMap[/COLOR].get([COLOR=#6a8759]"color"[/COLOR])[COLOR=#cc7832]; [/COLOR] colorSensor.getI2cController().deregisterForPortReadyCallback(colorSensor.getPort())[COLOR=#cc7832]; [/COLOR][COLOR=#cc7832] final [/COLOR]ModernRoboticsI2cGyro gyroSensor = (ModernRoboticsI2cGyro)[COLOR=#cc7832]this[/COLOR].[COLOR=#9876aa]hardwareMap[/COLOR].get([COLOR=#6a8759]"gyro"[/COLOR])[COLOR=#cc7832]; [/COLOR] gyroSensor.getI2cController().registerForI2cPortReadyCallback(gyroSensor[COLOR=#cc7832], [/COLOR]gyroSensor.getPort())[COLOR=#cc7832]; [/COLOR] } [COLOR=#cc7832] public void [/COLOR][COLOR=#ffc66d]loop[/COLOR]() {} }
Comment
-
We have the same problem. We have had a couple of side posts with mikets - he has been a great help. I am finally able to post to the forum, so...
We tested with an opmode based on TimerTest in this tread. We have 2 I2C devices and see ~100ms between gyro update rate when in power mode (RUN_WITHOUT_ENCODERS) set to 0.5. We see similar numbers in speed mode (RUN_USING_ENCODERS) set to 0.4 with maxSpeed 3000. These settings give 1 full turn in ~ 3.2s, and we see ~11 degree steps.
This is clearly unusable for PID based control for anything other than very slow turn rates.
We have a simple proportional only controller with a loop break if gyro heading <= THRESH. The threshold is 2 degrees. Quite often, we completely miss diving into this condition and end up with oscillation.
Does anyone know if FTC is looking into this? Is it likely to be in the FTC SDK or in the CDIM firmware?
We are considering separating the 2 I2C devices on to two separate CDIMs - seems a huge waste given all the CDIM inputs, but...
Any thoughts on whether or not this should give improvement over 2 I2Cs on 1 CDIM?
Our bot configuration has:
-3 motor controllers
--2 rear drive wheels (AndyMark motors)
--2 shooter motors (AndyMark)
--1 sweeper/1 elevator (Tetrix motors)
-1 servo controller
-- 2 connected servos
-1 CDIM
-- 1 MR I2C gyro
-- 1 MR I2C color sensor
Comment
-
Modern Robotics has conducted a series of tests to determine the throughput of the Core Device Interface Module (CDIM) hardware/firmware read requests for analog and I2C sensor ports. These tests were done using Windows desktop PC programmed with C++ and measure the time from issuing a read request to receiving the data back so the time includes the USB transmission times and the time taken by the CDIM firmware to process the read request. Each test read the sensor 1,000 times.
Analog Sensor Ports
8 analog ports, A0 - A7 were read each time in one read transaction so it did not matter how many analog sensors were attached, all 8 port values were returned every time.
The average time to read all 8 analog sensor ports in one transaction was 1.5ms.
I2C Sensor Ports
The test program read one I2C sensor in each read transactions. It is possible to issue multiple I2C read requests in one transaction but this feature was not used in these tests. Tests were run using multiple Modern Robotics color sensors and Modern Robotics gyro sensors. Each I2C read request returned 8 bytes of data from the sensor.
The average time to read an I2C sensor was 4.5ms.
These results show the times taken to read a sensor port and do not include the additional times needed by Android and the SDK to process read transactions.
Comment
-
Originally posted by Modern Robotics Support View PostModern Robotics has conducted a series of tests to determine the throughput of the Core Device Interface Module (CDIM) hardware/firmware read requests for analog and I2C sensor ports. These tests were done using Windows desktop PC programmed with C++ and measure the time from issuing a read request to receiving the data back so the time includes the USB transmission times and the time taken by the CDIM firmware to process the read request. Each test read the sensor 1,000 times.
Analog Sensor Ports
8 analog ports, A0 - A7 were read each time in one read transaction so it did not matter how many analog sensors were attached, all 8 port values were returned every time.
The average time to read all 8 analog sensor ports in one transaction was 1.5ms.
I2C Sensor Ports
The test program read one I2C sensor in each read transactions. It is possible to issue multiple I2C read requests in one transaction but this feature was not used in these tests. Tests were run using multiple Modern Robotics color sensors and Modern Robotics gyro sensors. Each I2C read request returned 8 bytes of data from the sensor.
The average time to read an I2C sensor was 4.5ms.
These results show the times taken to read a sensor port and do not include the additional times needed by Android and the SDK to process read transactions.
Code:[COLOR=#000080][B]package [/B][/COLOR]samples; [COLOR=#000080][B]import [/B][/COLOR]android.util.Log; [COLOR=#000080][B]import [/B][/COLOR]com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cGyro; [COLOR=#000080][B]import [/B][/COLOR][COLOR=#808000]com.qualcomm.robotcore.eventloop.opmode.Disabled[/COLOR]; [COLOR=#000080][B]import [/B][/COLOR]com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; [COLOR=#000080][B]import [/B][/COLOR][COLOR=#808000]com.qualcomm.robotcore.eventloop.opmode.TeleOp[/COLOR]; [COLOR=#000080][B]import [/B][/COLOR]com.qualcomm.robotcore.hardware.DcMotor; [COLOR=#808000]@TeleOp[/COLOR](name=[COLOR=#008000][B]"Test: Simple Sensor Sample Time"[/B][/COLOR], group=[COLOR=#008000][B]"3543TestSamples"[/B][/COLOR]) [COLOR=#808000]@Disabled [/COLOR][COLOR=#000080][B]public class [/B][/COLOR]SensorSampleTimeTest [COLOR=#000080][B]extends [/B][/COLOR]LinearOpMode { [COLOR=#000080][B]private enum [/B][/COLOR]SensorType { [COLOR=#660e7a][B][I]DRIVEBASE_ENCODERS[/I][/B][/COLOR], [COLOR=#660e7a][B][I]GYRO [/I][/B][/COLOR][COLOR=#660e7a][B][I] [/I][/B][/COLOR]} [COLOR=#000080][B]private static final [/B][/COLOR]String [COLOR=#660e7a][B][I]TAG [/I][/B][/COLOR]= [COLOR=#008000][B]"TrcDbg"[/B][/COLOR]; [COLOR=#000080][B]private static final double [/B][/COLOR][COLOR=#660e7a][B][I]DRIVE_POWER [/I][/B][/COLOR]= [COLOR=#0000ff]0.2[/COLOR]; [COLOR=#000080][B]private static final double [/B][/COLOR][COLOR=#660e7a][B][I]TURN_POWER [/I][/B][/COLOR]= [COLOR=#0000ff]0.5[/COLOR]; [COLOR=#000080][B]private static [/B][/COLOR]SensorType [COLOR=#660e7a][I]sensorType [/I][/COLOR]= SensorType.[COLOR=#660e7a][B][I]GYRO[/I][/B][/COLOR]; [COLOR=#000080][B]private static final [/B][/COLOR]DcMotor.Direction [COLOR=#660e7a][B][I]LEFTWHEEL_DIRECTION [/I][/B][/COLOR]= DcMotor.Direction.[COLOR=#660e7a][B][I]FORWARD[/I][/B][/COLOR]; [COLOR=#000080][B]private static final [/B][/COLOR]DcMotor.Direction [COLOR=#660e7a][B][I]RIGHTWHEEL_DIRECTION [/I][/B][/COLOR]= DcMotor.Direction.[COLOR=#660e7a][B][I]REVERSE[/I][/B][/COLOR]; [COLOR=#000080][B]private [/B][/COLOR]DcMotor [COLOR=#660e7a][B]lfWheel[/B][/COLOR]; [COLOR=#000080][B]private [/B][/COLOR]DcMotor [COLOR=#660e7a][B]rfWheel[/B][/COLOR]; [COLOR=#000080][B]private [/B][/COLOR]DcMotor [COLOR=#660e7a][B]lrWheel[/B][/COLOR]; [COLOR=#000080][B]private [/B][/COLOR]DcMotor [COLOR=#660e7a][B]rrWheel[/B][/COLOR]; [COLOR=#000080][B]private [/B][/COLOR]ModernRoboticsI2cGyro [COLOR=#660e7a][B]gyro[/B][/COLOR]; [COLOR=#000080][B]public void [/B][/COLOR]runOpMode() { initRobot(); waitForStart(); [COLOR=#000080][B]long [/B][/COLOR]minLoopInterval = Long.[COLOR=#660e7a][B][I]MAX_VALUE[/I][/B][/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]maxLoopInterval = Long.[COLOR=#660e7a][B][I]MIN_VALUE[/I][/B][/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]loopCount = [COLOR=#0000ff]0[/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]prevLoopTime = [COLOR=#0000ff]0[/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]minSampleInterval = Long.[COLOR=#660e7a][B][I]MAX_VALUE[/I][/B][/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]maxSampleInterval = Long.[COLOR=#660e7a][B][I]MIN_VALUE[/I][/B][/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]sampleCount = [COLOR=#0000ff]0[/COLOR]; [COLOR=#000080][B]long [/B][/COLOR]prevSampleTime; [COLOR=#000080][B]long [/B][/COLOR]startTime = System.[I]nanoTime[/I](); prevSampleTime = startTime; [COLOR=#000080][B]int [/B][/COLOR]prevSample = getSensorValue(); [COLOR=#000080][B]while [/B][/COLOR](opModeIsActive()) { [COLOR=#000080][B]long [/B][/COLOR]currTime = System.[I]nanoTime[/I](); [COLOR=#000080][B]int [/B][/COLOR]currSample = getSensorValue(); [COLOR=#000080][B]if [/B][/COLOR](prevLoopTime != [COLOR=#0000ff]0[/COLOR]) { [COLOR=#000080][B]long [/B][/COLOR]loopInterval = currTime - prevLoopTime; [COLOR=#000080][B]if [/B][/COLOR](currSample != prevSample) { [COLOR=#000080][B]long [/B][/COLOR]sampleTime = currTime - prevSampleTime; sampleCount++; prevSample = currSample; prevSampleTime = currTime; [COLOR=#000080][B]if [/B][/COLOR](sampleTime < minSampleInterval) minSampleInterval = sampleTime; [COLOR=#000080][B]else if [/B][/COLOR](sampleTime > maxSampleInterval) maxSampleInterval = sampleTime; } [COLOR=#000080][B]if [/B][/COLOR](loopInterval < minLoopInterval) { minLoopInterval = loopInterval; } [COLOR=#000080][B]else if [/B][/COLOR](loopInterval > maxLoopInterval) { maxLoopInterval = loopInterval; } runRobot(String.[I]format[/I]([COLOR=#008000][B]"[%4d:%7.3f] LoopInterval=%7.3f, "[/B][/COLOR], loopCount, (currTime - startTime)/[COLOR=#0000ff]1000000.0[/COLOR], loopInterval/[COLOR=#0000ff]1000000.0[/COLOR])); } prevLoopTime = currTime; loopCount++; } stopRobot(); [COLOR=#000080][B]long [/B][/COLOR]endTime = System.[I]nanoTime[/I](); Log.[I]i[/I]([COLOR=#660e7a][B][I]TAG[/I][/B][/COLOR], String.[I]format[/I]( [COLOR=#008000][B]"Loop: MinInterval=%7.3f, MaxInterval=%7.3f, AvgInterval=%7.3f"[/B][/COLOR], minLoopInterval/[COLOR=#0000ff]1000000.0[/COLOR], maxLoopInterval/[COLOR=#0000ff]1000000.0[/COLOR], (endTime - startTime)/[COLOR=#0000ff]1000000.0[/COLOR]/loopCount)); Log.[I]i[/I]([COLOR=#660e7a][B][I]TAG[/I][/B][/COLOR], String.[I]format[/I]( [COLOR=#008000][B]"Sensor: MinSampleInterval=%7.3f, MaxSampleInterval=%7.3f, AvgSampleInterval=%7.3f"[/B][/COLOR], minSampleInterval/[COLOR=#0000ff]1000000.0[/COLOR], maxSampleInterval/[COLOR=#0000ff]1000000.0[/COLOR], (endTime - startTime)/[COLOR=#0000ff]1000000.0[/COLOR]/sampleCount)); } [COLOR=#808080][I]//runOpMode [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#000080][B]private void [/B][/COLOR]initRobot() { [COLOR=#660e7a][B]lfWheel [/B][/COLOR]= [COLOR=#660e7a][B]hardwareMap[/B][/COLOR].[COLOR=#660e7a][B]dcMotor[/B][/COLOR].get([COLOR=#008000][B]"lfWheel"[/B][/COLOR]); [COLOR=#660e7a][B]rfWheel [/B][/COLOR]= [COLOR=#660e7a][B]hardwareMap[/B][/COLOR].[COLOR=#660e7a][B]dcMotor[/B][/COLOR].get([COLOR=#008000][B]"rfWheel"[/B][/COLOR]); [COLOR=#660e7a][B]lrWheel [/B][/COLOR]= [COLOR=#660e7a][B]hardwareMap[/B][/COLOR].[COLOR=#660e7a][B]dcMotor[/B][/COLOR].get([COLOR=#008000][B]"lrWheel"[/B][/COLOR]); [COLOR=#660e7a][B]rrWheel [/B][/COLOR]= [COLOR=#660e7a][B]hardwareMap[/B][/COLOR].[COLOR=#660e7a][B]dcMotor[/B][/COLOR].get([COLOR=#008000][B]"rrWheel"[/B][/COLOR]); [COLOR=#660e7a][B]lfWheel[/B][/COLOR].setDirection([COLOR=#660e7a][B][I]LEFTWHEEL_DIRECTION[/I][/B][/COLOR]); [COLOR=#660e7a][B]lrWheel[/B][/COLOR].setDirection([COLOR=#660e7a][B][I]LEFTWHEEL_DIRECTION[/I][/B][/COLOR]); [COLOR=#660e7a][B]rfWheel[/B][/COLOR].setDirection([COLOR=#660e7a][B][I]RIGHTWHEEL_DIRECTION[/I][/B][/COLOR]); [COLOR=#660e7a][B]rrWheel[/B][/COLOR].setDirection([COLOR=#660e7a][B][I]RIGHTWHEEL_DIRECTION[/I][/B][/COLOR]); [COLOR=#660e7a][B]lfWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]STOP_AND_RESET_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rfWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]STOP_AND_RESET_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]lrWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]STOP_AND_RESET_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rrWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]STOP_AND_RESET_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]lfWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]RUN_WITHOUT_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rfWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]RUN_WITHOUT_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]lrWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]RUN_WITHOUT_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rrWheel[/B][/COLOR].setMode(DcMotor.RunMode.[COLOR=#660e7a][B][I]RUN_WITHOUT_ENCODER[/I][/B][/COLOR]); [COLOR=#660e7a][B]gyro [/B][/COLOR]= (ModernRoboticsI2cGyro)[COLOR=#660e7a][B]hardwareMap[/B][/COLOR].[COLOR=#660e7a][B]gyroSensor[/B][/COLOR].get([COLOR=#008000][B]"gyroSensor"[/B][/COLOR]); [COLOR=#660e7a][B]gyro[/B][/COLOR].resetZAxisIntegrator(); } [COLOR=#808080][I]//initRobot [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#000080][B]private int [/B][/COLOR]getSensorValue() { [COLOR=#000080][B]int [/B][/COLOR]value = [COLOR=#0000ff]0[/COLOR]; [COLOR=#000080][B]switch [/B][/COLOR]([COLOR=#660e7a][I]sensorType[/I][/COLOR]) { [COLOR=#000080][B]case [/B][/COLOR][COLOR=#660e7a][B][I]DRIVEBASE_ENCODERS[/I][/B][/COLOR]: value = ([COLOR=#660e7a][B]lfWheel[/B][/COLOR].getCurrentPosition() + [COLOR=#660e7a][B]rfWheel[/B][/COLOR].getCurrentPosition() + [COLOR=#660e7a][B]lrWheel[/B][/COLOR].getCurrentPosition() + [COLOR=#660e7a][B]rrWheel[/B][/COLOR].getCurrentPosition())/[COLOR=#0000ff]4[/COLOR]; [COLOR=#000080][B]break[/B][/COLOR]; [COLOR=#000080][B]case [/B][/COLOR][COLOR=#660e7a][B][I]GYRO[/I][/B][/COLOR]: value = -[COLOR=#660e7a][B]gyro[/B][/COLOR].getIntegratedZValue(); [COLOR=#000080][B]break[/B][/COLOR]; } [COLOR=#000080][B]return [/B][/COLOR]value; } [COLOR=#808080][I]//getSensorValue [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#000080][B]private void [/B][/COLOR]runRobot(String prefix) { [COLOR=#000080][B]switch [/B][/COLOR]([COLOR=#660e7a][I]sensorType[/I][/COLOR]) { [COLOR=#000080][B]case [/B][/COLOR][COLOR=#660e7a][B][I]DRIVEBASE_ENCODERS[/I][/B][/COLOR]: [COLOR=#808080][I]// [/I][/COLOR][COLOR=#808080][I] // Driving forward and checking encoders. [/I][/COLOR][COLOR=#808080][I] // [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#660e7a][B]lfWheel[/B][/COLOR].setPower([COLOR=#660e7a][B][I]DRIVE_POWER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rfWheel[/B][/COLOR].setPower([COLOR=#660e7a][B][I]DRIVE_POWER[/I][/B][/COLOR]); [COLOR=#660e7a][B]lrWheel[/B][/COLOR].setPower([COLOR=#660e7a][B][I]DRIVE_POWER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rrWheel[/B][/COLOR].setPower([COLOR=#660e7a][B][I]DRIVE_POWER[/I][/B][/COLOR]); Log.[I]i[/I]([COLOR=#660e7a][B][I]TAG[/I][/B][/COLOR], prefix + String.[I]format[/I]([COLOR=#008000][B]"lf=%d, rf=%d, lr=%d, rr=%d"[/B][/COLOR], [COLOR=#660e7a][B]lfWheel[/B][/COLOR].getCurrentPosition(), [COLOR=#660e7a][B]rfWheel[/B][/COLOR].getCurrentPosition(), [COLOR=#660e7a][B]lrWheel[/B][/COLOR].getCurrentPosition(), [COLOR=#660e7a][B]rrWheel[/B][/COLOR].getCurrentPosition())); [COLOR=#000080][B]break[/B][/COLOR]; [COLOR=#000080][B]case [/B][/COLOR][COLOR=#660e7a][B][I]GYRO[/I][/B][/COLOR]: [COLOR=#808080][I]// [/I][/COLOR][COLOR=#808080][I] // Turning right and checking gyro. [/I][/COLOR][COLOR=#808080][I] // [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#660e7a][B]lfWheel[/B][/COLOR].setPower([COLOR=#660e7a][B][I]TURN_POWER[/I][/B][/COLOR]); [COLOR=#660e7a][B]lrWheel[/B][/COLOR].setPower([COLOR=#660e7a][B][I]TURN_POWER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rfWheel[/B][/COLOR].setPower(-[COLOR=#660e7a][B][I]TURN_POWER[/I][/B][/COLOR]); [COLOR=#660e7a][B]rrWheel[/B][/COLOR].setPower(-[COLOR=#660e7a][B][I]TURN_POWER[/I][/B][/COLOR]); Log.[I]i[/I]([COLOR=#660e7a][B][I]TAG[/I][/B][/COLOR], prefix + String.[I]format[/I]([COLOR=#008000][B]"heading=%d"[/B][/COLOR], -[COLOR=#660e7a][B]gyro[/B][/COLOR].getIntegratedZValue())); [COLOR=#000080][B]break[/B][/COLOR]; } } [COLOR=#808080][I]//runRobot [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR][COLOR=#000080][B]private void [/B][/COLOR]stopRobot() { [COLOR=#660e7a][B]lfWheel[/B][/COLOR].setPower([COLOR=#0000ff]0.0[/COLOR]); [COLOR=#660e7a][B]lrWheel[/B][/COLOR].setPower([COLOR=#0000ff]0.0[/COLOR]); [COLOR=#660e7a][B]rfWheel[/B][/COLOR].setPower([COLOR=#0000ff]0.0[/COLOR]); [COLOR=#660e7a][B]rrWheel[/B][/COLOR].setPower([COLOR=#0000ff]0.0[/COLOR]); } [COLOR=#808080][I]//stopRobot [/I][/COLOR][COLOR=#808080][I] [/I][/COLOR]} [COLOR=#808080][I]//class SensorSampleTimeTest[/I][/COLOR]
Comment
-
Before I conduct my own set of experiments exploring workarounds for the stale data issue that is being discussed. It seems to me that when the various I2C objects are being constructed they are being "engaged" and thus using USB bandwidth which is the problem being actively discussed (so far as I can see).
Has anyone trying calling disengage of after acquiring I2C devices that are not correctly in use, and then re-calling engage before the programmer starts using the device. Keep in mind that "disengage"/"engage" are considered protected methods, and therefore you have to implement a method of disengaging Java modifier protection or create a forward delegate providing access to those methods.
I would not recommend this be done by someone inexperienced at programming since you are running the risk of breaking something in the internal SDK by performing this experiment.
Comment
-
Update: I ran a test tonight with a similar TimerTest, but with the color sensor removed from the robot config. Sample times went from 100ms (with gyro and color sensor) to 30-40 ms (with just gyro. We are going to try to add a second CDIM. Huge overkill to have all those ports on 2 modules just to each have 1 device connected, but if it gives that much improvement - with 1.5 weeks to states, then I'll take it.
I have read some of the discussions on the I2C handling of read and write, but have not dug into any of the code deeply.
Does anyone know if other combinations (that don't include a gyro) are affected in a similar manner?
Comment
-
Originally posted by FTC7253 View PostUpdate: I ran a test tonight with a similar TimerTest, but with the color sensor removed from the robot config. Sample times went from 100ms (with gyro and color sensor) to 30-40 ms (with just gyro. We are going to try to add a second CDIM. Huge overkill to have all those ports on 2 modules just to each have 1 device connected, but if it gives that much improvement - with 1.5 weeks to states, then I'll take it.
I have read some of the discussions on the I2C handling of read and write, but have not dug into any of the code deeply.
Does anyone know if other combinations (that don't include a gyro) are affected in a similar manner?
Comment
-
Originally posted by FTC7253 View PostWhat manufacturer and class are these "obsolete" gyros?John McDonnell
Volunteer, former mentor
Comment
-
Originally posted by FTC7253 View PostWhat manufacturer and class are these "obsolete" gyros?
In any case, any analog gyro would work including the one JohnMcDonnell suggested. In fact, that gyro has very similar spec to the one we are using.
Comment
-
It is this gyro:
http://wpilib.screenstepslive.com/s/...ving-direction
I believe it has an Analog Device chip on it. Don't know the part number on the chip though. In any case, like I said, any analog gyro would work.
Comment
-
Since it would appear that these don't include on-board integration, you'll have to handle that yourself in software. Ensuring timing and signal delays will be "interesting"...Technical Coach, Newton Busters FTC 10138, FLL 3077
Chicago 'burbs, IL
Comment
-
From FTC Team 358's guide :
Accelerometer/Gyro
The sensor board in the 2012 FRC Kit of Parts hosts both an Analog Devices ADXL345 3-axis Digital Accelerometer and an Analog Devices ADW22307 1-axis Analog Gyroscope.John McDonnell
Volunteer, former mentor
Comment
Comment