ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RViz text marker doesn't display

asked 2018-11-07 12:50:10 -0500

Wezzoid gravatar image

updated 2018-11-08 08:41:02 -0500

I am successfully using various types of visualization markers, but can't get TEXT_VIEW_FACING to work. RViz is subscribed to the topic, and the message content seems ok. RViz isn't showing any errors. Am I missing something simple or is there a problem with RViz? Using Kinetic on Ubuntu 16.

Here is the output of rostopic echo. (There is one text marker each for 4 legs, only one shown)

---
header:
  seq: 13963
  stamp:
    secs: 1541615488
    nsecs: 232728531
  frame_id: "/base_link"
ns: "markers_footforce_text"
id: 3
type: 9
action: 0
pose:
  position:
    x: 0.14822583112
    y: -0.163636099005
    z: -0.183330821392
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
scale:
  x: 0.05
  y: 0.05
  z: 0.05
color:
  r: 1.0
  g: 0.0
  b: 0.0
  a: 1.0
lifetime:
  secs: 0
  nsecs:         0
frame_locked: False
points: []
colors: []
text: "hello"
mesh_resource: ''
mesh_use_embedded_materials: False
---

update: Here is an example of a marker msg that works:

---
header:
  seq: 7019
  stamp:
    secs: 1541670264
    nsecs: 695540526
  frame_id: "/base_link"
ns: "markers_footforce"
id: 3
type: 0
action: 0
pose:
  position:
    x: 0.137246076547
    y: -0.150541167427
    z: -0.0882269625985
  orientation:
    x: 0.0
    y: -1.0
    z: 0.0
    w: 1.0
scale:
  x: 0.0925518925519
  y: 0.02
  z: 0.02
color:
  r: 0.0
  g: 1.0
  b: 0.0
  a: 1.0
lifetime:
  secs: 0
  nsecs:         0
frame_locked: False
points: []
colors: []
text: ''
mesh_resource: ''
mesh_use_embedded_materials: False
---

update: Here are my RViz startup messages:

[ INFO] [1541671551.052185041]: rviz version 1.12.16
[ INFO] [1541671551.052267087]: compiled against Qt version 5.5.1
[ INFO] [1541671551.052279569]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1541671551.746811300]: Stereo is NOT SUPPORTED
[ INFO] [1541671551.747030266]: OpenGl version: 3 (GLSL 1.3).

Last few lines from rviz -l :

[ INFO] [1541672551.298442008]: GLXWindow::create used FBConfigID = 163
[ INFO] [1541672552.074872851]: Mesh: Loading rviz_sphere.mesh.
[ INFO] [1541672552.080553706]: Texture: SelectionRect0Texture: Loading 1 faces(PF_R8G8B8A8,1x1x1) Internal format is PF_A8R8G8B8,1x1x1.
[ INFO] [1541672552.083017394]: Mesh: Loading rviz_cylinder.mesh.
[ INFO] [1541672552.083373321]: Mesh: Loading rviz_cone.mesh.
[ INFO] [1541672565.843360810]: Mesh: Loading rviz_cube.mesh.
[ INFO] [1541672567.908020785]: Font Liberation Sans using texture size 256x128
[ INFO] [1541672567.911394493]: Info: Freetype returned null for character 160 in font Liberation Sans
[ INFO] [1541672567.912111099]: Texture: Liberation SansTexture: Loading 1 faces(PF_BYTE_LA,256x128x1) Internal format is PF_BYTE_LA,256x128x1.

It's saying it couldn't find a texture from the font for the nbspace char, not that it's actually broken, right?


Update: The interactive markers tutorial demo doesn't show any text either, but works otherwise. Must be something wrong with RViz.


Update re Ogre and fonts:

wes@ubuntu:~$ sudo dpkg -l *ogre*
[sudo] password for wes:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  libogre-1.8-de <none>       <none>       (no description available)
un  libogre-1.8.0  <none>       <none>       (no description available)
ii  libogre-1.9-de 1.9.0+dfsg1- i386         3D Object-Oriented Graphics ...
(more)
edit retag flag offensive close merge delete

Comments

Can you try to change the scale.z value to something bigger (like 1) ? From the wiki this set the size of the text. Can you also provide your code so that we can see your configuration ?

Delb gravatar image Delb  ( 2018-11-08 06:24:55 -0500 )edit

