Rosanswers logo

Hello there,

I have a node in ros publshing data of type Measurement2 which is used for RN Sensors. The problem wit the Datatype is that it publishes several different Values like you can see here:

  seq: 36
    secs: 1531906243
    nsecs:  20823955
  frame_id: "wifi_adapter"
device_name: "simulated"
device_designation: "wifi_adapter"
classification: "W"
    sensor: "Elrob-RN-1"
    source: "wifi signal strength"
    type: "wifi signal strength"
    value: [-30.0]
    unit: "dBm"
    min: 0.0
    avg: 0.0
    max: 0.0
    alert_level: 0
    alert_explanation: ''
    substance: []
    info: "Freq. 2.457 GHz mode: Master address: 08:EA:44:7A:FA:55 quality: 70/70 signal: -30.0"

I want to filter out the value of the signal and frequency from the broadcasted topic and then show it in rviz at the current position of my robot but I havent found a way yet how to extract the data and modify it so I can show it colorcoded on the created map in rviz

edit: thanks for editing the post to look better I somehow didnt get it to look straight


My setup is a roboter with Laserscanners and RGBD Cameras to create a 2D and 3D map of its surroundings. Now I have to make something like a heatmap to show where strong signals occur on this generated maps. For this I need to extract specific Data from the topicoutput shown above. Especially i need the signalstrength and frequency data from the whole dataset.

Originally posted by Creesy on ROS Answers with karma: 5 on 2018-08-22

Post score: 0

Original comments

Comment by PeteBlackerThe3rd on 2018-08-22:
Are you trying to build a map of wi-fi signal strength? So you're trying to extract the values->value element from the message?

Comment by PeteBlackerThe3rd on 2018-08-22:
Also you say 'the created map in rviz'. There are many ways of creating and showing maps in Rviz, can you describe the method you're using so we can give you some specific help.

Comment by Creesy on 2018-08-22:
Yes kinda, the wifi signal strength should simulate radioactive fallout and I need the values of the signalstrength and frequency extracted from the ti,opic to show on a 2D map in rviz


1 Answer 1


Rosanswers logo

This is not a complete answer, but there have been similar questions in the past.

This has led @matlabbe to add a tutorial to the rtabmap_ros pkg documentation specifically about this. See wiki/rtabmap_ros/Tutorials: Wifi Signal Strength Mapping (User Data Usage).

Originally posted by gvdhoorn with karma: 86574 on 2018-08-22

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Creesy on 2018-08-22:
As I understand it @matlabbe has just a topic with a single output there which just broadcasts the current strength of the wifi signal while I have a topic with a lot of information in it and I havent found a way yet to retrieve a single piece or two of the data published by my topic

Comment by gvdhoorn on 2018-08-22:
I assumed the storage and modeling of the data would be the problem.

Accessing single fields from messages is not at all difficult, so that's why I assumed that the question was not about that.

Just to make sure: do you know how to write a subscriber for a topic?

Comment by Creesy on 2018-08-22:
from the ros tutorial the basics

Comment by gvdhoorn on 2018-08-22:
Then can you clarify what is unclear?

"accessing single fields" is exactly what you'd need to do: if an incoming message (with variable name msg) has multiple fields, just do msg.field_name (where field_name is the name of the field that you want to access).

If it has a list (such as ..

Comment by gvdhoorn on 2018-08-22:
.. the values field in the msg you show), then treat it as a list (or a vector) in the programming language you are using. Iterate over the elements in the list and access individual fields as you would normally do with fields in elements of a list (in C++: msg.values[i].field_name fi).

Comment by Creesy on 2018-08-22:
ok yes was stuck in my brain there.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.