pietroglyph / ftc265

An Intel RealSense T265 driver for Android
GNU Lesser General Public License v3.0
33 stars 21 forks source link

Camera object is not closed properly #10

Open sashajeltuhin opened 2 years ago

sashajeltuhin commented 2 years ago

The camera works well when we run an OpMode once after the Control Hub reboot. We initialize the camera and start it before the Play event. In the Opmode loop we get the data and at the end of the Opmode we call close() and free() on the camera object. If we want to run the same opmode again immediately after the first run or after playing another opmode, we are getting a generic exception stating that the camera is not initialized, busy or we are using a wrong overloaded constructor. To get the camera working again, we have to reboot the Control Hub. What is the correct way to release all camera resources at the end of the opmode, so that it can be used again in the same or different opmode without rebooting the Control hub?

mihir-chauhan commented 2 years ago

Hey @sashajeltuhin

We are having the same problem... did you happen to find a solution?

sashajeltuhin commented 2 years ago

@mihir-chauhan unfortunately not. We do not close the camera at the end of the autonomous. It retains the last position when we start the next op mode (either teleOp or another autonomous run). Eventually, we need to do a hard reboot of the robot to re-initialize.