I found the sub-VI for a holonomic drive system in the new LabView Package, but I’m not sure what values to wire where.
I’m trying to upload a picture of the block diagram, but the most I can manage is an attached picture of the subVI with all the nodes labeled. Please help. I really just want to be able to put this drive system in place of the arcade drive that is in the original teleop.vi and also to be able to use it for autonomous.
Omniwheel drive.bmp (85.2 KB)
Omniwheel drive.bmp (85.2 KB)
Well, looking at the subVI, it looks like they’re assuming you have a wheel in each corner, oriented at 45º to the frame of the robot.
(thus you can still call them “top-left, top-right, bottom-right, and bottom-left”)
Hopefully this context help clears things up:
Magnitude is your speed
Direction is which direction you want to travel
Rotation is how much you want to turn the orientation of the robot.
Okay, I see how to set up the outputs to the motors, but how do I set up the drive VI to work with joysticks? It’s not looking for values that I can input with the joysticks. I would like to make the robot move in the direction that the joystick is moved and to move with a magnitude relative to how far the joystick is pushed. I’ve heard of teams that have done this, but I have no idea how to do it myself.
In that case, the easiest way might just be to assign the Y axis to forward and the X axis to sidways.
However, if you would like to use their holonomic drive VI, there is a nice little function for converting an x,y position (cartesian) to a direction and magnitude (polar).
I know it shows r and theta.
r stands for radius, or the magnitude of a vector.
theta is a greek character that is used for direction. It will give you direction in radians, not degrees, so you will want to make the appropriate conversion.
EDIT: Or apparently you can skip my whole post and use one VI to do the conversion for you.
To find the angle and magnitude of the joystick motion you are going to need to do some math with the joystick inputs.
I could just post the formulas here, but I think you will learn a lot more if you understand them so I’ll post the idea and let you do the digging.
The joystick VIs allow you to access the Cartesian coordinates of the joystick (X,Y) where X is a left-right coordinate and Y is an Up-Down or Away-Towards coordinate. You want the joystick values in Polar coordinates (Theta, R) where Theta is an angle and R is a magnitude from the origin. You should be able to find more information on the coordinate systems and the formulas for conversion with some digging (if you can’t find it try asking a math teacher, if you’ve still got nothing feel free to come back here).
One thing to be careful of is the 0 reference for the angle Theta. I’m not sure what range of values and reference the Holonomic drive VI takes but finding formulas for theta will give you either a 360 degree or 2*pi scale with theta=0 pointing in the direction of the positive X-axis.
To save you a little headache with the angle conversion, make sure you use the atan2 vi (not the atan vi). It takes care of the quadrant sign error that is so joyful in this industry
Note that there is a bug in the detailed help documentation for the Rotation input to the Holonomic Drive VI. The documentation says the units are in degrees per second, but that is incorrect. The input range is from -1.0 to 1.0. 1.0 is spinning clockwise at full power and -1.0 is spinning counter-clockwise at full power.
Can some explain how i would use the rotation feature with a joy stick?
Well, you could use the Z axis.
Or you could use a handheld controller (eg logitech gamepad)