Closed mmetcalfe closed 8 years ago
This occurs from the reason being that the Green Horizon calculation is the first function to use the image. When the SEGFAULT error occurs, usually its to do with accessing invalid memory space. From my previous experience, usually you get a NULL pointer when the device has failed the transfer. Solution: Would have to catch this inside the NUbot\SeeThinkThread.cpp and throw an exception or a new error, "Camera Exception" -> best notification would be to get the robot to "Say" -> "Camera Exception", and Sit down. You might also consider replacing the cable from the HEAD. Or a swap Cameras to verify is this is a problem localised with the camera, or cable.
I tried adding code to Vision to check for a null image as soon as it was retrieved from the blackboard and that didn't solve the problem, since the image pointer was non null but pointing to invalid memory (at that particular time). Either way a closer look at the DarwinCamera class is needed, which Madison is already doing, since it seems to me that the responsibility of detecting and generating alerts for faulty camera data should really be with the class responsible for accessing it.
When the camera is broken, disconnected or otherwise inaccessible we get the following error in Vision.
The DarwinCamera class needs to more correctly detect these faults and give useful warning messages instead of allowing Vision to receive unallocated pointers.
Important to fix, but not urgent for RC2013 as most members currently know the root cause of the issue, and it doesn't occur in playable scenarios (i.e. if this segfault happens we couldn't have been playing anyway as we have no camera stream).