Displaying sensor data in RVIZ

My ROS2 Humble hardware interface exports two potisions and three sensors.
I can see them in rqt under dynamic_joint_states (I tried to show below in text as I couldn’t add a screenshot):

/dynamic_joint_states
 ->  header
     joint_names
 ->  interface_values
     -> [0]
     -> [1]
     -> [2]
     -> [3]
          interface_names           ['temperature']
          values                    [39.7]
     -> [4]
          interface_names           ['connected']
          values                    [1.0]

My question is how to I view them in rviz? [2] is temperature, [3] is battery level and [4] hows if the comms with the control board is working.
I tried adding a temperature panel to rviz but couldn’t get the topic right, “/dynamic_joint_states/interface_values[3]/values” didn’t work.

I also want a simple LED display for [4] but can’t see how?

Thanks in advance.
Andrew

Andrew,
I added an lcd display to my project through the I2C bus. Then I found a ros2 node someone had written on github for I2C displays. If I want to display text on the lcd I just publish a message to the lcd node. I use it for showing battery voltage and diagnostics.

Make sure the topic type is exactly the same as rviz wants.

good luck

Hey Andrew, sorry this one slipped through. Unfortunately this is something that you’d expect would be easy to do in RViz but (as far as I know) isn’t. I think there are some custom panels out there that might kind of get you there.

This is where Foxglove shines and I’ll be doing more videos on it in the future. You can add a Raw Messages panel with /dynamic_joint_states.interface_values[3].values[0] and you’ll see the number. The Gauge panel should also work but I’ve had some troubles with it. You could also use the Indicator panel for your connected one.

As far as setting an LED, it depends how you are connected to the LED. If it is via the local pins of the Pi, I’d have a simple python node that subscribes to the topic and sets the value appropriately.

Let me know how you go!