Go to Post Remember that the 4-slot cRIO...only has 4 slots. :) - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-08-2011, 08:51 PM
michael714's Avatar
michael714 michael714 is offline
Registered User
FRC #3863 (Pantherbotics)
Team Role: Teacher
 
Join Date: Apr 2006
Rookie Year: 2007
Location: Newbury Park, CA
Posts: 46
michael714 is on a distinguished road
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-09-2011, 08:10 AM
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-09-2011, 05:37 PM
michael714's Avatar
michael714 michael714 is offline
Registered User
FRC #3863 (Pantherbotics)
Team Role: Teacher
 
Join Date: Apr 2006
Rookie Year: 2007
Location: Newbury Park, CA
Posts: 46
michael714 is on a distinguished road
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-10-2011, 09:49 AM
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Camera Calibration in Java Visible in Dashboard View

Quote:
Originally Posted by michael714 View Post
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 ).
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?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:37 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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