Thread: windriver c++?
View Single Post
  #2   Spotlight this post!  
Unread 05-01-2010, 23:46
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: windriver c++?

Your EasyC code is not compatible with the new system, and will have to be rewritten.

I have not had good luck provided holonomic drive function, luckly that is not a difficult function to write.

Following is the code for a Mecanum/Holonomic drive. You need to insert the code piecse into the places noted in a blank copy of the Iterative robot demo project.

Code:
//INSERT IN: Variable definitions 
jaguar NEMotor;
jaguar SEMotor;
jaguar NWMotor;
jaguar SWMotor;


//INSERT IN: Constructor
//You can change the port numbers if needed to match your robot.
NWMotor = new Jaguar(1);
NEMotor = new Jaguar(2);
SWMotor = new Jaguar(3);
SEMotor = new Jaguar(4);


//INSERT IN: TeleopPeriodic or main loop
float X = m_leftStick->GetZ();
float Y = m_leftStick->GetY();
float Z = m_leftStick->GetX();
			
Y *= -1;
X *= -1;
float NW = Y + X + Z;
float NE = Y - X - Z;
float SW = Y - X + Z;
float SE = Y + X - Z;
			
NE *= -1;
NWMotor->Set(NW);
NEMotor->Set(NE);
SWMotor->Set(SW);
SEMotor->Set(SE);
Let me know if you have issues.
__________________
Eric Haskins KC9JVH
Reply With Quote