Mavros: No mapping for distance sensor

Created on 9 Aug 2018  ·  4Comments  ·  Source: mavlink/mavros

Hi,

I am trying to access data from a distance sensor (Leddar One Range Finder) measuring height using MAVROS. I am able to view the data using QGroundControl (as my flight controller is PX4).

On the drone (with MAVROS installed), I tried the following commands:
$ roscore
$ rosrun mavros mavros_node _fcu_url:=tcp://127.0.0.1:5760 _system_id:=2

After this, I get the same error repeated:
DS: no mapping for sensor id: 0, type: 1, orientation: 25

I am able to check the ID, type and orientation in QGC which makes me sure that this is the Leddar One sensor.
I removed distance_sensor and rangefinder from the blacklist in px4_pluginlists.yaml.
I have also tried changing the distance_sensor information in px4_config.yaml file but have had no luck (tried various orientations: PITCH_270, NONE and 25).

I have found that the error is generated from line 205 in this code: distance_sensor.cpp but I can't figure out what is causing it.

I am only new to ROS so any help would be greatly appreciated.

PX4 question

Most helpful comment

Just to clarify, I had to comment "- distance_sensor" from the "px4_pluginlists.yaml" for the lidar data to be published.

All 4 comments

Have you checked the configuration for it on the px4_config.yaml? If you don't config the respective parameters to access the data, you won't be able to get the data properly. So you need to add a propper map for it on the yaml file (you already have examples there). Also, any reason for changing the sys_id to 2? You also don't need to remove rangfinder from blacklist because that's APM compatible only.

Thanks for the quick response and for adding relevant labels!

Are you able to be a little bit more specific or point me towards the area of px4_config.yaml that needs to be changed? The only part I have change is under distance sensor: (line 133 in the source code)
leddar1_pub:
id: 0
frame_id: "leddar1_laser"
orientation: PITCH_270 # RPY:{0.0, 270.0, 0.0} - downward-facing
field_of_view: 0.0 # XXX TODO
send_tf: true
sensor_position: {x: 0.0, y: 0.0, z: -0.1}
And I removed the other sensors from id: 1 onwards

I followed the instructions on this page since we are using an Intel Aero RTF drone, which included changing sys_id to 2.
No problem, I will add rangefinder back to the blacklist.

I understand I may be asking too much. If there are any resources you know of that would help me with correcting px4_config.yaml rather than you needing to explain it, that may suffice.
Thanks

I have resolved my issue. I created a launch file that specifically passed in "px4_config.yaml" as the config_yaml argument. This initialized distance sensor correctly and published the data to a ROS topic as desired.

This thread may be closed.

Just to clarify, I had to comment "- distance_sensor" from the "px4_pluginlists.yaml" for the lidar data to be published.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shening picture shening  ·  10Comments

Phadadev picture Phadadev  ·  4Comments

Changliu52 picture Changliu52  ·  6Comments

mohand150 picture mohand150  ·  5Comments

tfoote picture tfoote  ·  5Comments