Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Camera Calibration in Java Visible in Dashboard View (http://www.chiefdelphi.com/forums/showthread.php?t=91299)

michael714 08-02-2011 20:51

Camera Calibration in Java Visible in Dashboard View
 
Hey Folks,
We are interested in making camera calibration possible via the dashboard. We have some code that allows us to receive values from the Analog Sliders on the dashboard. We then used those values to change "camera" settings. Unfortunately, we see no evidence of the dashboard camera image changing (like when we do a 180 degree rotation or a brightness adjust).

Is it possible to make adjustments via Java to the camera that show up on dashboard? If so, where do we go to learn more? Can we do this without modifying the LabView dashboard?

We've looked through the 2011 WPI Lib Reference doc. We went through the NI Vision Tutorial doc. We've also looked through all the FRC Java docs. Any thoughts would be appeciated.

omalleyj 09-02-2011 08:10

Re: Camera Calibration in Java Visible in Dashboard View
 
Have you tried something like this?
Code:

import ...AxisCamera;
import ...DriverStation;


public class CameraControl{
        AxisCamera ac = AxisCamera.getInstance();
        DriverStation ds = DriverStation.getInstance();

        public CameraControl(){
                updateCameraControl();
        }

        public void updateCameraControl(){
                //convert to 0..100 int
                int brightness = (int)(ds.getAnalogIn(1) * 100.0/5.0);
                ac.writeBrightness(brightness);
        }

}

I am not at our robot and source code right now but I did something similar last year. Call an instance of the above class's update method in a loop and use analog slider 1 to adjust brightness. If that works add some other parameters.

michael714 09-02-2011 17:37

Re: Camera Calibration in Java Visible in Dashboard View
 
We did those things, but not using the updateCameraControl method. Instead, we just placed the update code in teleop Periodic and expected the looping to allow the adjustment to take place. We'll give your code a try.
Thanks.

omalleyj 10-02-2011 09:49

Re: Camera Calibration in Java Visible in Dashboard View
 
Quote:

Originally Posted by michael714 (Post 1019366)
We did those things, but not using the updateCameraControl method. Instead, we just placed the update code in teleop Periodic and expected the looping to allow the adjustment to take place. We'll give your code a try.
Thanks.

It doesn't have to be in a separate class, I just provided it that way so you could keep it separate from your own code more easily. The updateCameraControl was just a way to package it, if you are using the writeBrightness() directly that is fine (or would be if it worked :confused: ).
Can you get the input from AnalogIn directly? You can see the value is actually changing?
Can you set the brightness et al. from the Axis camera app?
Do any of the wpilibj camera functions work for you? I know you tried a 180 and brightness already, any others?


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

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