Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Rookie Programmers-Mecanum Help Wanted (http://www.chiefdelphi.com/forums/showthread.php?t=133570)

Team3220 27-01-2015 14:49

Rookie Programmers-Mecanum Help Wanted
 
We are first time programmers, and we have decided to go with a mecanum drive this year. We have been running the default roboRIO Mecanum With Arm code, and we are driving great. However, our driver hates using the z axis (the little dial) for rotating. How would we change it to buttons 4 and 5 on a Logitech Attack 3? It's the default code, but we can post a picture if you guys think it will help. Thanks!

nwall 27-01-2015 15:13

Re: Rookie Programmers-Mecanum Help Wanted
 
1 Attachment(s)
Here is an example of how you can do this, but you will probably need to play with the values and array indices (I don't have the joystick or your robot sitting here).

The first part is just opening the refnum to the joystick, and assign the X/Y axis to the Holonomic Drive block as usual, but in order to get the Rotation, we simply put it through two Select blocks to get which direction it should turn. Keep in mind that button 4 overrides button 3, but you probably aren't pushing both buttons at the same time with the same finger.

Team3220 27-01-2015 17:12

Re: Rookie Programmers-Mecanum Help Wanted
 
what VI do we put this into?

nwall 27-01-2015 17:16

Re: Rookie Programmers-Mecanum Help Wanted
 
You can put this inside of Teleop, sorry.

Ether 27-01-2015 17:34

Re: Rookie Programmers-Mecanum Help Wanted
 
Quote:

Originally Posted by Team3220 (Post 1434779)
our driver hates using the z axis (the little dial) for rotating.


You should read this thread about driver interface. Your driver may be much happier with two 2-axis joysticks instead of just one.


[HT]3KEZ 16-02-2015 18:32

Re: Rookie Programmers-Mecanum Help Wanted
 
Does anyone know how to do this in Java?

Ether 16-02-2015 18:39

Re: Rookie Programmers-Mecanum Help Wanted
 
Quote:

Originally Posted by [HT]3KEZ (Post 1445292)
Does anyone know how to do this in Java?

Try posting in the Java programming subforum.



Alan Anderson 16-02-2015 18:49

Re: Rookie Programmers-Mecanum Help Wanted
 
Quote:

Originally Posted by [HT]3KEZ (Post 1445292)
Does anyone know how to do this in Java?

To use mecanum drive in Java, it's something simple like using the mecanum drive method of the robot drive class. If you have Java programming questions, please ask them in the Java forum.

Ether 16-02-2015 18:52

Re: Rookie Programmers-Mecanum Help Wanted
 
Quote:

Originally Posted by [HT]3KEZ (Post 1445292)
Does anyone know how to do this in Java?

RobotDrive.java in WPILib

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.
    */
    public void mecanumDrive_Cartesian(double x, double y, double rotation, double gyroAngle) {
        if(!kMecanumCartesian_Reported) {
            UsageReporting.report(tResourceType.kResourceType_RobotDrive, getNumMotors(), tInstances.kRobotDrive_MecanumCartesian);
            kMecanumCartesian_Reported = true;
        }



All times are GMT -5. The time now is 08:56.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi