MAVROS display the distance sensor in mission planner

HI,

I have just installed MAVROS + MAVROS extra as explained in the README and now i want to send data (distance sensor) obtained by stereo camera from ROS to the FC.

So basically, i made a node which publish a sensorMsg/Range with the same name as defined in apm_config.yaml which is “rangefinder_sub”
Here is the part of apm_config.yaml :

distance sensor:
rangefinder_pub:

rangefinder_sub:
subscriber:true
id: 1
orientation: PITCH_270

and here is the ROS node whichs send the distance:

def__init__(self):
self.rangePub = rospy.Publisher(“/mavros/distance_sensor/rangefinder_sub”, Range, queue_size=20)
self.range_obj = Range()
def rangePubNode(self):
self.range_obj.header.stamp = rospy.Time.now()
self.range_obj.radiation_type = 0
self.range_obj.field_of_view = 0.1
self.range_obj.min_range = 1.0
self.range_obj.max_range = 5.0
self.range_obj.range = 3.0

Using

rostopic echo /mavros/distance_sensor/rangefinder_sub

i can see that my node is publishing the data so i guess also that MAVROS will subscribe to this topic as defined in the mavros plugin and thus send this sensorMsg/Range message to the FC right?
In my mission planner i am not sure how i can display the distance sensor value receive by the FC (using ctrl+F and click on proximity to open the RADAR window)

Secondly, as it is a custom sensor, what value should i use for the PRX_TYPE parameter in mission planner and especially what are the other parameters i should modify.

If anyone has idea on how to solve this, it would save me!
Thank you in advance.

MAVROS version and platform

ROS: Kinetic
Ubuntu: 16.04 (VMWare)

Autopilot type and version

[0] ArduPilot
PX4
Version: 3.6.5

try looking in
control-F > mavlink inspector.

this shows all mavlink message received. this will confirm missionplanner is seeing the message at all.

Indeed, It seems that mission planner dont receive the distance sensor message…
Is there a way to be sure that FC received the message from ROS?

1 Like

Thank you so much for this!
i will follow this way to and avoid MAVROS atm!

1 Like