|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Programming full "holonomic" for mecanums
Quote:
Last edited by Ether : 18-01-2011 at 12:18. Reason: linked to updated version |
|
#4
|
|||
|
|||
|
Re: Programming full "holonomic" for mecanums
Quote:
I am assuming 1.0 but just want to make sure. And thanks that that pdf, it was really helpful. |
|
#5
|
||||
|
||||
|
Re: Programming full "holonomic" for mecanums
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); 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:
Quote:
Quote:
|
|
#6
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: Programming full "holonomic" for mecanums
Quote:
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? |
|
#8
|
|||
|
|||
|
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. |
|
#9
|
|||
|
|||
|
Re: Programming full "holonomic" for mecanums
Quote:
|
|
#10
|
||||
|
||||
|
Re: Programming full "holonomic" for mecanums
Quote:
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|