Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera not sending image to Classmate? (http://www.chiefdelphi.com/forums/showthread.php?t=80433)

TPNigl 17-01-2010 15:52

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?

byteit101 17-01-2010 16:03

Re: Camera not sending image to Classmate?
 
you don't need a crossover to connect the cRIO to the Classmate.
what Language?

frcchile 17-01-2010 17:59

Re: Camera not sending image to Classmate?
 
Quote:

Originally Posted by byteit101 (Post 901143)
you don't need a crossover to connect the cRIO to the Classmate.
what Language?

Brother you need unistall and install again FRCLabVIEWUpdate2.0for2010 and FRCLabVIEWUpdate1.0for2010 I had the same problem and it worked


Good luck

TPNigl 17-01-2010 21:05

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.

TPNigl 18-01-2010 12:15

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.

Alan Anderson 18-01-2010 18:21

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.

TPNigl 18-01-2010 18:51

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?

Greg McKaskle 18-01-2010 23:26

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

TPNigl 20-01-2010 20:46

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.

Eugene Fang 20-01-2010 20:51

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.

TPNigl 20-01-2010 21:14

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?

Geek 2.0 20-01-2010 21:31

Re: Camera not sending image to Classmate?
 
Could you post your code that the cRIO is running?

TPNigl 20-01-2010 21:39

Re: Camera not sending image to Classmate?
 
Ok, well, I'm not at robotics now, so I'll post it tomorrow. Thanks guys!

mswalker 21-01-2010 14:37

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

TPNigl 22-01-2010 17:05

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();
            }


        }
    }

It's just the basic default code for the CircleTrackerDemo


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi