Thread: Hex Kiwi Drive
View Single Post
  #33   Spotlight this post!  
Unread 30-05-2016, 22:37
caume's Avatar
caume caume is offline
Registered User
AKA: Cameron Aume
FRC #3324 (Metrobots)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2014
Location: Ohio
Posts: 21
caume is infamous around these partscaume is infamous around these partscaume is infamous around these partscaume is infamous around these partscaume is infamous around these partscaume is infamous around these parts
Re: Hex Kiwi Drive

Quote:
Originally Posted by Ether View Post
@caume: I'm curious to see how you would go about this. Please post your pseudocode with field orientation.


With this model, the battery is the back of the drive, the point opposite it is the front. flMotor would be the motor on the left side, closest the point opposite the battery.

Psuedocode:
Code:
if (fieldOriented) {
	cosA = cos(( target - gyroAngle ) * 3.14159 / 180 )
	sinA = sin(( target - gyroAngle ) * 3.14159 / 180 )

	x = (driverLX * cosA) - (driverLY * sinA)
	y = (driverLX * sinA) + (driverLY * cosA)
}


flMotor =   y*sind(60) + x*cosd(60) + turn
mlMotor =   y + turn
blMotor =   y*sind(60) - x*cosd(60) + turn 
frMotor = - y*sind(60) - x*cosd(60) + turn
mrMotor = - y + turn
brMotor = - y/sind(60) + x/cosd(60) + turn

Last edited by caume : 31-05-2016 at 20:19. Reason: Clarified motor positions
Reply With Quote