Obstacle Data Listener
CompletedHello,
I can't read the information about the obstacles distances. This is my code:
PerceptionManager.getInstance().addObstacleDataListener(value -> {
objectsAboveLiveData.postValue(value.getUpwardObstacleDistance());
objectsBelowLiveData.postValue(value.getDownwardObstacleDistance());
if (value.getHorizontalObstacleDistance().size() != 0) {
objectsInfrontLiveData.postValue(value.getHorizontalObstacleDistance().get(0));
objectsBehindLiveData.postValue(value.getHorizontalObstacleDistance().get(1));
}
});
Do I need to enable a type of obstacles avoidance? I really just want to know how distant they are. I have tried with the motors, on, off, and while the aircraft was flying. The information I have is always 0.0 for the up and down sensors, and null for the front and back.
Drone: DJI Mini 3 Pro; Remote Control: DJI RC Pro; SDK: msdk v5.3.0
Thank you
-
A similar situation happened to me with a Mavic 3 Enterprise
PerceptionManager.getInstance().getRadarManager().addObstacleDataListener(data ->
Log.d(Const.TAG, "radarObstacleDataListener: " + data.toString()));The app gives me the following response in the logcat:
radarObstacleDataListener: ObstacleData{horizontalObstacleDistance=[], upwardObstacleDistance=0, downwardObstacleDistance=0, horizontalAngleInterval=0}
These values never change and the only time they are generated is when you start the application.
Should these values change if I move my hand closer and further away from the sensors?
Please sign in to leave a comment.
Comments
3 comments