No transforms in rviz, all links are at 0,0,0
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.
- 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?
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
I loaded the model to the parameter robot_model
$ rosparam load kbot.urdf robot_description
I started robot_state_publisher
$ rosrun robot_state_publisher robot_state_publisher
I started joint_state_publisher and UI showed with joints in centered positions.
$ rosrun link_state_publisher_gui link_state_publisher_gui
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).
I loaded robot model to rviz
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.
TF visualization did not show any transformations
When I load the model to Gazebo, everything looks OK
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 ...
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.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?
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: 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
While experimenting with moving roscore around I changed ROS_IP value to the laptop's IP address.
So, I guess using ROS_IP as localhost on distributed setups does not seem to be a good idea.
Does it sound right?