|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
MOving toward a circle with camera code
Hello all,
I am trying to make a robot move toward a circle, then when it's close enough, it kicks, shooting a ball into the goal. How do I do this? Thanks (I'm the new guy) |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
Re: MOving toward a circle with camera code
it doesn't go autonomously
|
|
#5
|
||||
|
||||
|
Re: MOving toward a circle with camera code
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); 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());
}
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |