|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
No camera feed
I have spent some time trying to get the camera feed to the netbook to work. I have tried the 2010ImageDemo example code as well as my own code (see below). I am fairly sure that the camera is set up correctly because it worked last year, I can access it from it's web interface and I can successfully run the camera set up tool when I plug the camera into the classmate netbook. Does any one have any ideas as to what we need to do to make it work?
Code:
#include "WPILib.h"
#include "Target.h"
#include "DashboardDataSender.h"
/**
*2010 code
*/
class RobotDemo : public SimpleRobot
{
Joystick leftStick;
Joystick rightStick;
Victor right1;
Victor right2;
Victor left1;
Victor left2;
Victor bigmotor;
Victor babymotor;
int loop;
DashboardDataSender *dds;
public:
RobotDemo():
leftStick(1),
rightStick(2),
right1(2),
right2(1),
left1(4),
left2(3),
bigmotor(5),
babymotor(6),
loop(0)
{
dds = new DashboardDataSender();
GetWatchdog().SetExpiration(0.1);
}
/**
* Drive left & right motors for 2 seconds then stop
*/
void Autonomous(void)
{
GetWatchdog().SetEnabled(true);
GetWatchdog().SetExpiration(1.0);
}
/**
* Runs the motors with tank steering.
*/
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
// 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.
printf("Getting camera instance\n");
AxisCamera &camera = AxisCamera::GetInstance();
printf("Setting camera parameters\n");
camera.WriteResolution(AxisCamera::kResolution_320x240);
camera.WriteCompression(20);
camera.WriteBrightness(0);
while (IsOperatorControl())
{
GetWatchdog().Feed();
GetWatchdog().SetExpiration(1.0);
// HSLImage *image = camera.GetImage();
right1.Set(rightStick.GetY());
right2.Set(rightStick.GetY());
left1.Set(-leftStick.GetY());
left2.Set(-leftStick.GetY());
if (leftStick.GetRawButton(1)==1)
{
bigmotor.Set(1.0);
}
else
{
bigmotor.Set(0.0);
}
if (rightStick.GetRawButton(1)==1)
{
babymotor.Set(0.3);
}
else
{
babymotor.Set(0.0);
}
loop++;
printf("Loop: %d", loop);
dds->sendIOPortData();
Wait(.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(RobotDemo);
|
|
#2
|
||||
|
||||
|
Re: No camera feed
do you have v20 on the cRIO?
do you have WPILib 4.3? did you run the Camera config tool? are you using a crossover cable from port 2 on the cRIO to the cam? is the camera's status ring green? |
|
#3
|
||||
|
||||
|
Re: No camera feed
Yes to all of your questions.
|
|
#4
|
||||
|
||||
|
Re: No camera feed
are there any firewalls on the network or computer?
did you update the dashboard to 1.1? do you have the local dashboard option checked under setup? have you tried installing dashboard update 1.1 on a different computer with remote dashboard selected under Driverstation setup, and correct IP? try this code: Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
AxisCamera &cam;
public:
RobotDemo():cam(AxisCamera::GetInstance())
{
}
void Autonomous()
{
}
void Operator Control()
{
}
};
|
|
#5
|
|||
|
|||
|
Re: No camera feed
What accounts are configured on your camera, and what permissions for each account? i.e. in Setup on the camera, select Users, what is the output?
Do you have a user FRC? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Issues with Classmate Camera Feed | eovnu87435ds | Programming | 17 | 12-02-2010 22:29 |
| 2010 FRC Camera Live Feed Lag | ideasrule | Programming | 23 | 11-02-2010 02:33 |
| Still no camera feed | cappielloa | Programming | 15 | 26-01-2010 21:54 |
| Live Feed with Axis Camera | CHSboy | Programming | 6 | 24-03-2009 14:43 |
| Drivers' Station Camera Feed | dhawk085 | Technical Discussion | 4 | 25-01-2009 19:12 |