Go to Post Here we go again with all kinds of speculation. We can never out guess FIRST. - BobC [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 08-02-2014, 17:45
MRT45's Avatar
MRT45 MRT45 is offline
Registered User
FRC #0253 (Mills Robotics Team)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: CA
Posts: 16
MRT45 is an unknown quantity at this point
Autonomous java problems

Hi guys,
We are first year programmers that are not sure on how to program autonomous on our robot. Every time we try we keep getting an output from the console on netbeans saying, "Robot Drive...output not updated enough" Please respond as soon as possible and with some example code if possible. Thanks
  #2   Spotlight this post!  
Unread 08-02-2014, 17:51
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 140
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Autonomous java problems

That error is part of a safety feature in the RobotDrive class. It states that if the RobotDrive isn't update every so often, then the robot will stop driving. For Autonomous you want to set the speed once and then stop it later. To do this you need to disable the safety.

Code:
RobotDrive.setSafetyEnabled(false);
  #3   Spotlight this post!  
Unread 08-02-2014, 18:01
MRT45's Avatar
MRT45 MRT45 is offline
Registered User
FRC #0253 (Mills Robotics Team)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: CA
Posts: 16
MRT45 is an unknown quantity at this point
Smile Re: Autonomous java problems

Thanks!! It now works!!!
  #4   Spotlight this post!  
Unread 09-02-2014, 02:56
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 146
AlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really nice
Smile Re: Autonomous java problems

Although this works and doesn't (normally) cause problems, the safety is there for a reason. Once you guys get it figured out the simple way (and if you still have spare time, a rare commodity) I would recommend figuring out a way to update the motors regularly.

AutonomousPeriodic, like the name suggests, runs periodically, just like teleop periodic. The programming "structure" (it's something you have to create on your own, not a built in java thing) that allows you to do this is called a state machine.

But once again, this is just for if you have time, and if you want something to try during offseason to help you next year. I doubt that it will cause problems for you now.
  #5   Spotlight this post!  
Unread 09-02-2014, 09:10
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 577
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Autonomous java problems

A good mental model for programming the robot is that, each time your code executes, you should be answering the question "what should the robot be doing right now."

Consider the situation where you want to drive forward for a certain time. Each time the loop would execute, you'd ask the question "what should the robot be doing now.". In this case, you'd be examining your timer and saying something like this:

float elapsedtime = ...;
float timeToDriveForward = ...;
if (elapsedtime < timeToDriveForward)
{
// set motors to drive forward
}
else
{
// turn motors off
}

Note that each time this executes, you are either setting the motors to drive forward, or turning them off.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
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:36.

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