|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Mecanum Single Joystick Control not working
No, don't do that.
Just make absolutely sure that the corners you have your motors on are the same as the corners you're telling the program they are on in Begin. Usually it's the two right side motors that need to be inverted. How did you change it from Open 2 Motors to Open 4 Motors? If you used the "Replace" menu option, you might find that some of the constants' labels are left over from the default code and don't match what are actually connected to. You might find it easiest to delete the Open 4 Motor Drive function and all its associated inputs from Begin.vi, then replace them. |
|
#2
|
|||||
|
|||||
|
Re: Mecanum Single Joystick Control not working
Quote:
The reason that only one side needs to be inverted is that the motors themselves have opposite orientations. A clockwise shaft rotation (viewed from the motor side) is forward on the left and reverse on the right for no gearbox or a spur gearbox with an even number of stages. |
|
#3
|
||||
|
||||
|
Re: Mecanum Single Joystick Control not working
For some reason, it seems as the inputs in the default mecanum code are inverted for some people, including myself. I'm not sure if this occurs for everyone, but just try to play with your joystick inputs and inversions. I personally had to edit the default code to get the wheels to spin the right way. You probably don't have to.
|
|
#4
|
||||
|
||||
|
Re: Mecanum Single Joystick Control not working
If by "play with your joystick inputs" you mean "wire the joystick values to the wrong inputs on the robot drive vi", that should never be necessary... and it makes your code confusing and difficult for others to help you.
Quote:
|
|
#5
|
||||
|
||||
|
Re: Mecanum Single Joystick Control not working
Quote:
|
|
#6
|
||||
|
||||
|
Re: Mecanum Single Joystick Control not working
[quote=pastelpony;1438465]Good point. Thanks.
|
|
#7
|
||||
|
||||
|
Re: Mecanum Single Joystick Control not working
Quote:
I don't have access to LabVIEW to inspect its code, but here's the inverse kinematics code taken straight from 2015 WPILib RobotDrive.Java: Code:
wheelSpeeds[MotorType.kFrontLeft_val] = xIn + yIn + rotation;
wheelSpeeds[MotorType.kFrontRight_val] = -xIn + yIn - rotation;
wheelSpeeds[MotorType.kRearLeft_val] = -xIn + yIn + rotation;
wheelSpeeds[MotorType.kRearRight_val] = xIn + yIn - rotation;
|
|
#8
|
||||
|
||||
|
Re: Mecanum Single Joystick Control not working
Quote:
|
|
#9
|
|||
|
|||
|
Re: Mecanum Single Joystick Control not working
I compared the LV code to the attached Java, and they are the same.
The LV code first does a gyro transformation in case you have one and want to use field coordinates. The code then uses the same expressions on the same inputs with the same output names. The code then normalizes the motor outputs. If you have an issue with the code, can you be more specific about what was wrong with it? Greg McKaskle |
|
#10
|
|||
|
|||
|
Re: Mecanum Single Joystick Control not working
Thank you all we got it working our wheels were inverted.
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|