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

RobotModel not showing in RViZ. No error shown.

asked 2019-09-20 05:00:53 -0500

ninamwa gravatar image

updated 2022-04-17 11:04:52 -0500

lucasw gravatar image

Hi. I am using ROS2 bionic, and i am trying to launch a urdf and visualize it in RViZ. In Rviz, there are no errors, and all the TF frames are there, and can be visualized. The problem is that no model of the robot is showing.

I am not able to upload files yet, but the status, in RViZ, for both TF and RobotModel is OK, and all the different frames are listed correctly under TF. All the frames are also correctly visualized.

My launch file looks like this:

import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
import launch_ros.actions

name = "usegui"
value = "True"

def generate_launch_description():
    use_sim_time = LaunchConfiguration('use_sim_time', default='false')
    urdf_file_name = '01-myfirst.urdf'
    urdf = os.path.join(
        get_package_share_directory('mrm'),
        'urdf',
        urdf_file_name)

    return LaunchDescription([
        launch_ros.actions.Node(
            package="robot_state_publisher",
            node_executable="robot_state_publisher",
            node_name="robot_state_publisher",
            output='screen',
            arguments=[urdf]),

        launch_ros.actions.Node(
            package='rviz2',
            node_executable='rviz2',
            node_name='rviz2',
            output='screen'),


        launch_ros.actions.Node(
            package='mrm', 
            node_executable='dummy_joint_states', 
            output='screen')    
    ])

My URDF files look like this: It is pretty basic, and is taken from this tutorial: http://wiki.ros.org/urdf/Tutorials/Bu...

<?xml version="1.0"?>
<robot name="visual">
<material name="blue">
    <color rgba="0 0 0.8 1"/>
  </material>
  <material name="black">
    <color rgba="0 0 0 1"/>
  </material>
  <material name="white">
    <color rgba="1 1 1 1"/>
  </material>
  <link name="base_link">
    <visual>
      <geometry>
        <cylinder length="0.6" radius="0.2"/>
      </geometry>
      <material name="blue"/>
    </visual>
  </link>
  <link name="right_leg">
    <visual>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
      <origin rpy="0 1.57075 0" xyz="0 0 -0.3"/>
      <material name="white"/>
    </visual>
  </link>
  <joint name="base_to_right_leg" type="fixed">
    <parent link="base_link"/>
    <child link="right_leg"/>
    <origin xyz="0 -0.22 0.25"/>
  </joint>
  <link name="right_base">
    <visual>
      <geometry>
        <box size="0.4 0.1 0.1"/>
      </geometry>
      <material name="white"/>
    </visual>
  </link>
  <joint name="right_base_joint" type="fixed">
    <parent link="right_leg"/>
    <child link="right_base"/>
    <origin xyz="0 0 -0.6"/>
  </joint>
  <link name="right_front_wheel">
    <visual>
      <origin rpy="1.57075 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.1" radius="0.035"/>
      </geometry>
      <material name="black"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
  </link>
  <joint name="right_front_wheel_joint" type="fixed">
    <axis rpy="0 0 0" xyz="0 1 0"/>
    <parent link="right_base"/>
    <child link="right_front_wheel"/>
    <origin rpy="0 0 0" xyz="0.133333333333 0 -0.085"/>
  </joint>
  <link name="right_back_wheel">
    <visual>
      <origin rpy="1.57075 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.1" radius="0.035"/>
      </geometry>
      <material name="black ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-09-23 04:41:05 -0500

jschleicher@Pilz gravatar image

Just a random guess: Did you select the "Description topic" in the RobotModel display settings?

Choose /robot_description inside RobotModel->Description Topic.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-09-20 05:00:53 -0500

Seen: 1,906 times

Last updated: Sep 20 '19