|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is RobotDrive required ?
Hi everyone,
I would like to know if the RobotDrive class is required. Basically, we have a mechanum drive system, and we control the motors with the Set member of the Talon class. It's working like a charm so far. I would like to know if I'm not making any big mistakes here. Thanks |
|
#2
|
||||||
|
||||||
|
There is no requirement to use robot drive. It's there to make your life easier.
|
|
#3
|
|||
|
|||
|
Re: Is RobotDrive required ?
Ok, thanks !
(and I must add it wasn't making my life easier) |
|
#4
|
||||
|
||||
|
Re: Is RobotDrive required ?
How is your home-brew mecanum code different from what's in WPILib??
|
|
#5
|
||||
|
||||
|
Re: Is RobotDrive required ?
I can't speak for his code but a good start would be to make the mixing function be able to be called seperately from changing motor outputs.
|
|
#6
|
|||
|
|||
|
Re: Is RobotDrive required ?
Quote:
Both joysticks up : move forward Both joysticks down : move backward One up, one down : rotation Both left/right : sideway movement We used it in other competitions (Vex) and we found it to be way more intuitive Here's the code itself (in a stripped down version): frontLeft->Set(-stick.GetRawAxis(2)+stick.GetRawAxis(1)); backLeft->Set(-stick.GetRawAxis(2)-stick.GetRawAxis(1)); frontRight->Set(stick.GetRawAxis(4)+stick.GetRawAxis(3)); backRight->Set(stick.GetRawAxis(4)-stick.GetRawAxis(3)); |
|
#7
|
||||
|
||||
|
Re: Is RobotDrive required ?
Quote:
First do this: Code:
Y = (Yleft + Yright)/2 Rotation = (Yleft - Yright)/2 X = (Xleft + Xright)/2 Code:
/** * Drive method for Mecanum wheeled robots. * * A method for driving with Mecanum wheeled robots. There are 4 wheels * on the robot, arranged so that the front and back wheels are toed in 45 degrees. * When looking at the wheels from the top, the roller axles should form an X across the robot. * * This is designed to be directly driven by joystick axes. * * @param x The speed that the robot should drive in the X direction. [-1.0..1.0] * @param y The speed that the robot should drive in the Y direction. * This input is inverted to match the forward == -1.0 that joysticks produce. [-1.0..1.0] * @param rotation The rate of rotation for the robot that is completely independent of * the translation. [-1.0..1.0] * @param gyroAngle The current angle reading from the gyro. Use this to implement field-oriented controls. */ void RobotDrive::MecanumDrive_Cartesian(float x, float y, float rotation, float gyroAngle) |
|
#8
|
||||
|
||||
|
Re: Is RobotDrive required ?
Quote:
|
|
#9
|
|||||
|
|||||
|
Re: Is RobotDrive required ?
Quote:
Forward - drive forward Left - strafe left Right - strafe right Backwards - drive backwards Twist - rotate Do you not have a joystick that has a twist motion? |
|
#10
|
|||
|
|||
|
Re: Is RobotDrive required ?
@Ether
Code:
Y = (Yleft + Yright)/2 Rotation = (Yleft - Yright)/2 X = (Xleft + Xright)/2 Many times, I found myself having one joystick up and one left. It allows me to make the robot do some movements that are otherwise difficult. Also, I have been able to control the robot with a dead motor. I was still able to move it around easily, while I couldn't with the original WPILib MechanumDrive. Last thing I like about it : Left Joystick controls left wheels, right joystick controls right wheels. No confusion about that. Also, what do you mean by "3DoF" ? @notmattlythgoe We do have a 3-axis joystick, only we find it to be unaccurate @Both of you (and everyone else) I may be wrong, please correct me if it's the case |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|