Go to Post The robots are just vehicles taking kids on a ride to STEMville. - FTC5110 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-01-2016, 16:18
KingRat KingRat is offline
Registered User
FRC #3055
 
Join Date: Jan 2015
Location: Austin Minnesota
Posts: 1
KingRat is an unknown quantity at this point
C++ .ArcadeDrive() issue

Hey CD our robot is using two motors to power the AndyMark chassis, and we're having an issue with the left and right turning inverted. The code as it sits right now is

void OperatorControl()
{
myRobot.SetSafetyEnabled(true);
while (IsOperatorControl() && IsEnabled())
{
myRobot.ArcadeDrive(stick1);
Wait (0.005);
}
}
  #2   Spotlight this post!  
Unread 02-02-2016, 00:27
pensono pensono is offline
Registered User
FRC #5495
 
Join Date: Jan 2015
Location: Snohomish, WA
Posts: 15
pensono is an unknown quantity at this point
Re: C++ .ArcadeDrive() issue

You could either change the motor assignments in the myRobot object when you create it, or call myRobot.ArcadeDrive with separate arguments for forwards/backwards and turning. You can get values for these arguments from stick1.
  #3   Spotlight this post!  
Unread 05-02-2016, 19:55
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: C++ .ArcadeDrive() issue

If left/right is reversed, you probably have the left motor being controlled as the right one and vice versa. If forward/backward works as you expect, you probably also have the motors' "invert" state wrong too. Simply swapping the motors will make everything work backwards, and then switching the "invert" on both of them ought to give you what you want.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi