
ROSshow: ASCII art visualizations for robot sensor data - dheera
https://www.github.com/dheera/rosshow
======
droelf
Awesome! For the images you can go one step further with this fun Unicode hack
to make the terminal characters almost square:
[https://www.uninformativ.de/blog/postings/2016-12-17/0/POSTI...](https://www.uninformativ.de/blog/postings/2016-12-17/0/POSTING-
en.html)

~~~
dheera
Hadn't thought of that! Nice work, I'll think about how to work this in. It's
tricky with the way I implemented the buffers but it looks worth it.

------
bittercynic
The author demonstrated this live at Homebrew Robotics Club last night. It was
among the best live-demos I've seen, with the presenter simultaneously talking
to the group in an entertaining way and running the demonstrations.

Very cool stuff!

------
pancho111203
This is great!! I would really like to see this implemented as a generic
library for visualizing data, not limited to ROS. Something like matplotlib on
python but with all the output in ASCII.

~~~
dheera
Here is the ASCII/Braille-art library (which I wrote) extracted out as a
generic library: [https://github.com/dheera/python-
termgraphics](https://github.com/dheera/python-termgraphics)

It's on pip: pip install termgraphics (evolving, future versions may break
backward compatibility but I'll try not to)

~~~
bigredhdl
Thanks! I can see some good uses for this outside of ROS.

------
abhinai
Thank you OP. This is one of the best projects I have seen on hacker news in
several weeks! In my company, we face similar challenges. Many times we need
to visualize sensor output over really bad network connections on the other
side of the country. If we had seen this before, we may have simply used this
out of the box.

------
sgillen
This is very cool and looks like it could be extremely useful. Maybe worth
trying to integrate into rostopic echo itself, I.E. by passing an extra flag
or something. Might be worth going that route with ROS2 since I see roshow2 is
still in the TODO phase, though I realize that's a whole can of worms.

~~~
dheera
If the core ROS people are interested in integrating it I'd be happy to
discuss, but if that doesn't happen I don't think they expose an API to
control the behavior of the rostopic command.

You did give me an idea though which is to have rosshow "fall back" to
rostopic echo for types it doesn't understand, so that you never have to "try
twice".

For ROS 2 support -- I abstracted out all the Viewer logic from the ROS logic
so in principle it should only take modifying 1 file of code and maybe some
package configuration changes to support ROS 2. I'll work on this after I
familiarize myself with ROS 2, or would love community help here.

~~~
dbcurtis
Expose API? I am not sure why that is necessary? The source code for rostopic
is here: [https://github.com/ros/ros_comm](https://github.com/ros/ros_comm)
What is the barrier to simply adding a 'plot' command to rostopic?

[edit to add:] Ignore the naysayers, this is an excellent tool. I am sad I
missed the demo Wednesday night.

------
obilgic
Quick question: Can't we just set the font size to very small and turn block
character into pixels?

~~~
dheera
Yep so the terminal size directly influences the amount of bandwidth consumed
by this, so if you want higher resolution at the expensive of higher bandwidth
you can just reduce your font size.

For gnome-terminal just hit Ctrl+[minus].

I wouldn't recommend going all the way down to 1 pixel though.

------
ebg13
This looks really cool and fun, but, one roboticist to another, why do you not
stream out just the raw data and render hidef clientside? Surely streaming
"pixels" transfers way more bits than necessary, which is bad for low
throughput connections.

------
kickingvegas
Very slick. Wonder if you considered using Tektronix graphics to get higher
resolution images.
[https://en.wikipedia.org/wiki/Tektronix_4010](https://en.wikipedia.org/wiki/Tektronix_4010)

------
jwetzel1492
It's been a little while since I worked with ROS, but this is just fantastic.
Excellent idea. Working with hardware in the real world is messy. A tool that
gives you quick-and-good-enough feedback to help debug/tune things? +1

------
jefft255
I am installing it on our lab's Clearpath Husky right now. Thank you!!

------
csdvrx
Someone said ASCII is a bad suited tool and I agree.

I use the following with mintty on windows: (or mlterm on linux)

#!/bin/bash

export GNUTERM="sixelgd size 1280 720 truecolor font arial 10"

gnuplot-nox -e "set title '$HOST'; plot '<cat'"

Then it's just cat something | '{ print $5}' | tail -n +500 | sixel-plot.sh

I put an example with a screenshot and recompiled gnuplot binaries (debian) on
[http://github.com/csdvrx/sixel-gnuplot](http://github.com/csdvrx/sixel-
gnuplot)

~~~
dheera
Yeah sixels look really nice. I usually use gnome-terminal which doesn't seem
to support it, which is why I never really built sixel for myself in the first
place. But it looks worthwhile to build support in for it.

Considering I already have a framework to support both Braille and normal
ASCII art, I think it should be possible to work in sixel support with
graceful fallback to Unicode and ASCII. I think the way I have it set up, only
the termgraphics library would need to be changed, without needing to change
the visualization logic.

~~~
csdvrx
Your post made me create an account to respond to you and upload a few
screenshots of what I use along with binaries. Check github.com/csdvrx/sixel-
gnuplot - you will see it's not just nice but also super practical.

apt-get install mlterm and you're done!

For fallback, I agree: a braille support in gnuplot would be great when sixel
support is not available.

~~~
dheera
Interesting. Just tried that. It works, but it seems like it doesn't support a
lot of Unicode (including Chinese which is my system language and used in a
lot of my text files) so it's kind of a deal-breaker to use on a day to day
basis.

If gnome-terminal and other mainstream terminals supported sixel though that
would be really amazing.

Nevertheless though it would be nice to build support into ROSshow for sixel
since it's not that difficult to launch mlterm just for ROS visualizations,
and for people who use English only, and in hopes that gnome-terminal will
support it one day.

~~~
csdvrx
Happy you like it :)

It should definitely support all Unicode however. mlterm is very unicode
friendly.

Maybe it's a font problem?

Anyway, I agree with you, mainstream terminals should support sixel!

------
FrankDixon
I love the braille visualisation. It‘s amazingly high-def

------
msadowski
Thanks for making this project!

Here is a ROS discourse discussion on the project where I've shown a gif with
laser scan visualization: [https://discourse.ros.org/t/rosshow-view-ros-
topics-in-the-t...](https://discourse.ros.org/t/rosshow-view-ros-topics-in-
the-terminal-updated/8422) . Thanks for applying my feedback! Love the list of
supported messages.

------
voqv
This is super nice! Only nuisance I can think of is that there's no way to
start listening even if nothing is being published or if publishing stopped
for a while. Not sure if it's worth to fix for these cases.

------
srik901
This is cool! I think it would be very useful if we could quickly do some
basic math before outputting. For example scaling or averaging etc..

------
jakeinspace
Wish I had this when I was part of my university's robotics club, this looks
amazing.

------
blensor
Thank you so much for making this.

------
arduinomancer
This is so cool! Could definitely see people using this for side projects

------
a-dub
what about matplotlib with the sixel backend?

------
majestik
I don't understand why people think this is useful. ASCII art is probably the
most low resolution way of visualizing something that should be as high
resolution as possible.

~~~
dheera
Author here. Honestly I built this out of necessity. Yes, there are better
ways to visualize things, but often times you want to just SSH into a robot
and see whether a sensor is outputting something that makes sense or whether
it's outputting garbage.

Sometimes that robot is running embedded hardware, can't be directly connected
to a monitor, is running over a low-bandwidth LTE connection, or you simply
don't want to deal with a bunch of port forwards, X forwards just to see if
e.g. your sensors are working or if your algorithms are outputting something
meaningful.

With pretty much all ROS-based robots, you _always_ have a way to SSH into
them. The problem is the only way to view data over SSH is "rostopic echo"
which can be pretty meaningless for something like a camera or LIDAR. With
this, you can tell within seconds if your camera got blocked by an object, for
example.

Or you just want to see if your battery voltage dips when your motors spin. Or
how much current is being consumed on full speed. Or whether your IMUs are
oriented correctly.

At least these have all been necessities of mine in my various pursuits with
ROS, hence I built a tool around those, and felt I might as well share it in
case others have had similar frustrations with ROS.

By the way, the default mode uses Unicode Braille characters, so you get sub-
character resolution (2x4 pixels per character) as long as you're on a Unicode
terminal. There is also a strictly ASCII mode (-a) if your terminal doesn't
support Unicode, for the sake of completeness.

~~~
csdvrx
2x4 pixel is still too low.

If you have just ssh, why not gzip the data, and plot it on your laptop?

I think you should consider modern tools instead of ascii art plot, cf:
[https://saitoha.github.io/libsixel/](https://saitoha.github.io/libsixel/)

~~~
jefft255
We can do that already by recording a rosbag and then reading the data back on
a laptop. Or by port forwading, changing rosmaster and blablabla.

This is just a quicker way to diagnose stuff. I do forest robotics, and when
I'm in the woods with my robot the lesser fiddling with my laptop I have to
do, the better. It's always great to be able to quickly verify that all
sensors are working properly before starting an experiment.

