Go to Post I'm always afraid of what the GDC will come up with... Their sanity is often questioned... :D - thefro526 [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 18-10-2010, 21:53
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Re: MOving toward a circle with camera code

I'm interested in this as well. Our team is thinking about switching over to JAVA and I was wondering how that would look like.


-Dustin Shadbolt
Reply With Quote
  #2   Spotlight this post!  
Unread 18-10-2010, 22:52
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: MOving toward a circle with camera code

I don't have the FRC Java tools installed to confirm this, but I believe there is a sample you can find in the new project dialog which shows this using the gyro and camera.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #3   Spotlight this post!  
Unread 19-10-2010, 22:16
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: MOving toward a circle with camera code

it doesn't go autonomously
Reply With Quote
  #4   Spotlight this post!  
Unread 19-10-2010, 23:35
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: MOving toward a circle with camera code

Quote:
Originally Posted by Robototes2412 View Post
it doesn't go autonomously
I'm looking at the sample, and it appears it should track the target left to right, but not produce any forward movment.

The first thing to do is make it drive forward. The simplest way to do this is to change line 48 of CircleTrackerDemo to, where forward_speed is a constant representing the forward speed.
Code:
drive.arcadeDrive(forward_speed, output);
Once that works you need to make it stop. There are a few ways to do that, one way is to do something like this at line 127 of the same file:

Code:
if (targets[0].m_yPos > someValueToIndicateHeightOfTheTarget)
...
OR 

if (targets[0].m_majorRadius > someValueToIndicateTheSizeOfTheTarget)
...

when ... is 
{
    //do stuff other than drive.
}
else {
    turnController.setSetpoint(gyroAngle + targets[0].getHorizontalAngle());
}
You could expand this to use PID to slow down as approaching the target distance, back away if too close, etc, but that is more advanced.


Once you have this working you could make it run in autonomous mode by moving the contents of the else, starting at line 99 in the sample, into the autonomousPeriodic function at line 73.
__________________
Eric Haskins KC9JVH
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera picture on Dashboard with default project code? neg0riz0r NI LabVIEW 2 18-02-2010 10:53
Moving Camera Servos With Joystick Button DWirth NI LabVIEW 7 26-02-2009 21:35
Camera not tracking with default code iTHOS=awesome C/C++ 3 09-02-2009 11:14
Moving robot while tracking with camera questions... Steve Orr Programming 6 02-02-2006 22:24
problems using gyro/adc code with camera default code tanstaafl Programming 7 22-01-2006 23:09


All times are GMT -5. The time now is 11:10.

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