Go to Post A dedicated team is a happy team. - sgreco [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 08-02-2010, 18:59
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
absolute minimum for displaying image on dashboard

Hey,
I was going to finally try and see if I can get some image showing from the camera, and I was wondering, what do I basicly need for the absolute minimum to show the image on the dashboard? So if I were to just copy paste code from the 2010 vision sample, what would I copy paste into my own program to get the images showing? Thanks in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2010, 19:36
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: absolute minimum for displaying image on dashboard

Calling "AxisCamera::GetInstance();" starts up the task that broadcasts the video to the Dashboard. Put that anywhere in your code and it should run.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2010, 20:19
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

really? Thats all you need? I was expecting more. I'm assuming that that is merely just to show the camera images, and to actually set exposure, etc. we have to create an axis camera object first? Thank you though, That would be a lot simpler than what I was trying to do.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2010, 20:32
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: absolute minimum for displaying image on dashboard

The return from that function is an AxisCamera& object, so you want to just use that for the object. Anything that has a GetInstance function should never be created by a user program. Always call GetInstance to create your copy of the object
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2010, 03:58
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

Anyone sure this works?
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2010, 19:12
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

Quote:
Originally Posted by Teh1337Bix View Post
Anyone sure this works?
I tried it and no results yet. My DS is updated, and camera should be set correctly.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-02-2010, 20:30
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: absolute minimum for displaying image on dashboard

You can also use PCVideoServer (you'll need to include a file, I think its "Vision\PCVideoServer.h")
Code:
class robotclass : ....
{
...
    PCVideoServer pcvs;
public:
    robotclass:
       .....
       ,pcvs()
    {
    ...
    }

......

}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2010, 21:47
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: absolute minimum for displaying image on dashboard

Quote:
Originally Posted by kennypu View Post
I tried it and no results yet. My DS is updated, and camera should be set correctly.
Check the console for errors. If the camera is called for an init before the camera is fully booted then the vision code crashes.
Reply With Quote
  #9   Spotlight this post!  
Unread 10-02-2010, 09:33
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: absolute minimum for displaying image on dashboard

Quote:
Originally Posted by byteit101 View Post
You can also use PCVideoServer (you'll need to include a file, I think its "Vision\PCVideoServer.h")
Code:
class robotclass : ....
{
...
    PCVideoServer pcvs;
public:
    robotclass:
       .....
       ,pcvs()
    {
    ...
    }

......

}
A quick note on PCVideoServer:

My team found out the hard way that the camera, when initialized with GetInstance(), starts its own PCVideoServer. Attempting to start a second one blocks the entire thread indefinitely.
__________________
Reply With Quote
  #10   Spotlight this post!  
Unread 10-02-2010, 13:35
Kohala2460's Avatar
Kohala2460 Kohala2460 is offline
Registered User
AKA: Michael
FRC #2460 (Na Paniolo)
Team Role: Engineer
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Kohala High School
Posts: 35
Kohala2460 is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

Would the GetInstance(); function be included in the wpilib1764 or do i need to download the Workbench Software update from http://first.wpi.edu/FRC/frccupdates.html

Thankyou, Hopefully can get this going before competition
Reply With Quote
  #11   Spotlight this post!  
Unread 10-02-2010, 14:45
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

Quote:
Originally Posted by Radical Pi View Post
Check the console for errors. If the camera is called for an init before the camera is fully booted then the vision code crashes.
when the axis camera has a solid green ring, that means its fully initialized correct? It is always like that so I'm assuming that the initialization is not the problem. I will check the errors though.

EDIT:
I still cannot get the camera to work. first of all, is it possible to access the camera through browser (192.168.0.90) if its connected to the cRIO, and classmate connected to cRIO through the wireless bridge?
secondly, when the cRIO and axis cam is connected, I don't see any activity in the ethernet port. The bridge's port shows the green and orange LEDs going wild, but for the axis cam, there is no light at all. Is this normal? or should there be some type of activity.

Last edited by kennypu : 10-02-2010 at 18:17.
Reply With Quote
  #12   Spotlight this post!  
Unread 10-02-2010, 23:17
SteveGarward's Avatar
SteveGarward SteveGarward is offline
Red 5, standing by...
AKA: 7 years already
FRC #0111 (WildStang), FRC #3132 (Thunder Down Under)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Gurnee, IL
Posts: 173
SteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud of
Re: absolute minimum for displaying image on dashboard

Team 3132 got the camera working last night.

We had gone and changed the IP address of the camera by mistake to the 10. subnet, so the code couldn't communicate with the camera. After resetting the camera IP address, and with the FRC user account configured (with password FRC) it worked with the following line put in our robot class constructor:
AxisCamera &myCamera = AxisCamera::getInstance();
__________________
FRC Team 111 - WildStang (Mentor, Drive Coach)
FTC Team 7458 - Full Force! (Mentor, Coach)
FRC Team 3132 - Australia's FIRST FRC Team! (Holy crazy first year, Batman!)

Reply With Quote
  #13   Spotlight this post!  
Unread 13-02-2010, 20:34
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

hmm..I still can't get the camera working. Rather, now I'm getting the 'watch dog not fed' message in the DS. Does anybody have a suggestion? I have set up the camera, my DS is up-to-date, the only thing I havn't done is the recent update of the workbench, but I am sure that is not necessary as that is for the DS LCD.
Here is my code btw:
Code:
#include "WPILib.h"

#include "Vision/AxisCamera2010.h"
#include "Vision/HSLImage.h"
#include "PIDController.h"
#include "Gyro.h"
#include "Target.h"
#include "DashboardDataSender.h"

//#define MINIMUM_SCORE 0.01

/**
 * This is a demo program showing the use of the RobotBase class.
 * The SimpleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 */ 
bool moveState = false;
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stick; // only joystick
	Jaguar leftMotors;
	Jaguar rightMotors;
	Compressor *m_com;
	//DashboardDataSender *dds;
	//Gyro *gyro;
	//PIDOutput *pidOutput;

public:
	RobotDemo(void):
		myRobot(3, 4),	// these must be initialized in the same order
		stick(1),		// as they are declared above.
		leftMotors(1),
		rightMotors(2)
	{
		m_com = new Compressor(4,2);
		AxisCamera &camera = AxisCamera::getInstance();
		//dds = new DashboardDataSender();
		//gyro = new Gyro(1);
		//pidOutput = new SamplePIDOutput(myRobot);
		GetWatchdog().SetExpiration(0.1);
		
		
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(false);
		myRobot.Drive(0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			//myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
			if(stick.GetRawButton(1))
			{
				moveState = 0;
			}
			if(stick.GetRawButton(3))
			{
				moveState = 1;
			}
			if(moveState == false)
			{
				//do nothing
			}
			if(moveState == true)
			{
				leftMotors.Set(-stick.GetY());
				rightMotors.Set(stick.GetZ());
				Wait(0.005);
			}
			
			// Create and set up a camera instance. first wait for the camera to start
					// if the robot was just powered on. This gives the camera time to boot.
					//Wait(10.0);
					//printf("Getting camera instance\n");
			
		}
	}
};

START_ROBOT_CLASS(RobotDemo);
any body see any problems?
Reply With Quote
  #14   Spotlight this post!  
Unread 13-02-2010, 20:40
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: absolute minimum for displaying image on dashboard

Quote:
Originally Posted by kennypu View Post
EDIT:
I still cannot get the camera to work. first of all, is it possible to access the camera through browser (192.168.0.90) if its connected to the cRIO, and classmate connected to cRIO through the wireless bridge?
secondly, when the cRIO and axis cam is connected, I don't see any activity in the ethernet port. The bridge's port shows the green and orange LEDs going wild, but for the axis cam, there is no light at all. Is this normal? or should there be some type of activity.
1. no, the eth ports cannot access each other directly
2. no, there should be some activity
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #15   Spotlight this post!  
Unread 13-02-2010, 20:51
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

thank you for the clarification byteit101.
hmm...Thats interesting then, Why won't the camera connect to the cRIO? I know its not a dead port, because I they both flash when the robot first starts up. However after that there is no activity. Does any body know why?
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Camera Image in C# Dashboard PranavSathy C/C++ 12 08-02-2010 17:06
Labview Dashboard not displaying camera. GunfighterJ NI LabVIEW 1 02-02-2010 19:20
Reinstall of dashboard doesn't fix camera image streaming ellisk Programming 2 20-01-2010 08:04
Absolute beginner looking for resources saberflare General Forum 3 16-11-2007 10:35
Minimum Gauge Wire for Sensors? psquared89 Electrical 2 05-02-2006 15:26


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

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