ros-drivers / axis_camera

Contains basic Python drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.
BSD 3-Clause "New" or "Revised" License
52 stars 72 forks source link

KeyError in publishCameraState when camera is not ready on PTZ camera #55

Closed sgemme-csa closed 4 years ago

sgemme-csa commented 5 years ago

On Axis P5532-E, axis_camera.axis_ptz.publishCameraState will launch a KeyError if the ROS driver is started too soon after the camera has booted. I did not fully investigated it but, for some reason, even though the GET request returns a response, it does not have the 'zoom' field. Therefore, when publishCameraState tries to access self.cameraPosition['zoom'], a KeyError is raised, causing the Thread polling the telemetry to crash. I added a catch KeyError in publishCameraState.