Go to Post It's just another design constraint that needs to be dealt with. - Dave Scheck [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 01-25-2013, 06:58 PM
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 587
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Command execute(){jaguar.set(speed);} necessary?

The motor safety stuff is enabled by default on the RobotDrive class and disabled by default everywhere else. You can just set the motor speed in the initialize() method and check if it's finished in the isFinished() method. Often the execute method can be empty.

For safety you can enable the motor safety on the actuator in question or use a timeout to make sure it turns off.

If you are relying on a sensor to stop the motor, you can add a timeout to the command and make sure it ends even if the sensor is never tripped. Just set the timeout to something longer than you'd expect the operation to take. Then in the end() method stop the motor and call the end() method from the interrupted() method. That way the robot won't destroy itself if a sensor fails.

Look at the gearsbot example or the WPILib Cookbook to see how the timeout stuff works.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
 


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 07:50 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