View Single Post
  #1   Spotlight this post!  
Unread 26-09-2013, 18:07
thinker&planner thinker&planner is online now
Registered User
AKA: CAAAAAD
no team
Team Role: Mechanical
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Tallahassee, FL
Posts: 115
thinker&planner is a splendid one to beholdthinker&planner is a splendid one to beholdthinker&planner is a splendid one to beholdthinker&planner is a splendid one to beholdthinker&planner is a splendid one to beholdthinker&planner is a splendid one to beholdthinker&planner is a splendid one to behold
Mecanum Tank drive

Our team has been trying to develop a program to allow us to drive our robot "Tank" style with two joysticks yet still have parallel control of the side-to-side movement of Macanum at the same time.
In a simpler way: With an Xbox controller, use the y-axis of each stick to control the forward-backward movement of each side, tank style, but still factoring in the value of side-to-side motion from the analog triggers.

We have tried to write many programs, and none of them have quite worked.
From scratch, simply writing something like this ends up only being able to control fwd/bkw or strafe, not both at the same time.
Code:
    public void SetRight(double RightY)
 {
        FrontRight.set(-RightY);
        RearRight.set(-RightY);
    }
    public void SetLeft(double LeftY) {
        FrontLeft.set(-LeftY);
        RearLeft.set(-LeftY);
    }
    public void Strafe(double RightX) {
        FrontLeft.set(RightX);
        RearLeft.set(-RightX);
        FrontRight.set(RightX);
        RearRight.set(-RightX);
}
So we tried to use the pre-existing function drive.mecanumDrive_Cartesian setup with the X value as simply the "x" trigger axis, and for the Y and Twist axis, averaging and getting the difference of the two sticks. (I can't seem to upload the table that we made to prove it)

But even this algorithm does not seem to work. When we tested it, it seemed like the wheels were fighting themselves (something like if we told it to go sideways it would try to go both left and right at the same time)

Has anyone attempted anything like this? How should we proceed? Should we write a completely new function, or should we tinker with the pre-written ones?
Reply With Quote