View Single Post
  #6   Spotlight this post!  
Unread 19-01-2014, 01:49
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 89
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: nullpointerexception when calling AxisCamera getImage()

A follow-up to lineskier's recommendation: print the camera variable right after initializing it inside of robotInit().

Code:
public void robotInit() {
        camera = AxisCamera.getInstance();  // get an instance of the camera
        System.out.println( "Printing camera: " + camera );
        cc = new CriteriaCollection();      // create the criteria for the particle filter
        cc.addCriteria(MeasurementType.IMAQ_MT_AREA, AREA_MINIMUM, 65535, false);
    }
If camera is indeed null, as it almost certainly is, you will see this:
Printing camera: null

I am not sure what would make this return null...other than having a misconfigured Axis camera. If you open a web browser and type in a url of 10.xx.yy.11 (where the xxyy is 3673, your 4 digit team number), do you connect to the Axis camera? If not, then you will need to reconfigure your camera. Here is the WPI page for configuring an Axis camera:
http://wpilib.screenstepslive.com/s/...an-axis-camera

Good luck and post again if this doesn't help. Once you get it fixed, let us know what fixed it so that the thread becomes a resource for others.
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote