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

stl model disappears if scale parameter is set in urdf file

asked 2019-12-22 10:21:13 -0500

nikisalli gravatar image

os: ubuntu 18.04.3 kernel: 4.15-72 rosdistro: ros melodic

Hi, this is a part of my urdf file that works correctly (except the component uses mm as scale so it is zoomed):

<link name="base_link">
  <visual>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh filename="package://nightmare_description/meshes/base_link.stl"/>
    </geometry>
    <material name="silver">
      <color rgba="1 0 0 1"/>
    </material>
  </visual>
  <collision>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh filename="package://nightmare_description/meshes/base_link.stl"/>
    </geometry>
  </collision>
</link>

now if I add the scale parameter to this link it completely disappears from rviz although I can see all the axes move correctly:

<link name="base_link">
  <visual>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh scale="0.001 0.001 0.001" filename="package://nightmare_description/meshes/base_link.stl"/>
    </geometry>
    <material name="silver">
      <color rgba="1 0 0 1"/>
    </material>
  </visual>
  <collision>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh scale="0.001 0.001 0.001" filename="package://nightmare_description/meshes/base_link.stl"/>
    </geometry>
  </collision>
</link>

what am I doing wrong? has it something to do with the stl files used?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-12-22 11:08:14 -0500

gvdhoorn gravatar image

updated 2019-12-22 11:22:19 -0500

Can you tell us what the value is of LC_NUMERIC? You can print it using echo $LC_NUMERIC in a terminal.

There is a good chance you're running into an issue with urdf and locales which use , for decimals instead of . (ie: comma vs dot).


See #q272692 for a related Q&A.

the output gives LC_NUMERIC=it_IT.UTF-8. Should I set the english standard?

As a test, you could see whether the following "solves" your problem:

  • open a new terminal
  • export LC_NUMERIC="en_US.UTF-8"
  • now source your workspace and try starting RViz again

If your robot -- with the scaling in place -- now does appear, it's most likely ros/urdfdom_headers#41.

If it is 41, then it should have been fixed recently. According to this comment on the bug report, enabling the bionic-updates repository and updating urdfdom and urdfdom-headers should really fix things (ie: you should not need to use the LC_NUMERIC="en_US.UTF-8" work-around).

edit flag offensive delete link more

Comments

the output gives LC_NUMERIC=it_IT.UTF-8 should I set the english standard?

nikisalli gravatar image nikisalli  ( 2019-12-22 11:11:56 -0500 )edit

i changed the locale but still the model isn't showing up

nikisalli gravatar image nikisalli  ( 2019-12-22 11:40:19 -0500 )edit

What did you do exactly? Another test could be to use , for the scale, instead of ..

gvdhoorn gravatar image gvdhoorn  ( 2019-12-22 11:44:09 -0500 )edit

sudo update-locale LC_ALL=en_US.UTF-8

nikisalli gravatar image nikisalli  ( 2019-12-22 11:47:42 -0500 )edit

anyways the whole urdf uses the dot notation and it works as long as I don't set the scaling parameter so the issue should be somewhere else

nikisalli gravatar image nikisalli  ( 2019-12-22 12:01:44 -0500 )edit

ok problem solved, you were right! the numeric locale was correctly set to english on the robot but it was set to italian on the host where i was trying to run rviz! after changing my pc's numeric locale to en_US it works flawlessly. thank you!

nikisalli gravatar image nikisalli  ( 2019-12-23 05:29:04 -0500 )edit

Ok, so as I wrote in my answer, this should have been fixed in Ubuntu itself. Can you check which repositories you have active on the host where you were running RViz? Is the updates repository enabled?

You shouldn't need to set all locales to en_US.UTF-8 any more.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-23 07:07:04 -0500 )edit

I'm running arch linux on the host

nikisalli gravatar image nikisalli  ( 2019-12-23 07:16:18 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-22 10:21:13 -0500

Seen: 666 times

Last updated: Dec 22 '19