Go to Post I know I exaggerated a bit, but NASA put a man on the moon with less processing than some FRC bots. Think about that for a minute. - JesseK [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 03-03-2010, 22:19
Bart Bart is offline
Registered User
FRC #2625
 
Join Date: Feb 2010
Location: Canada
Posts: 5
Bart is an unknown quantity at this point
Mecanum Spin

Hey, I'm currently trying to figure out how to change the magnitude of the holonomic drive system. I tried the obvious approach (Changing the first float) however, with out current code, nothing seemed to change at all. Could someone look it over and tell me what they think? We basically want the spin of the robot to be dependent on the value returned by the joystick throttle:

Code:
//Stop Button
		if(!joyStick->GetRawButton(3))
		{
			//Turn left
			if(joyStick->GetRawButton(4))
				joanRobo->HolonomicDrive(joyStick->GetThrottle(), 0.0, -180.0);
			
			//Turn right
			else if (joyStick->GetRawButton(5))
				joanRobo->HolonomicDrive(joyStick->GetThrottle(), 0.0, 180.0);
			
			//Regular holonomic movement
			else
				joanRobo->HolonomicDrive(joyStick->GetMagnitude(), joyStick->GetDirectionDegrees(), 0.0);
		}
		else
			//Stop all movement
			joanRobo->HolonomicDrive(0.0, 0.0, 0.0);
Reply With Quote
  #2   Spotlight this post!  
Unread 04-03-2010, 00:08
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Mecanum Spin

Quote:
Originally Posted by Bart View Post
Hey, I'm currently trying to figure out how to change the magnitude of the holonomic drive system. I tried the obvious approach (Changing the first float) however, with out current code, nothing seemed to change at all. Could someone look it over and tell me what they think? We basically want the spin of the robot to be dependent on the value returned by the joystick throttle:
I am not sure which part of your code you said not working. Mecanum drive requires 3 joystick axes. According to your code, you are using one joystick. If that's the case, make sure your joystick has 3 axes. Since you are using the GetMagnitude(), it is computing the magnitude by doing sqrt(x*x + y*y), and the direction is computed by atan2(x, -y). So you should make sure that the Y axis of your joystick is controlling the forward/backward movement, the X axis is controlling your sideway movement. Then for the turn, make sure you are using the correct joystick axis for it. At first, we were reading the twist axis for the turn, but it was wrong. This is because our Microsoft Side Winder joystick maps twist to the Z-axis, not twist or throttle. So make sure you reads the correct axis.
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 04-03-2010, 23:08
Bart Bart is offline
Registered User
FRC #2625
 
Join Date: Feb 2010
Location: Canada
Posts: 5
Bart is an unknown quantity at this point
Re: Mecanum Spin

Well we're using the standard kop joystick, and our controller is indeed moving the robot properly, what we attempted doing is have it spin using to of the top buttons, and regulate the speed of the spin using the throttle on the joystick.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-03-2010, 23:52
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Mecanum Spin

If you want to regulate the spin by the throttle, you should probably doing something like this:
Code:
if (joyStick->GetRawButton(4))
    joanRobo->HolonomicDrive(0.0, 0.0, -joyStick->GetThrottle());
//Turn right
else if (joyStick->GetRawButton(5))
    joanRobo->HolonomicDrive(0.0, 0.0, joyStick->GetThrottle());
//Regular holonomic movement
else
    joanRobo->HolonomicDrive(joyStick->GetMagnitude(), joyStick->GetDirectionDegrees(), 0.0);
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
pic: Hot Shot Spin Bar Madison Extra Discussion 5 15-09-2009 15:38
A different spin on things. Matt Attallah Chit-Chat 28 24-07-2006 11:38
Will the tetras spin? SteveO Rules/Strategy 15 20-01-2005 02:36
PUSA and Spin Doctors Jeff Rodriguez Chit-Chat 1 08-08-2003 03:37
Motor Spin Direction archiver 2000 6 23-06-2002 23:43


All times are GMT -5. The time now is 13:32.

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