![]() |
command based, gyro, omnidrive
hi i am wondering if there is any team, or example code, out there that has (command based) programmed a robot, which has an omnidrive system with a gyroscope. The gyroscope would be used for making the robot "think" that forward is always the same direction no matter the orientation of the robot. Sort of like forward is always forward relative to the driver station. Thanks in advance.
|
Re: command based, gyro, omnidrive
if no one can find anything like this is there something that has at least omni drive with a gyro out there? and if so please post the link
|
Re: command based, gyro, omnidrive
Can you be more specific when you say omni drive?
If swerve fits your definition of omni drive then you can have a look at our 2014 code https://github.com/Frc2481/frc-2014/...DriveTrain.cpp Lines 54 - 58 will be most interest. |
Re: command based, gyro, omnidrive
If you're using mecanum wheels or omni wheels at 45 degree angles, you could use
Code:
RobotDrive::MecanumDrive_cartesian(x, y, rotation, gyroAngle) |
Re: command based, gyro, omnidrive
like these omni wheels: http://www.andymark.com/Omni-p/am-0123.htm
|
Re: command based, gyro, omnidrive
Are they mounted like this:
![]() or like this: ![]() because the second one can use the mecanum drive code. |
Re: command based, gyro, omnidrive
it is kinda a custom drive train but it might work with the second one. sorry for the horrible drawing but that is what ms paint gives me: https://www.dropbox.com/s/lz4ow5kgpqaw9vv/omni.png?dl=0
|
Re: command based, gyro, omnidrive
I have done programming with similar systems, and if you are looking for how to make it field centric rather than robot centric, I just took in the joystick values as polar coordinates, which is a magnitude and direction, then converted them to cartesian coordinates but in the conversion process adjusted the angle by the angle of the gyro.
So a snippet of the code: Code:
adjustmentAngle = gyro->GetAngle()*3.14/180+3.14/2; |
Re: command based, gyro, omnidrive
Quote:
Code:
RobotDrive::MecanumDrive_cartesian((x+y)/2, (x-y)/2, rotation, gyroAngle) |
Re: command based, gyro, omnidrive
1 Attachment(s)
Quote:
Pick any point O, usually at or near the center of geometry of the wheel contact patches. That will be your center of rotation. Then the inverse kinematics are given by: S1 = STR + |y1|*Ω S2 = FWD + |x2|*Ω S3 = STR - |y3|*Ω S4 = FWD - |x4|*Ω ...where: Sn are the wheel speeds (linear speed at the wheel circumference) FWD is the vehicle forward speed command STR is the vehicle strafe right speed command Ω is the vehicle rotate clockwise command in radians/sec about the point O all variables (Sn, xn, yn, FWD, STR) must use the same dimensions (e.g feet, inches, meters, etc) for the linear part |
| All times are GMT -5. The time now is 14:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi