Go to Post I'd like to thank FIRST for giving me this wonderful opportunity. I've learned so much! - Leav [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2011, 21:47
iv1777 iv1777 is offline
Registered User
FRC #1777
 
Join Date: Jan 2011
Location: Overland Park
Posts: 18
iv1777 is an unknown quantity at this point
Programming full "holonomic" for mecanums

Hello all.
I need some help programming full holonomic control for a 4 wheeled mecanum drive robot, wheels being in X formation...
We have had sideways, forwards, and twist movements for a long time now, and just recently I figured out how to get diagonal motion (shame to not have it last year)
Anyways, we are using Java, how can we program a full holonomic control to one joystick?
I'd like to point out we basically got diagonals at a 45 degree or so angle at GOOD speed, faster than going sideways but not quite as fast as forward or back, sudden changes in movement speed if you go from forward to diagonal to sideways isn't a problem or anything... Just getting a full 360 control is difficult.

As it is we tried to just get 8 direction on one joystick, and we could only get the forward/back/left/right, the diagonals wouldn't work...
But that won't matter if you help us get a 360 control
Thanks in advance...
  #2   Spotlight this post!  
Unread 17-01-2011, 22:10
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: Programming full "holonomic" for mecanums

Quote:
Originally Posted by iv1777 View Post
Hello all.
I need some help programming full holonomic control for a 4 wheeled mecanum drive robot, wheels being in X formation...
We have had sideways, forwards, and twist movements for a long time now, and just recently I figured out how to get diagonal motion (shame to not have it last year)
Anyways, we are using Java, how can we program a full holonomic control to one joystick?
I'd like to point out we basically got diagonals at a 45 degree or so angle at GOOD speed, faster than going sideways but not quite as fast as forward or back, sudden changes in movement speed if you go from forward to diagonal to sideways isn't a problem or anything... Just getting a full 360 control is difficult.

As it is we tried to just get 8 direction on one joystick, and we could only get the forward/back/left/right, the diagonals wouldn't work...
But that won't matter if you help us get a 360 control
Thanks in advance...
This might help.




Last edited by Ether : 18-01-2011 at 12:18. Reason: linked to updated version
  #3   Spotlight this post!  
Unread 17-01-2011, 22:24
iv1777 iv1777 is offline
Registered User
FRC #1777
 
Join Date: Jan 2011
Location: Overland Park
Posts: 18
iv1777 is an unknown quantity at this point
Re: Programming full "holonomic" for mecanums

Quote:
Originally Posted by Ether View Post
This might help.

...
Thank.
You.
SOOOO much...
EXACTLY what I needed...
  #4   Spotlight this post!  
Unread 18-01-2011, 08:42
nealpatel nealpatel is offline
Registered User
FRC #1777
 
Join Date: Jan 2010
Location: Lenexa, KS
Posts: 8
nealpatel is an unknown quantity at this point
Re: Programming full "holonomic" for mecanums

Quote:
// finally, normalize the wheel speed commands
// so that no wheel speed command exceeds magnitude of 1:
max = abs(front_left);
if (abs(front_right)>max) max = abs(front_right);
if (abs(rear_left)>max) max=abs(rear_left);
if (abs(rear_right)>max) max=abs(rear_right);
if (max>1)
{front_left/=max; front_right/=max; rear_left/=max; rear_right/=max;}
So what is the value of max? It seems you forgot a couple lines of code there.

I am assuming 1.0 but just want to make sure.

And thanks that that pdf, it was really helpful.
__________________
-------------------------------------------------
Neal Patel
Team 1777
Shawnee Mission West
Viking Robotics

e-mail: neal.patel11@yahoo.com
  #5   Spotlight this post!  
Unread 18-01-2011, 09:00
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: Programming full "holonomic" for mecanums

Quote:
Originally Posted by nealpatel View Post
So what is the value of max?
Code:
max = abs(front_left);
if (abs(front_right)>max) max = abs(front_right);
if (abs(rear_left)>max) max=abs(rear_left);
if (abs(rear_right)>max) max=abs(rear_right);
Front_left, front_right, rear_left, and rear_right can each exceed 1.0.

When all the above code has been executed, max will contain the largest absolute value of [front_left, front_right, rear_left, rear_right].

If max exceeds 1.0, then all the wheel speeds are divided by max in order to force the largest one to have a magnitude of 1.0:

Code:
if (max>1)
{front_left/=max; front_right/=max; rear_left/=max; rear_right/=max;}

Quote:
It seems you forgot a couple lines of code there.
I don't think so.

Quote:
I am assuming 1.0 but just want to make sure.
That assumption would be wrong in general. Max equals 1.0 only if the largest absolute value is 1.0.

Quote:
And thanks that that pdf, it was really helpful.
I'm glad it helped. Feel free to ask questions.


  #6   Spotlight this post!  
Unread 19-01-2011, 00:57
Dfontana Dfontana is offline
Registered User
AKA: David Fontana
FRC #3039 (Wildcat Robotics, Team Predator)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Destrehan, LA
Posts: 9
Dfontana is an unknown quantity at this point
Re: Programming full "holonomic" for mecanums

Correct me if I'm wrong, but shouldn't this already be fully implemented in an encapsulated method (likely Holonomic Drive)? This is the case with LabView, and has been since about midway through the 2010 season.

All you should have to do is feed in the x, y, and z-axis of your joystick as parameters to the Holonomic Drive method.

I haven't personally seen the Java WPI so I can't say for sure. Check?
  #7   Spotlight this post!  
Unread 19-01-2011, 01:12
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Programming full "holonomic" for mecanums

Quote:
Originally Posted by Dfontana View Post
Correct me if I'm wrong, but shouldn't this already be fully implemented in an encapsulated method (likely Holonomic Drive)? This is the case with LabView, and has been since about midway through the 2010 season.

All you should have to do is feed in the x, y, and z-axis of your joystick as parameters to the Holonomic Drive method.

I haven't personally seen the Java WPI so I can't say for sure. Check?
Now what is the fun in that?

I can argue that making the function yourself is 10x better. First, you learn how it works; its not a black box to you. Second, you have FULL control over the code. Now this year, our code is getting ramped up; it has actual structure Last year I just did spaghetti code, because of my laziness. You really can't have structure with a black box in the middle of it.

There is no challenge when using the driver class; its like putting together a kitbot. Sure it works and its easy, but where is the accomplishment in that?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #8   Spotlight this post!  
Unread 19-01-2011, 01:22
Dfontana Dfontana is offline
Registered User
AKA: David Fontana
FRC #3039 (Wildcat Robotics, Team Predator)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Destrehan, LA
Posts: 9
Dfontana is an unknown quantity at this point
Re: Programming full "holonomic" for mecanums

It's funny that you say that, because I and a collaborating programmer spent the better part of a week writing a custom VI for Holonomic Drive last year, only to be given the "black box" - which was almost the exact same code - in the LabView update a week later.

I will admit that an understanding of the underlying code and concept was very beneficial. However, for novice programmers or those just looking to get a drive system working at the moment, there's really no need to reinvent the wheel, so to speak.
__________________
FIRST Team 3039 - Wildcat Robotics, Team Predator - Destrehan, LA.
  #9   Spotlight this post!  
Unread 19-01-2011, 01:53
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Programming full "holonomic" for mecanums

Quote:
Originally Posted by Dfontana View Post
It's funny that you say that, because I and a collaborating programmer spent the better part of a week writing a custom VI for Holonomic Drive last year, only to be given the "black box" - which was almost the exact same code - in the LabView update a week later.

I will admit that an understanding of the underlying code and concept was very beneficial. However, for novice programmers or those just looking to get a drive system working at the moment, there's really no need to reinvent the wheel, so to speak.
Well I can argue that you will never get better if you do not push yourself. Oh and BTW I can get the drive working in 5 lines; its quick and easy. The road to the top is always uphill, there is no easy way out. That is how I see it as. Just like "never put stuff into your body that you don't know".
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #10   Spotlight this post!  
Unread 19-01-2011, 08:03
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: Programming full "holonomic" for mecanums

Quote:
Originally Posted by Dfontana View Post
Correct me if I'm wrong, but shouldn't this already be fully implemented in an encapsulated method (likely Holonomic Drive)?
Yes*. I inferred from the OP's post that he already knew that, but was trying to home-brew something.

What I posted had commenting that explained what was being done and why. The RobotDrive::HolonomicDrive is not well documented in the C++ help file and library reference file. If you are familiar with it, would you please visit this thread and share what you know?


*well, not "fully". it doesn't appear to support the gyro like the LabVIEW version does.


Closed Thread


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 03:40.

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