Say we have an omni wheel with a CTRE absolute encoder centered in the robot, spring-loaded against the floor and parallel with both sides of a 6WD arcade robot. I also have a NavX providing accurate yaw data. What are some strategies we can look at for adapting a traditional “encoders on both sides of the drivetrain” approach to generating an onboard TalonSRX motion profile if we don’t have a particularly easy path to integrating encoders directly onto the drivetrain sides?
What type of drivetrain to you have? Even if you had an omni wheel near each side of the drivetrain they encoder wheels would not spin quite as much as the drivetrain sides. If you are using mechanum, you could place the omnis in the center on each side.
It’s a standard WCD tank drive, no frills. We just don’t have a good way to get encoders attached to each side of the drive this year. I can mount a follower (omni) wheel dead center of the robot to track distance travelled, and we have good data coming from our gyroscope to track heading.
Assuming you want to execute curved trajectories (as seen here: https://github.com/JacisNonsense/Pathfinder/wiki/Pathfinder-for-FRC---Java), you will need a follower for each side. If you are using the kitbot there is an easy way to mount Mag Encoders but it sounds like you are not. The problem is that you really need a separate feedback loop for each side of the drivetrain, even for just driving straight. You could maybe finesse and use a combination of the encoder and the gyro, but that would be sketch. I don’t think there is a way to wire one encoder to two talons, and it would be very ineffective if you did.
That makes sense. I was hoping there was an easy way to extrapolate different wheel speeds from a single encoder and a gyro for more of a curved trajectory than a point-to-point auto. I may yet be able to rework a few things on the hardware side for extra sensors, but I was holding out for a possible software solution. Thanks for the advice.
Pathfinder is pretty much a rewrite of TrajectoryLib in C. If you look at the makeLeftAndRightTrajectories function in TrajectoryLib (https://github.com/Team254/TrajectoryLib/blob/master/src/com/team254/lib/trajectory/PathGenerator.java) you may be able to apply this in reverse with a NavX and follow the center trajectory. I don’t think it is advised, but may be theoretically possible, though on the Rio not an SRX. I think that would be quite ambitious to get working in four days. Good luck!