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

Rviz extremely slow when showing urdf model

asked 2019-12-08 12:21:53 -0500

dhaour9x gravatar image

updated 2019-12-08 12:22:48 -0500

Hello everyone,

I have 2 problems the first is I have created an urdf model of Robot(see image) and when I want to visualize the model in rviz it takes more than 15 min to show, but when I visualize the model in gazebo it doesn't take long but it's slow to respond.

the second is when i change the link position and spawn it in gazebo(takes the change correctly) but when i spawn the model in rviz(showed wrong position compared to gazebo) and vice versa

I am using ROS Kinetic Kame, VMware pro 15, Ubuntu 16.04 LTs

someone can help me.

<?xml version="1.0"?>
<launch>
<arg name="model" />
<include file="$(find gazebo_ros)/launch/empty_world.launch"/>
<param name="robot_description" textfile="$(find mybot_descriptions)/src/urdf/turtle.urdf" />

<param name="use_gui" value="true"/>

  <!-- robot state publisher -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" value="30.0"/>
    <param name="use_gui" value="true"/>
  </node>

  <!-- joint state publisher -->
  <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
    <param name="rate" value="30.0"/>
    <param name="use_gui" value="true"/>
  </node>

<node pkg="gazebo_ros" type="spawn_model" name="spawn_tb3" respwan="true" args="param robot-description -urdf -model turtle"/>

<node name="rviz" pkg="rviz" type="rviz" args="-d $(find mybot_descriptions)/src/urdf.rviz" required="true" />

</launch>

<?xml version="1.0" ?>
<robot name="turtlebot3_waffle" ><!--xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:include filename="$(find turtlebot3_description)/urdf/common_properties.xacro"/>
  <xacro:include filename="$(find turtlebot3_description)/urdf/turtlebot3_waffle.gazebo.xacro"/>

  <xacro:property name="r200_cam_rgb_px" value="0.005"/>
  <xacro:property name="r200_cam_rgb_py" value="0.018"/>
  <xacro:property name="r200_cam_rgb_pz" value="0.013"/>
  <xacro:property name="r200_cam_depth_offset" value="0.01"/>-->

  <link name="base_footprint"/>

  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link" />
    <origin xyz="0 0 0" rpy="0 0 0"/>
  </joint>

  <link name="base_link">
    <visual>
    <origin xyz="-0.198 -0.136 -0.027" rpy="0 0 0"/>
      <geometry>
        <mesh filename="package://mybot_descriptions/src/meshes/bases/base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
    </visual>

   <collision>
    <origin xyz="-0.064 0 0.400" rpy="0 0 0"/>
<!--      <origin xyz="-0.064 0 0.047" rpy="0 0 0"/>-->
      <geometry>
        <box size="0.266 0.266 0.900"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <mass value="1.3729096e+00"/>
      <inertia ixx="8.7002718e-03" ixy="-4.7576583e-05" ixz="1.1160499e-04"
               iyy="8.6195418e-03" iyz="-3.5422299e-06"
               izz="1.4612727e-02" />
    </inertial>
  </link>

  <joint name="wheel_left_joint" type="continuous">
    <parent link="base_link"/>
    <child link="wheel_left_link"/>
    <origin xyz="0.0 0.144 0.023" rpy="-1.57 0 0"/>
    <axis xyz="0 0 1"/>
  </joint>

  <link name="wheel_left_link ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2019-12-08 14:03:17 -0500

gvdhoorn gravatar image

updated 2019-12-09 04:31:46 -0500

You don't supply us with this information, but: did you create the .stl files yourself? If you did: what are their sizes? Could you show us the output of du -csh $(rospack find mybot_descriptions)/src/meshes and ls -al $(rospack find mybot_descriptions)/src/meshes?

Very long loading times are often caused by meshes that are way too detailed, which can happen if you've edited them in tools like SolidWorks (or similar) and then exported them without any further post-processing.

Also:

I am using ROS Kinetic Kame, VMware pro 15, Ubuntu 16.04 LTs

This is not going to help either: VMs are often slow and can have difficulty providing properly accelerated 3D graphics. Both RViz and Gazebo are heavy 3D applications and running them in VMs has caused problems for other users in the past.

It could be RViz is forced to use Software OpenGL, which would make it very slow.

Finally:

the first is I have created an urdf model of Robot(see image)

there is no image in your post.

edit flag offensive delete link more
1

answered 2019-12-09 11:07:25 -0500

updated 2019-12-09 11:08:12 -0500

How many triangles are in your meshes? I've only seen delays like this when my robot was way over specified (but even then, maybe 30 seconds to show up).

If it takes you that long, you've probably generated your meshes way too finely. Export them again or downsample them in Meshlab to a reasonable number. Keep in mind rviz is just for visualization and gazebo is (mostly) for that as well, unless you're trying to do some really fancy contact dynamics / generate images with robots in it.

Also running things in a VM is going to be a nightmare and extremely slow with gazebo. I would not recommend this path for any serious development or length of time.

edit flag offensive delete link more

Comments

And how is this not exactly what I wrote in my comment? :)

gvdhoorn gravatar image gvdhoorn  ( 2019-12-09 12:32:25 -0500 )edit

Uh, um, some additional context (meshlab, triangles, the fact the mesh doesn't need to be huge)

But yeah, mostly the same. I didn't see your comment until after I answered, then I added the VMWare comment after I read yours and I'd glanced over that in the question.

stevemacenski gravatar image stevemacenski  ( 2019-12-09 12:56:10 -0500 )edit

I posted it as a comment as without more information from the OP, it's all speculation.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-09 13:04:30 -0500 )edit

you're right the problem was the mesh of the robot was very fine and detailed. i just simplified mesh and it works fine. thank you very much

dhaour9x gravatar image dhaour9x  ( 2019-12-10 03:59:40 -0500 )edit

the problem was the mesh of the robot was very fine and detailed. i just simplified mesh and it works fine. thank you very much

dhaour9x gravatar image dhaour9x  ( 2019-12-10 04:00:11 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-08 12:21:53 -0500

Seen: 867 times

Last updated: Dec 09 '19