Swerve Get Pose Without Gyro

Hi, we have swerve drive and I was wondering how I can get the pose for the swerve drive throughout autonomous without using an external gyro sensor. Currently we use swerve drive odometry but it seems like some of the methods we use need a heading reading which we take from the gyro. Is there any way we can do this without the external gyro? Thanks!

They are not very reliable, if they work. Is there a reason you can’t use an external gyro like the navX2 micro or navX?

Yeah we would definitely prefer the external gyro which I am trying to implement now but in case the gyro does not work I would prefer to have a backup, potentially. Thanks!

The current problem with the gyro is that it says “could not find ADXRS450 gyro on SPI port 0 ” so if anyone has any advice with fixing that it would be much appreciated. Thanks!

is it connected to SPI port CS0 according to your jumpers, ADXRS450 Gyro Board for FIRST Robotics [Analog Devices Wiki]

and the roboRIO manual pg 13?

We’re trying the gyro but we’re having some issues and I want to have a backup in case, is there any way at all to get the robot pose without using the gyro? Thank you so much!

6328 has some code that does exactly this: FRC 6328 Mechanical Advantage 2022 Build Thread - #160 by jonahb55. However, this is really more of a backup rather than a working solution. As noted by others, all your efforts should really be focused on using an external gyro.

2 Likes

One solution is just to set a distance in a command, set a max speed, set speed to distance / 10 or something like that, set chassisspeed to that speed, then subtract the speed from the distance. You will need to mess around with the gear ratios and such, but it is a simple and fast fix that works well. Of course, it doesn’t account for drift, however, which is a problem if the bot is drifty.

I would just bite the bullet and get a pigeon 2.0. You will be able to use it for many many years, and you don’t have to mess around with the analog devices gyro which we have had problems with in the past. We switched to a pigeon this year and have had 0 issues with implementation or drift.

I’d second this except:

NavX Micro is in stock, but the usb connector is finicky. Be sure to mount it well if you go this route.

The navX says it will be in stock on March 28th. If you aren’t using MXP port on the rio, this is a good choice.