Go to Post "When I joined the team, I was told that we'd be in the shop for six weeks. I STILL haven't seen a single boutique, and now they have me dumpster diving for robot parts! I quit!" - EricH [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 04-03-2013, 17:40
sunny1118 sunny1118 is offline
Registered User
FRC #0224 (The Tribe)
Team Role: Leadership
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Piscataway,NJ
Posts: 16
sunny1118 is an unknown quantity at this point
Making a 2 axis controller turn the robot

We have our 3 axis controller do the tank drive, but we also want our 2 axis controller to also rotate. We plan to use on the x-axis left turn the robot counter clock wise and right to trun the robot clock wise. We want to know if it is possible and how? We program in java.

Last edited by sunny1118 : 04-03-2013 at 17:42.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-03-2013, 20:16
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
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: Making a 2 axis controller turn the robot

Quote:
Originally Posted by sunny1118 View Post
We plan to use on the x-axis left turn the robot counter clock wise and right to trun the robot clock wise. We want to know if it is possible and how? We program in java.
You didn't say what kind of drivetrain you have.

If it's a skidsteer, what you are describing sounds like Arcade Drive. Look in RobotDrive.java in the WPILib.

If you have mecanum, and you want independent control of FWD/REV, strafe Left/Right, and rotate (turn) CW/CCW, then you need three inputs.



Last edited by Ether : 04-03-2013 at 20:19.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-03-2013, 21:00
sunny1118 sunny1118 is offline
Registered User
FRC #0224 (The Tribe)
Team Role: Leadership
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Piscataway,NJ
Posts: 16
sunny1118 is an unknown quantity at this point
Re: Making a 2 axis controller turn the robot

Quote:
Originally Posted by Ether View Post
You didn't say what kind of drivetrain you have.

If it's a skidsteer, what you are describing sounds like Arcade Drive. Look in RobotDrive.java in the WPILib.

If you have mecanum, and you want independent control of FWD/REV, strafe Left/Right, and rotate (turn) CW/CCW, then you need three inputs.


We are using mecanum, we have one of our joystick for drive and the other is auxil. We want the auxil to just rotate the robot and are not sure which arcade drive to use
Reply With Quote
  #4   Spotlight this post!  
Unread 04-03-2013, 23:31
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
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: Making a 2 axis controller turn the robot

Quote:
Originally Posted by sunny1118 View Post
We are using mecanum, we have one of our joystick for drive and the other is auxil. We want the auxil to just rotate the robot and are not sure which arcade drive to use
If you want independent control of mecanum FWD/REV, strafe Left/Right, and rotate (turn) CW/CCW, then you need three inputs.

Arcade drive is for skid steer and does not take 3 inputs.

A 2-axis joystick does not produce 3 outputs (unless you want to use the throttle for the 3rd output).

The mecanumDrive_Cartesian() method in the RobotDrive.java file in WPILib takes three inputs.

You need a DI (Driver Interface) that gives the driver three controls: one each for fwd/rev, strafe left/right, and rotate CW/CCW.

So your DI could be this:

Y axis of Joystick1 is FWD/REV

X axis of Joystick1 is Strafe Right/Left

X axis of Joystick2 is Rotate CW/CCW.

... and just feed those three outputs into the appropriate 3 inputs of the mecanumDrive_Cartesian() method.




Last edited by Ether : 05-03-2013 at 00:45.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-03-2013, 14:25
AsianRookie AsianRookie is offline
Registered User
AKA: Steven/Tim
FRC #0321 (Robolancers)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2007
Location: Philadelphia
Posts: 31
AsianRookie is an unknown quantity at this point
Re: Making a 2 axis controller turn the robot

Well for the 2 axis joystick, you would have a toggle the mode or hold a button to rotate.
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 22: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