Hi Delb. I initially had the text z pretty big, like 0.2 m so the word would have been bigger than the (small) robot model. The text doesn't show even with everything else hidden. The fact that the interactive markers demo doesn't work either makes me think it isn't my code but something with RViz

Wezzoid gravatar image Wezzoid  ( 2018-11-08 06:34:13 -0500 )edit

Does rviz returns an error in the Displays view ?

Delb gravatar image Delb  ( 2018-11-08 06:53:36 -0500 )edit

no error in the displays view. I get that warning about the font character in the console. I don't know whether that's reaally an issue.

Wezzoid gravatar image Wezzoid  ( 2018-11-08 07:07:13 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-12-04 06:44:31 -0500

Wezzoid gravatar image

Answering myself - hope that's ok. This is definately something to do with the way the Virtual Machine handles Ogre/OpenGL. It may also be something to do with the NVidia drivers, I don't know. I had the same issue with both VMWare Player and VirtualBox. I used Win 10 WSL with XMing and the text overlays worked.

edit flag offensive delete link more
0

answered 2018-11-08 06:54:45 -0500

Delb gravatar image

updated 2018-11-08 06:59:47 -0500

I just tried this code and it works fine :

#include "ros/ros.h"
#include "visualization_msgs/Marker.h"

int main(int argc, char **argv)
{
  ros::init(argc, argv, "talker");
  ros::NodeHandle n("~");
  ros::Publisher chatter_pub = n.advertise<visualization_msgs::Marker>("chatter", 1000);
  ros::Rate loop_rate(1);

  visualization_msgs::Marker marker;
  marker.header.frame_id = "base_link";
  marker.header.stamp = ros::Time();
  marker.ns = "my_namespace";
  marker.id = 0;
  marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
  marker.action = visualization_msgs::Marker::ADD;
  marker.scale.z = 0.05;
  marker.color.a = 1.0; // Don't forget to set the alpha!
  marker.color.r = 1.0;
  marker.color.g = 0.0;
  marker.color.b = 0.0;
  marker.text="VISUALIZATION TXT MARKER TEST";

  while (ros::ok())
  {
    chatter_pub.publish(marker);
    ros::spinOnce();
    loop_rate.sleep();
  }
  return 0;
}

Maybe you are setting something wrong/useless for text markers that makes it fail. Also be sure you display the marker according to the correct topic in rviz.

In your case you have position.z with a negative value so maybe you print a map and then you can't see the marker if you don't look under the map (it's a guess, if you could provide more informations like a screenshot of rviz and the code of the marker).

edit flag offensive delete link more

Comments

Hi Delb, thanks but as i said, it's failing with the official tutorial code, not just mine, so it isn't the code, it's something wrong with RViz, Ogre, the font maybe, I don't know. I installed it via the usual ros-kinetic-desktop-full package. I'm using a VMware VM, maybe that's it.

Wezzoid gravatar image Wezzoid  ( 2018-11-08 07:04:13 -0500 )edit

purged & reinstalled ros-kinetic-rviz. Updated host video drivers. Ran VM without acceleration. Tried turning off acceleration and changing OGRE_RTT_MODEs as per http://wiki.ros.org/rviz/Troubleshooting . No change

Wezzoid gravatar image Wezzoid  ( 2018-11-08 07:16:29 -0500 )edit

What is the output of sudo dpkg -l *ogre* and sudo dpkg -l *fonts-liberation* ?

Delb gravatar image Delb  ( 2018-11-08 07:17:15 -0500 )edit

updated the main post as it's too much txt for a comment. Thanks Delb.

Wezzoid gravatar image Wezzoid  ( 2018-11-08 08:41:31 -0500 )edit

This may be an obvious test you've already done. But if you view a TF tree in RVIZ do the topic names get shown properly? Wondering if this is a problem with all texture fonts in your RVIZ install.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-11-08 09:53:39 -0500 )edit

Hi Pete, my TF tree appears fine. I'm going find an Ubuntu machine that isn't a VM, to try the tutorial on and then get back to you.

Wezzoid gravatar image Wezzoid  ( 2018-11-12 05:06:31 -0500 )edit

Ugh, it works fine on a native machine. screenshot I will search for a fix or alternative.

Wezzoid gravatar image Wezzoid  ( 2018-11-14 05:20:17 -0500 )edit

VMWare and VirtualBox both seem to have the same issue

Wezzoid gravatar image Wezzoid  ( 2018-11-14 12:33:43 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-11-07 12:50:10 -0500

Seen: 2,753 times

Last updated: Dec 04 '18