Go to Post Hey people, I found out the answer to my question and that one guy eric is right all you have to do is read the manual. The rules are in chapter 7.3.5.1, sections - .:) - ronald [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 06-01-2015, 17:39
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Mechanum with XBox Controller

As of now our team has the XBox controller working using ArcadeDrive. But we now want to use mechanum wheels.. I have an okay understanding of how to do this with a joystick using x, y, and twist but how do I do it with an XBox controller. I don't even know how I would begin to structure the code.

ANY help would be GREATLY appreciated! THANKS!
Reply With Quote
  #2   Spotlight this post!  
Unread 06-01-2015, 18:31
cyborgstx's Avatar
cyborgstx cyborgstx is offline
Registered User
AKA: Lydia
FRC #3335 (Cy-Ranch Cy-Borgs)
Team Role: Coach
 
Join Date: Nov 2013
Rookie Year: 2011
Location: Houston, TX
Posts: 3
cyborgstx is an unknown quantity at this point
Re: Mechanum with XBox Controller

What template are you using? I could give you Iterative sample code.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-01-2015, 23:07
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 358
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Mechanum with XBox Controller

Something like this:

float gyroAngle = 0.0; // we don't have a gyro connected
myRobot->MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetZ(), gyroAngle);
__________________
Brian K
Team 1225 Robotics Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 07-01-2015, 08:33
afiolmahon afiolmahon is offline
Registered User
FRC #1218
 
Join Date: Dec 2014
Location: Philadelphia
Posts: 7
afiolmahon is an unknown quantity at this point
Re: Mechanum with XBox Controller

I would just pick one of the sticks for your X and Y axis, and then a good replacement for the joystick twist would be using the analog triggers on the xbox controller. If you need Axis numbers, the input tab on the driver station has live controller readings and axis/button numbers.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-01-2015, 09:47
daniel12997's Avatar
daniel12997 daniel12997 is offline
Student
AKA: Daniel Parker
FRC #1736 (Robot Casserole)
Team Role: Student
 
Join Date: Nov 2014
Rookie Year: 2014
Location: United States
Posts: 14
daniel12997 is an unknown quantity at this point
Re: Mechanum with XBox Controller

Could you use one of the joysticks for forward backward and strafing and the other joystick for rotation.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-01-2015, 11:07
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Re: Mechanum with XBox Controller

Im using command base but just any code examples will do - its easy to change over.

Yeah I was thinking about what daniel was saying - using one stick for x and y and the other for rotation - right now only one is being used.
Reply With Quote
  #7   Spotlight this post!  
Unread 07-01-2015, 11:22
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Re: Mechanum with XBox Controller

Okay here is what I was thinking - use L1 and R1 to turn slow and L2 and R2 to turn fast. Then use left joystick x to move left and right and left joystick y to move up and down - if I push up on the joystick AND move it right the robot should move diagonally - will this work and if so how would I implement it? I also want to be able to have a button - probably the up arrow and down arrow - that I can change the speed with.

THANKS for the help!
Reply With Quote
  #8   Spotlight this post!  
Unread 07-01-2015, 11:54
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,612
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Mechanum with XBox Controller

Quote:
Originally Posted by LFRobotics View Post
But we now want to use mechanum wheels..
What size mechanum wheels and what gearbox ratio ?
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
Reply With Quote
  #9   Spotlight this post!  
Unread 07-01-2015, 12:18
Ethan_P Ethan_P is offline
Registered User
FRC #1895 (Lambda Corps)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Virginia
Posts: 3
Ethan_P is an unknown quantity at this point
Re: Mechanum with XBox Controller

for mechanum wheels, our team also uses a Xbox controller. We have the right joystick axis mapped to the linear movement of the robot, and the the left joystick x axis mapped to the rotation.
Here's a simplified version of our code:

//FLMotor = Front Left Motor
//FRMotor = Front Right Motor
//BLMotor = Back Left Motor
//BRMotor = Back Right Motor
//x = right joystick, x axis
//y = right joystick, y axis
//yaw = left joystick, x axis

FLMotor = y + x + yaw
FRMotor = y - x - yaw
BLMotor = y - x + yaw
BRMotor = y + x - yaw

