I’ve just received an ANAFI USA and I’m currently attempting to integrate it and its thermal capabilities with an existing application. The application streams video and allows another user to remote control the drone and observe its video stream using a URL, and now with the inclusion of the ANAFI USA, they should also be able to swap between camera modes.
The request to change camera mode is sent using a normal API request and works for the most part. However, after switching 2-5 times, the application crashes, with no specified error message. The swap between modes work in the groundsdk-demo, however, the demo application appears to “restart” the video stream each time the mode is changed, most likely a result of switching between activities. The video stream in my case however remains active and within the same activity, triggering thanks to a listener, capturing the API requests.
Currently the meager code snippet that handles this change looks as follows:
if(config.getCameraType() == ActionProto.CameraConfig.CameraType.THERMAL){
if (mBlendedThermal != null) {
ThermalControl.Mode mode = mThermalControl.mode().getValue();
if (mode != ThermalControl.Mode.EMBEDDED) {
mThermalControl.mode().setValue(ThermalControl.Mode.EMBEDDED);
}
}
} else if (config.getCameraType() == ActionProto.CameraConfig.CameraType.NORMAL) {
if (mCamera != null && !mCamera.isActive()) {
mThermalControl.mode().setValue(ThermalControl.Mode.DISABLED);
}
}
Is there anything I’m missing in order to get this to work in terms of code or the general behavior of camera modes? I’ve looked around for sample code targeting parrot-thermal however have only found dead links.
Thank you