Go to Post I...want...to...go...to...Champs. REALLY REALLY BADLY. - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2015, 21:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum Single Joystick Control not working

Quote:
Originally Posted by pastelpony View Post
Correct me if I'm wrong, but I've been reading that the default mecanum code in the WPI library actually takes the incorrect inputs by default.
Would you please post a link to where you've been reading that?

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;
I'm not a Java guru, but it looks correct to me.


Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2015, 21:20
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum Single Joystick Control not working

Quote:
Originally Posted by Ether View Post
Would you please post a link to where you've been reading that?

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;
I'm not a Java guru, but it looks correct to me.


I'm not quite sure how credible this is, but it sure did help me.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2015, 22:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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