Go to Post Yes, in human nature we like to get rewarded/recognized for things we do; however, you should not have to rely on this to be "successful". Remember the purpose of FIRST - To change our culture. - tim-tim [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-09-2016, 10:42 PM
alexusaywla alexusaywla is offline
Registered User
AKA: Alexus
FRC #6155 (ElektraBots)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: San Antonio, TX
Posts: 13
alexusaywla is an unknown quantity at this point
Exclamation Autonomous Example

Can someone please provide me with an example of an autonomous code you've used before or are currently using? And please explain what everything means? As of right now I'm simply trying to drive during autonomous so even an explanation of how to program that will help. We are using VictorSPs to drive. I'll also appreciate any other help! I've searched through numerous sources but I am completely lost.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-10-2016, 08:09 AM
nollchr nollchr is offline
Registered User
FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Glastonbury, CT
Posts: 28
nollchr is an unknown quantity at this point
Re: Autonomous Example

Are you using "Command Based" programming framework?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-10-2016, 09:17 AM
alexusaywla alexusaywla is offline
Registered User
AKA: Alexus
FRC #6155 (ElektraBots)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: San Antonio, TX
Posts: 13
alexusaywla is an unknown quantity at this point
Re: Autonomous Example

To my understanding no... I'm using SampleRobot. My current code can be found here so correct me if I'm wrong please http://pastebin.com/DQdALFKA. My autonomous is a mess!!
Reply With Quote
  #4   Spotlight this post!  
Unread 02-21-2016, 05:24 PM
Dpurry23's Avatar
Dpurry23 Dpurry23 is offline
Programmer/Control System/Scout
AKA: Darian Purry
FRC #0207 (Metalcrafters)
Team Role: Programmer
 
Join Date: Sep 2013
Rookie Year: 2012
Location: Hawthorne
Posts: 13
Dpurry23 is an unknown quantity at this point
Re: Autonomous Example

It seems like you're trying to have multiple options for autonomous.
http://pastebin.com/8zBk4hG0
Look at the lines highlighted and I hope it helps
Reply With Quote
  #5   Spotlight this post!  
Unread 03-04-2016, 11:29 PM
chesterm chesterm is offline
Registered User
FRC #6055
 
Join Date: Mar 2016
Location: Batesville, AR
Posts: 1
chesterm is an unknown quantity at this point
Re: Autonomous Example

try this for a simple straight ahead run in SampleRobot:

class declarations:
uint64_t autoTime = 0;
uint64_t testTime = 0;

void Autonomous()
{
if (IsAutonomous() && IsEnabled())
{
std::cout << "AutoMode START" << std::endl;
driveTrain.SetSafetyEnabled(true);
autoTime = GetFPGATime();
}
while (IsAutonomous() && IsEnabled())
{
testTime = GetFPGATime();
testTime = (testTime - autoTime) / 1000; //get milliseconds
if (testTime < 3250) //want to travel 11 feet in straight line
driveTrain.TankDrive(-0.65,-0.65); //drive forward
else
driveTrain.TankDrive(0.0,0.0); //stop
}
driveTrain.StopMotor();
std::cout << "AutoMode STOP" << std::endl;
}
Reply With Quote
Reply


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 10:25 AM.

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