Zoom Disabled When Switching to Different Camera Modes on M3E Drone for High-Quality Image Capture

Completed

Comments

10 comments

  • DJI Developer Support
    Are you currently looking to enhance the visibility of the target by using zoom?
    0
    Comment actions Permalink
  • logisticsbrreply

    Yes, because it’s the only way to read with the sensor active. Is it possible to reduce the sensor distance to less than two meters? Could you please run a test by creating a data matrix label with a size of 1.6 cm and this value: 2100000000006005611727]01434978]100141622024]1201052025]3000037489000]920]01434978]1001416?

    We are currently using the following code to capture the label value:

    import com.google.mlkit.vision.barcode.BarcodeScanner;
    import com.google.mlkit.vision.barcode.BarcodeScannerOptions;
    import com.google.mlkit.vision.barcode.BarcodeScanning;
    import com.google.mlkit.vision.barcode.common.Barcode;
    import com.google.mlkit.vision.common.InputImage;
    ...
    frame = droneFlight.getFpvWidgetBitmap();
    if (frame == null) continue;

    String barcodeString = ImageDetector.readBarCode(frame);
    if (barcodeString == null || barcodeString.isEmpty()) continue;

     

    We are specifically using this code to extract the barcode data from the frame. Could you test this with the given label and let us know the results?

    1
    Comment actions Permalink
  • DJI Developer Support
    You can switch the current view to a zoomed view using CameraKey.KeyCameraVideoStreamSource, and then control the zoom ratio with CameraKey.KeyCameraZoomRatios to make the target clearer. Sorry,but the barcode monitoring you mentioned is beyond our work. If the image remains blurry after zooming, you might consider bringing the aircraft closer to the target or using algorithms to enhance image clarity. These solutions will need to be implemented and tested by you. Regarding the sensor distance, are you referring to the sensors that the drone uses to detect obstacles?
    0
    Comment actions Permalink
  • logisticsbrreply

    Thank you for the reply. I will test adjusting the view with CameraKey.KeyCameraVideoStreamSource and controlling the zoom with CameraKey.KeyCameraZoomRatios to improve the clarity of the target. Regarding the barcode monitoring, I understand that it's beyond your scope.

    As for the sensor distance, yes, I am referring to the sensors the drone uses to detect obstacles. My goal is to better understand the minimum and optimal distance at which the drone can accurately detect objects. Any additional information on this would be greatly appreciated.

    0
    Comment actions Permalink
  • DJI Developer Support
    The obstacle sensor range of the aircraft can be less than 2 meters. If you have used the Pilot 2, you can view the perception range in different directions on the perception menu. The minimum distance in the horizontal direction is 0.5 meters. You may refer to this article for the guidance:https://sdk-forum.dji.net/hc/en-us/articles/9882785690009-Chapter-16-Visual-obstacle-avoidance-system https://developer.dji.com/doc/mobile-sdk-tutorial/en/tutorials/perception.html
    0
    Comment actions Permalink
  • logisticsbrreply

    From what I see, the minimum distance seems to be 1 meter. Is there a way to set it to a shorter range for the horizontal sensor?
    Also, do you know if it's possible to configure the drone's movement speed or calibrate the joystick’s sensitivity for speed control?

    And what about the CameraKey configurations? Currently, I'm using this method in the onCreate of my activity. Would this be the change needed to improve the image quality?

    KeyManager.getInstance().setValue(KeyTools.createKey(CameraKey.KeyCameraVideoStreamSource), CameraVideoStreamSourceType.ZOOM_CAMERA, new CommonCallbacks.CompletionCallback() {...}
    0
    Comment actions Permalink
  • DJI Developer Support
    If the minimum distance provided by Pilot 2 is 1 meter, then there are currently no other methods to adjust the perception distance to a smaller value. Regarding the aircraft speed, are you referring to adjusting the sensitivity of the RC PRO joystick? You may want to take a look at this article: https://sdk-forum.dji.net/hc/en-us/articles/34181248765081
    0
    Comment actions Permalink
  • logisticsbrreply

    Thanks a lot, DJI Developer Support!

    I tried to configure the aircraft speed programmatically, but I haven't been successful yet. Could you provide an example of how to set this by code? Here’s a sample snippet that I'm trying to use:

    KeyManager.getInstance().listen(KeyTools.createKey(FlightControllerKey.KeyHorizMaxSpeedInNormal), this, (oldValue, newValue) -> {
    appToast.notifyFront("alert", "DSS equals " + newValue + " But before was " + oldValue);
    });
    // Set drone speed sensitivity in Normal Mode
    // KeyManager.getInstance().setValue(KeyTools.createKey(FlightControllerKey.KeyFlightMode), FlightMode.GPS_SPORT, new CommonCallbacks.CompletionCallback() {
    KeyManager.getInstance().setValue(KeyTools.createKey(FlightControllerKey.KeyHorizMaxSpeedInNormal), Double.valueOf("1"), new CommonCallbacks.CompletionCallback() {
    @Override
    public void onSuccess() {
    log.info("Drone is slow!");
    }

    @Override
    public void onFailure(@NonNull IDJIError error) {
    log.error("Error setting drone in speed mode: " + error.description() + ", CODE: " + error.errorCode());
    }
    });

    It would be ideal to control the aircraft speed directly by code for safety reasons. However, I found that these parameters can also be adjusted directly within the app in the settings screen, which might be helpful for others looking for a quick solution.

    Thanks again for your guidance!

    0
    Comment actions Permalink
  • DJI Developer Support
    Your usage of ‘key’ was mostly correct. The FlightControllerKey.KeyFlightMode cannot be set; it can only be read. If you need to change the control gear of the remote controller, you will need to do so using the physical switch on the remote, as it cannot be done through code. In Sport mode, the maximum horizontal speed should be set using KeyMaxHorizSpeedIn**Sport.**
    0
    Comment actions Permalink
  • DJI Developer Support
    Switching to sport mode on Pilot 2 is a pagination handling in the UI.
    0
    Comment actions Permalink

Please sign in to leave a comment.