The values will have to be limited, other-wise it will go beyond the accepted values (-1 to 1). Make sure the wheels are set up properly, and good luck!
Reply With Quote
  #10   Spotlight this post!  
Unread 07-01-2015, 13:06
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Re: Mechanum with XBox Controller

6in and we have not decided on the ratios yet - what is suggested - also should we purchase Heavy Duty or Standard Duty wheels?

Okay thanks Ethan I think im starting to get a picture of what I need to do
Reply With Quote
  #11   Spotlight this post!  
Unread 07-01-2015, 14:20
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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: Mechanum with XBox Controller

Quote:
Originally Posted by Ethan_P View Post
The values will have to be limited, other-wise it will go beyond the accepted values (-1 to 1).
Make sure you do the limiting via normalization, not clipping.


Reply With Quote
  #12   Spotlight this post!  
Unread 07-01-2015, 15:30
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Re: Mechanum with XBox Controller

And how exactly do I do that?
Reply With Quote
  #13   Spotlight this post!  
Unread 07-01-2015, 16:10
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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: Mechanum with XBox Controller

Quote:
Originally Posted by LFRobotics View Post
And how exactly do I do that?
Search for the word "normalize" in these docs:

http://www.chiefdelphi.com/media/papers/download/2783


Reply With Quote
  #14   Spotlight this post!  
Unread 07-01-2015, 22:22
Mecanum Wheel's Avatar
Mecanum Wheel Mecanum Wheel is offline
It's spelled mecanum
AKA: Bengt Ilon
no team
Team Role: Mechanical
 
Join Date: Jan 2015
Rookie Year: 2004
Location: Sweden
Posts: 18
Mecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond reputeMecanum Wheel has a reputation beyond repute
Re: Mechanum with XBox Controller

Quote:
Originally Posted by LFRobotics View Post
As of now our team has the XBox controller working using ArcadeDrive. But we now want to use mechanum wheels.. I have an okay understanding of how to do this with a joystick using x, y, and twist but how do I do it with an XBox controller. I don't even know how I would begin to structure the code.

ANY help would be GREATLY appreciated! THANKS!
Quote:
Originally Posted by lynca View Post
What size mechanum wheels and what gearbox ratio ?
Quote:
Originally Posted by Ethan_P View Post
for mechanum wheels, our team also uses a Xbox controller. We have the right joystick axis mapped to the linear movement of the robot, and the the left joystick x axis mapped to the rotation.
Here's a simplified version of our code:

//FLMotor = Front Left Motor
//FRMotor = Front Right Motor
//BLMotor = Back Left Motor
//BRMotor = Back Right Motor
//x = right joystick, x axis
//y = right joystick, y axis
//yaw = left joystick, x axis

FLMotor = y + x + yaw
FRMotor = y - x - yaw
BLMotor = y - x + yaw
BRMotor = y + x - yaw

The values will have to be limited, other-wise it will go beyond the accepted values (-1 to 1). Make sure the wheels are set up properly, and good luck!
Hey LF, Andrew, and Ethan! Just for future reference, it's spelled mecanum. It's an easy mistake to make. Good luck this season!
Reply With Quote
  #15   Spotlight this post!  
Unread 07-01-2015, 23:17
Sl3dman's Avatar
Sl3dman Sl3dman is offline
Registered User
FRC #1339 (Angelbots)
Team Role: Programmer
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Colorado
Posts: 6
Sl3dman is an unknown quantity at this point
Re: Mechanum with XBox Controller

I would start here. https://wpilib.screenstepslive.com/s...-mecanum-drive
Our team did our first mecanum over off season and found out that it was better to replace the "Get Z Axis" and "Get X Axis" and "Get Y Axis" with get raw axis with which ever ones you want. We put the X Axis to strafe left and right on axis 0 (left joystick X Axis). The Y Axis to go forwards and backwards on axis 1 (left joystick Y Axis). And for rotation, we put axis on the right X Axis on axis 4 (right joystick X Axis). Also make sure they your motor controllers are set up in the correct order when you set it up. Hopefully that helps some.
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 13:16.

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