Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Camera Lag (http://www.chiefdelphi.com/forums/showthread.php?t=81150)

tutkows1 25-01-2010 23:23

Camera Lag
 
I'm having a hard time reducing the amount of lag i get from live camera feed. I have tried messing with compression and resolution but i still have like a 5 secound lag.

The following code, writen in Java, is the example dashboard code with camera feed added, i put my additions, camera feed code, in blue.
Quote:

package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.AnalogModule;
import edu.wpi.first.wpilibj.Dashboard;
import edu.wpi.first.wpilibj.DigitalModule;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Watchdog;
import edu.wpi.first.wpilibj.camera.AxisCamera;

/**
* 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.
*/

/*This Dashboard example has been modified to
* output camera feed on the driver station
* --Mark Tutkowski--
*/
public class DashBoardExample extends IterativeRobot {
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
AxisCamera.getInstance().writeResolution(AxisCamer a.ResolutionT.k160x120);
AxisCamera.getInstance().writeBrightness(0);

Watchdog.getInstance().setEnabled(false);
}

/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
//Update Camera Feed
DriverStationLCD.getInstance().updateLCD();

}


/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
//Update Camera Feed
DriverStationLCD.getInstance().updateLCD();

updateDashboard();

}
Theres a little bit more code but the rest of it is not related to the camera.

Is there anyway to reduce the lag.

ideasrule 27-01-2010 00:20

Re: Camera Lag
 
Try this:

http://www.chiefdelphi.com/forums/sh...ad.php?t=81058


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

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