We are trying to use mecanum wheels with talon fx motors but are having trouble programming it. Does anyone have any experience working with mecanum wheels and talon fx motors with java.
This should get you started Driving a Robot using Mecanum Drive — FIRST Robotics Competition documentation
Okay i checked it out but it only talks about C++ and I am using java. Is there one for java?
These are the docs for using WPILib for Mecanum drive.
That one is using spark max speed controllers, do you know of ones with the integrated speed controllers. Anyways thank you
So here’s the thing, no one is going to have exactly what you want, you’re going to have to piece together examples. That’s kind of coding works in a sense."
To point you in the right direction: notice the example provided by @superpenguin612 uses spark max motor controllers, but you have TalonFX motor controllers. If we look at the java API for wpilib, you’ll see that the MecanumDrive class takes in 4 Motorcontroller objects.
If you’re willing to use a PWMTalonFX, you’re fine and dandy. (Can one be dandy without being fine? Anywho). I don’t specifically know if you can just use a TalonFX in this, but my gut feeling is no.
You also have the option of writing your own as well within a subsystem class. It’s going to be more work but might get you the results your want. Here’s a video about some of the basic equations used in mecanum drive.
Oh okay i see, I’ll take a look at the docs you provided, thank you I really appreciate all that.
It should be noted that a bunch of Java examples exist here WPILib Example Projects — FIRST Robotics Competition documentation
and if you are using Falcon motors (with integrated Talon FX), there’s tons of great examples here from CTRE:
Oh okay I’ll check those out as well, thanks.