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

No transforms in rviz, all links are at 0,0,0

asked 2021-09-23 16:57:22 -0500

void_main gravatar image

updated 2021-09-25 09:33:57 -0500

All,

appreciate any help with this stubborn issue. I created my own diff-steering model and after hours I am still unable to have it properly visualized in rviz while Gazebo does not have any problems with properly displaying the robot.

This issue seems to be similar to the following one: question 367296: no-transform-to-anything-in-rviz-pure-simulation

I am running Ubuntu 20.04.3 LTS/64bit (kernel 5.4.0-86-generic) with ROS Noetic on bare metal (Dell Precision 7530). Graphics: llvmpipe (LLVM 10.0.0, 256 bits) / llvmpipe (LLVM 10.0.0, 256 bits)

To troubleshoot the problem I used simple kbot model from this tutorial The URDF.XACRO and other snippets below.

  1. roscore is running on another system but everything else seems to be OK, so I am assuming that this is not the source of the issue.

[edit] I ran roscore on the same machine as rviz and... everything works!

Since the roscore was running on RasPi on my physical robot, I still need to make this work. Or, is this a bad idea to run roscore on such low performance system? How do I tackle this?

  1. I generated the URDF from XACRO and validated it with check_urdf

    $ xacro kbot.urdf.xacro > kbot.urdf
    
    $ check_urdf kbot.urdf 
    robot name is: kbot
    ---------- Successfully Parsed XML ---------------
    root Link: base_footprint has 1 child(ren)
        child(1):  base_link
            child(1):  caster_wheel
            child(2):  left_wheel
            child(3):  right_wheel
    
  2. I loaded the model to the parameter robot_model

    $ rosparam load kbot.urdf robot_description
    
  3. I started robot_state_publisher

    $ rosrun robot_state_publisher robot_state_publisher
    
  4. I started joint_state_publisher and UI showed with joints in centered positions.

    $ rosrun link_state_publisher_gui link_state_publisher_gui
    
  5. I ran rviz - no error messages. Running rviz with -l did not reveal any errors.

    $ rosrun rviz rviz
    [ INFO] [1632431752.386304038]: rviz version 1.14.9
    [ INFO] [1632431752.386344029]: compiled against Qt version 5.12.8
    [ INFO] [1632431752.386351270]: compiled against OGRE version 1.9.0 (Ghadamon)
    [ INFO] [1632431752.841591418]: Forcing OpenGl version 0.
    [ INFO] [1632431753.026713400]: Stereo is NOT SUPPORTED
    [ INFO] [1632431753.026756098]: OpenGL device: llvmpipe (LLVM 10.0.0, 256 bits)
    [ INFO] [1632431753.026771448]: OpenGl version: 3.1 (GLSL 1.4).
    
  6. I loaded robot model to rviz

  7. I selected fixed link to base_footprint

Result

All model links are at the same offset: 0,0,0; robot model is not displayed properly.

[Edit] Just installed chrony on the master and local machines and the links, while still around 0,0,0 are distributed differently. Puzzling.

image description

TF visualization did not show any transformations

When I load the model to Gazebo, everything looks OK

image description

ROS

ROS_VERSION=1
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/home/<myuser>/catkin_ws/src:/opt/ros/noetic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/<myuser>/catkin_ws/devel/share/common-lisp
ROS_IP=127.0.0.1
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
ROS_MASTER_URI=http://192.168.1.71:11311
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic

URDF.XACRO

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="kbot">

  <xacro:property name="base_width" value="0.16"/>
  <xacro:property name="base_len" value="0.16 ...
(more)
edit retag flag offensive close merge delete

Comments

Since the roscore was running on RasPi on my physical robot, I still need to make this work. Or, is this a bad idea to run roscore on such low performance system?

roscore is not involved directly in node data exchange. It's all peer-to-peer. roscore runs a DNS-like system which tells nodes where other nodes are. ROS is not a brokered system.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-25 00:49:32 -0500 )edit

So, I am wondering, what made it work? Obviously, while troubleshooting. I made number of changes but move of roscore to the same machine seemed like it did the trick. Installing chrony also improved some. Wouldn't this suggest that the timing of publishing transforms is the problem?
Is there an easy way to measure the network latency in the context of ROS?

void_main gravatar image void_main  ( 2021-09-25 04:00:36 -0500 )edit
1

I don't believe this has something to do with latency. The messages you mention are timestamped. Latency only plays a minor role then (of course, hours of difference between clocks will still not work).

But having written that: as soon as you include multiple machines in your ROS application, you'll have to make sure everything is configured correctly and on all machines. Synchronising the clocks is part of that.

Where you run roscore doesn't really matter, as long as your network is functioning correctly.

As to your problem: you don't mention where specifically you ran which nodes. But I would suggest to make sure to check your multi-host network configuration and try again.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-25 05:00:46 -0500 )edit

@gvdhoorn: first of all for your comments.

Secondly, in my setup:

  • roscore is running on a RapberryPi (Rspbian 10 buster) hooked up to my robot hardware (noetic, 1.15.10)

  • everything else is running on a laptop with Ubuntu 20.04 (noetic, 1.15.11)

Thirdly, it seems that in my setup, the location of roscore made a difference.
I guess that this is good news because it tells me that I am not completely crazy :).

I believe that I found the culprit. One change which made a difference on my laptop was ROS_IP value.

Originally, I had it set up as

export ROS_IP=127.0.0.1

While experimenting with moving roscore around I changed ROS_IP value to the laptop's IP address.

export ROS_IP=192.168.1.zzz

So, I guess using ROS_IP as localhost on distributed setups does not seem to be a good idea.

Does it sound right?

void_main gravatar image void_main  ( 2021-09-25 08:48:33 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2021-09-25 09:39:26 -0500

gvdhoorn gravatar image

You cannot set ROS_IP to 127.0.0.1 in a multi-machine setup. So if that's what you did, it's likely that's the cause of your problems.

Please refer to the tutorials I linked above in an earlier comment.

edit flag offensive delete link more

Comments

@gvdhoorn thank you very much for your help.

void_main gravatar image void_main  ( 2021-09-25 12:55:35 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-09-23 16:57:22 -0500

Seen: 190 times

Last updated: Sep 25 '21