View Single Post
  #1   Spotlight this post!  
Unread 08-02-2016, 22:19
gruffen gruffen is offline
Registered User
FRC #1648
 
Join Date: Jan 2016
Location: Atlanta
Posts: 3
gruffen is an unknown quantity at this point
Axis camera not retrieving images

Hi all,

So we decided to switch to the Axis 206 for vision processing, and so far we've been unsuccessful in grabbing images to process and sending them to dashboard.

The connection appears to be set up (I can see the camera feed in the LabVIEW dashboard when I select "IP Camera"), and there seems to be no other errors. The images don't show up at all.

Here is the code we've been using:

Code:
package org.usfirst.frc.team1648.robot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

import com.ni.vision.NIVision;
import com.ni.vision.NIVision.Image;
import com.ni.vision.NIVision.ImageType;

import edu.wpi.first.wpilibj.vision.AxisCamera;
import edu.wpi.first.wpilibj.CameraServer;

public class Robot extends IterativeRobot {

 int session;
    Image frame; 
    Image binaryFrame;
    AxisCamera camera;

 public void robotInit() {
 frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);
		binaryFrame = NIVision.imaqCreateImage(ImageType.IMAGE_U8, 0);
}
public void teleopPeriodic() {
        while (isOperatorControl() && isEnabled()){
        	SmartDashboard.putNumber("Number of particles", 0);
        	grabImage();
        	Timer.delay(0.005);
        }
    }
Nothing appears to be wrong, and we can't figure out why. Thanks for the help!
Reply With Quote