Go to Post FIRST people are just wierd like that. We get drawn to places in the middle of the desert as long as we know there will be more people like us there. - sanddrag [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-24-2016, 09:19 AM
rwodonnell rwodonnell is offline
Registered User
AKA: Rick O'Donnell
FRC #2876 (Devilbotz)
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2011
Location: Burlington, MA, USA
Posts: 52
rwodonnell is a splendid one to beholdrwodonnell is a splendid one to beholdrwodonnell is a splendid one to beholdrwodonnell is a splendid one to beholdrwodonnell is a splendid one to beholdrwodonnell is a splendid one to beholdrwodonnell is a splendid one to behold
Command to turn to angle

Does anyone have some sample code that turns to a specified angle, implemented as a command? We have done it in Robot.java but our first attempt to do it as a command did not seem to work. Specifically, it was not possible to drive afterward - it just continued to want to face in the direction we gave it. My assumption is that the command is not really ending, or somehow the PID is still actively trying to correct the angle, but at this point I think I am too tired to help the students debug any further! Links are to different github projects if you care to see the code.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-24-2016, 12:43 PM
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Command to turn to angle

It looks like your command enables a PID controller to perform the turn. This is OK (we do this as well). However, I don't see where you turn the PID controller off (disable it) in your command's end() and interrupted() methods.

I suspect this is why you are unable to drive after running your command (the command's PID continues to run in the background and "fights" with your normal drive command at setting the motor power).

Adding pid.disable() to the end() method and having interrupt() invoke end() should clean up this issue.
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 07:28 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