![]() |
ADXRS450 Gyro board not feeding back
Hi guys, we are having some issues getting feedback from our ADXRS450 gyro. We have exhausted all of the troubleshooting that we can think of, but maybe somebody else experienced similar issues and is able to help.
self.gyro = wpilib.ADXRS450_Gyro(0) ^Here's the init wpilib.SmartDashboard.putNumber("GyroAngle",self.g yro.getAngle()) ^Here's the output command to the java dashboard. When we implement the gyro in we can run and drive the robot but we get the 'wpilib.motorsafety : Robot Drive... Output not updated often enough.' error over and over again. -We have the latest version of robotpy -We are on the right port -our dashboard accepts feedback from other sources -We've rotated the RIO on all 6 axis's to try and get feedback |
Re: ADXRS450 Gyro board not feeding back
Hm. What does the rest of your code look like?
I've not tried the ADXRS450 gyro (I don't have one)... but it should work? I just reviewed the source code and it looks identical to the java code... the one thing I'm not 100% sure on is the readRegister function, as it creates a ByteBuffer in BIG_ENDIAN mode.. but that's only called on initialization, and if there's an error there it would set .spi to None. Can you check to see if .spi is None? If it is, I can dig into this a bit more tomorrow night. |
Re: ADXRS450 Gyro board not feeding back
I forgot that this came in the kit of parts, I've retrieved one and I'll test it tonight when I get home.
|
Re: ADXRS450 Gyro board not feeding back
We actually tested all of the ports that it can look for, 0/None through 5, and we got errors whenever the ID passed to it isn't equal to 0/None.
I'd post code but I'm currently getting yelled at for not committing my changes to GitHub, and because they aren't committed I can't pull them up right now I'll merge it tonight at around 6:30 EST and either post a link to the github or just paste it in a post Thanks for your time. |
Re: ADXRS450 Gyro board not feeding back
|
Re: ADXRS450 Gyro board not feeding back
I tried out the gyro, works like a charm under RobotPy.
The error is in your code, there's no reason to call calibrate -- it's already called in the constructor. Additionally, calibrate basically freezes the robot's operation for 5 seconds -- during which time you'll see the motor safety errors. :) Get rid of the calibrate and it should work. |
Re: ADXRS450 Gyro board not feeding back
We updated the code not to have the calibrate or reset functions, no feedback from the gyro.
Next, we copied the sampleRobot code from the wpilib website, and implemented only the gyro code, no feedback. We then deployed C++ onto the same robot, and got feedback from the gyro, so we know it's not a hardware problem. You can see the current code we are using in the Initial-Code-Copy branch. I'd hate to ask for a code snippet but we are on day 4 of trying to get this thing working at this point https://github.com/Team74/FRC_2017_P...-Copy/robot.py ^Current Robot Code https://github.com/Team74/FRC_2017_P...ging/Robot.cpp ^C++ code for comparison https://github.com/Team74/FRC_2017_P...gging/Robot.py ^SampleRobot tests Currently running pyfrc version 2017.0.4 |
Re: ADXRS450 Gyro board not feeding back
Quote:
Code:
>>> import wpilibOne difference that I thought of is that I'm using a slightly newer version RobotPy that I'm working on adding some things to, but I don't think there have been any changes that would impact it. I'll try installing 2017.0.4 also to make sure that works also. |
Re: ADXRS450 Gyro board not feeding back
We just tried it over SSH and it works great, but our robot code doesn't receive any feedback from the gyro
|
Re: ADXRS450 Gyro board not feeding back
Quote:
|
Re: ADXRS450 Gyro board not feeding back
I am able to confirm that your sample program does not work. Digging some more into this, it's very strange.
|
Re: ADXRS450 Gyro board not feeding back
The issue is that HALInitialize was being called twice. This bug is fixed in RobotPy 2017.0.5, please upgrade and let me know if that addresses your issue.
|
Re: ADXRS450 Gyro board not feeding back
Patch works great! It is all working as intended now, thanks so much for your help, now, on to vision code! :ahh:
|
| All times are GMT -5. The time now is 15:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi