umdlife / psdk_ros2

This repository is a ROS 2 wrapper for the DJI PSDK libraries.
https://umdlife.github.io/psdk_ros2/documentation/Introduction.html
Mozilla Public License 2.0
57 stars 15 forks source link

Cannot get values of Laser range finder #138

Open michele-colombo opened 1 week ago

michele-colombo commented 1 week ago

Tell us about your environment Jetson Xavier NX, DJI M300 with H20 payload. ROS2 humble in docker.

Steps to reproduce issue

Start the psdk. Communication is fine (I can read topics such as position_fused, gimbal_angles or successfully control the gimbal publishing on gimbal_rotation). If I try to read the distance measured by the laser range finder mounted on the payload with:

ros2 service call /wrapper/psdk_ros2/camera_get_laser_ranging_info psdk_interfaces/srv/CameraGetLaserRangingInfo "{payload_index: 1}"

Expected behavior

Read a distance of about 7.5 meters in the response to the service call.

Actual behavior

I always get success=True, but distance=0, even though I can read the correct distance (around 7.5 m) on the remote controller. The complete response is: psdk_interfaces.srv.CameraGetLaserRangingInfo_Response(success=True, longitude=0.0, latitude=0.0, altitude=0, distance=0, screen_x=0, screen_y=0, enable_lidar=False, exception=0) I tried with payload_index 2 or 3, but in that case I get success=False

Additional information

The mandatory module section in psdk_params.yaml is set like this:

      mandatory_modules:
        telemetry: true
        flight_control: true
        camera: true
        gimbal: true
        liveview: true
        hms: false
        perception: true

Are you willing to make a PR? If yes, add the PR link here.

michele-colombo commented 1 day ago

Hi, any info on this? Have you ever tested laser reading in a configuration similar to mine? Do I need to take any step before reading laser measurements? Thank you

biancabnd commented 1 day ago

Hi @michele-colombo, You are calling the service correctly with payload index = 1 if H20 is attached to the gimbal of your M300. We did test this a while ago and it was working. I am unable to test it at this moment to try and reproduce the error, but try to call the service at different ranges because we noticed a min range of 3 m. Try to point the camera closer and further away and see if you get any data. Let me know if you have any updates on this matter.

Thank you.

michele-colombo commented 33 minutes ago

Hi, thank you for your answer. The obstacle was at around 7.5m, so the min range should not be a problem. Also, as I said, on the remote controller we could correctly see the measurement from laser, so it wasn't a problem of surface not detected, either. If we will find something useful I'll update you.