|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Camera not sending image to Classmate?
Right now we have compiled the Circle Tracker Demo to the CRio. We have the crossover cable connected from the camera to port 2 on the CRio, and another crossover cable connected from port 1 on the CRio to the classmate.
There is no image coming up at all either and we are very confused. Any help? |
|
#2
|
||||
|
||||
|
Re: Camera not sending image to Classmate?
you don't need a crossover to connect the cRIO to the Classmate.
what Language? |
|
#3
|
||||
|
||||
|
Re: Camera not sending image to Classmate?
Quote:
Good luck |
|
#4
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
Yea, we just fixed the Dashboard, which wasn't updating. We didn't have a chance to check to see if the camera will send any, but we will tomorrow. I will update tomorrow as well. Oh, and we're coding in Java.
|
|
#5
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
I updated the dashboard, but the camera is still not sending images. However, I am not getting an error message saying Timeout in Communications, so I have no clue what is exactly happening.
|
|
#6
|
|||||
|
|||||
|
Re: Camera not sending image to Classmate?
You do have the video display on-off switch turned on, right? It's the little control at the bottom of the dashboard video window. It'll show a bright green highlight when you set it to the "on" state.
|
|
#7
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
Yea, we do. We got the dashboard to say "camera running e", but still no camera images. Any ideas?
|
|
#8
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
I don't think I saw mention of configuring the camera. There is a utility to create an FRC user and FRC password on the camera. Without those, the camera will simply return errors, and it may be that the WPI camera libs hide the errors -- not sure.
Connect the camera to the PC, set the PC IP to 192.168.1.1, and run the camera setup utility. Alternately, you can browse to 192.168.1.90 and do the configuration by hand. You can also do this to verify the camera works correctly. Once you log into the camera, you can view images, change settings, etc. Greg McKaskle |
|
#9
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
We did configure the camera and tried setting the username and password to FRC, but that still did not fix it.
|
|
#10
|
|||||
|
|||||
|
Re: Camera not sending image to Classmate?
Run the Driver Station update to uninstall the old Driver Station, then run it again to reinstall it. Just updating it (without the uninstall) sometimes doesn't work.
|
|
#11
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
We did uninstall the old Driver Station. Sorry to be very unhelpful to my situation. Is there anything else I can add that would make this easier?
|
|
#12
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
Could you post your code that the cRIO is running?
|
|
#13
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
Ok, well, I'm not at robotics now, so I'll post it tomorrow. Thanks guys!
|
|
#14
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
This post may help. I haven't tried it yet but it appears to describe the problem we are having:
http://www.chiefdelphi.com/forums/sh...13&postcount=3 |
|
#15
|
|||
|
|||
|
Re: Camera not sending image to Classmate?
We did fix that and we have that update complete.
Here's our code Code:
import edu.wpi.first.wpilibj.GenericHID.Hand;
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.PIDController;
import edu.wpi.first.wpilibj.PIDOutput;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.camera.AxisCamera;
import edu.wpi.first.wpilibj.camera.AxisCameraException;
import edu.wpi.first.wpilibj.image.ColorImage;
import edu.wpi.first.wpilibj.image.NIVisionException;
import edu.wpi.first.wpilibj.DriverStationLCD;
// import edu.wpi.first.wpilibj.samples.CircleTrackerDemo.TrackerDashboard;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class CircleTrackerDemo extends IterativeRobot {
double kScoreThreshold = .01;
AxisCamera cam;
TrackerDashboard trackerDashboard = new TrackerDashboard();
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
Timer.delay(10.0);
cam = AxisCamera.getInstance();
cam.writeResolution(AxisCamera.ResolutionT.k320x240);
cam.writeBrightness(0);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
}
/**
* This function is called while the robot is disabled.
*/
public void disabledPeriodic() {
}
/**
* This function is called at the beginning of teleop
*/
public void teleopInit() {
boolean lastTrigger = false;
DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser2, 1, "Starting Camera Code");
DriverStationLCD.getInstance().updateLCD();
Timer.delay(1.0); //Wait one second so user can see starting message
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
try {
DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser2, 1, "Camera Running ");
DriverStationLCD.getInstance().updateLCD();
if (cam.freshImage()) {// && turnController.onTarget()) {
ColorImage image = cam.getImage();
Thread.yield();
Target[] targets = Target.findCircularTargets(image);
Thread.yield();
image.free();
if (targets.length == 0 || targets[0].m_score < kScoreThreshold) {
System.out.println("No target found");
DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser2, 1, "Not Found " );
Target[] newTargets = new Target[targets.length + 1];
newTargets[0] = new Target();
newTargets[0].m_majorRadius = 0;
newTargets[0].m_minorRadius = 0;
newTargets[0].m_score = 0;
for (int i = 0; i < targets.length; i++) {
newTargets[i + 1] = targets[i];
}
} else {
DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser3, 1, "Pos X: " + targets[0].m_xPos );
DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser4, 1, "Pos Y: " + targets[0].m_yPos );
DriverStationLCD.getInstance().updateLCD();
System.out.println(targets[0]);
System.out.println("Target Angle: " + targets[0].getHorizontalAngle());
}
}
} catch (NIVisionException ex) {
ex.printStackTrace();
} catch (AxisCameraException ex) {
ex.printStackTrace();
}
}
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting Camera Footage on the Classmate | CRASH999 | FRC Control System | 6 | 23-01-2010 12:29 |
| Dashboard not appearing on classmate | railerobotics | Programming | 2 | 20-01-2010 15:42 |
| Java Camera Video on ClassMate | Thomas4019 | Java | 8 | 16-01-2010 00:18 |
| Classmate not loading Dashbaord on bootup | gokul | Control System | 2 | 13-01-2010 10:34 |
| [not-FIRST] Camera Image Processing | Greg Marra | Programming | 11 | 11-03-2008 21:10 |