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

Xacro is not properly launched in Gazebo: missing link

asked 2022-05-18 11:50:55 -0500

Vini71 gravatar image

updated 2022-05-18 12:04:22 -0500

Hi I am trying to simplify my model using xacro. My idea is to have a macro:xacro for all the truck wheels. At this moment I am just trying to create the first shaft front left wheel using xacro. The good news is that the left wheel link and the left wheel joint are created and visualized in Rviz!

image description

However in Gazebo the wheel and joint do not appear. I am going to share my urdf.xacro here as well as the launch files.

image description

The urdf:

    <?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="iaz_truck">
    <xacro:property name="tire_rad" value="2" />
    <xacro:property name="tire_len" value="6" />

  <link name="dummy">
  </link>


  <link name="base_link">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
    </inertial>
  </link>

  <link
    name="chassis_link">
    <inertial>
      <origin
        xyz="-2.6 5.5 -2.375"
        rpy="0 0 0" />
      <mass
        value="706.504582027022" />
      <inertia
        ixx="39.450737574524"
        ixy="-0.0360220237393506"
        ixz="0.0791219230947013"
        iyy="53.8198880289704"
        iyz="-1.15911466511096"
        izz="40.3544359429485" />
    </inertial>
    <visual>
      <origin
        xyz="-2.6 5.5 -2.375"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://urdf_chassis_pkg/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.250980392156863 0.250980392156863 0.250980392156863 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="-2.6 5.5 -2.375"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://urdf_chassis_pkg/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>

  <joint name="dummy_joint" type="fixed">
    <parent link="dummy"/>
    <child link="base_link"/>
  </joint>

  <joint name="base_link_connection" type="fixed">
    <parent link = "base_link"/>
    <child link= "chassis_link"/>
    <origin xyz="2 0 0.5" rpy= "0 0 1.57"/>
    <axis xyz="1 0 0"/>
  </joint>


<!-- Front link -->

 <link name = "front_link">
  <inertial>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <mass
        value="20" />
      <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <box size = "0.05 2.5 0.05 "/>
      </geometry>
      <material
        name="">
        <color rgba="0.250980392156863 0.250980392156863 0.250980392156863 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <box size = "0.1 2.0 0.1 "/>
      </geometry>
    </collision>
  </link>

<!-- Connection Chassis_Link to Front link -->

  <joint name="front_joint" type="fixed">
    <parent link="chassis_link"/>
    <child link="front_link"/>
    <origin rpy="0 0 1.57079632679" xyz="-0.1 -3.6 0.030"/> 
  </joint>

<!--Steer Link : Link to connect Front Link and Ackermann Bar -->

  <link name="steer_link">
    <inertial>
      <mass value="5.0"/>
      <origin xyz="0 0 0 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-19 06:19:37 -0500

Joe28965 gravatar image

Just to check in Gazebo:

Can you go to view->collisions and turn that on? It's in the top toolbar in Gazebo. That turns on the collision boxes. If the wheel is in Gazebo, but not visible for some reason, you should see it appear in transparent orange.

In that case it's probably your stl that Gazebo can't find for one reason or another.

edit flag offensive delete link more

Comments

Hi, Joe unfortunately it didn't work:

check here please: https://ibb.co/MPD605g

In the left bar, the link front_left_wheel_link and the joint front_left_wheel_joint specified in URDF were not created.

Guess there is something needed to be enabled for Gazebo? add something in launch file or in xacro ?

Vini71 gravatar image Vini71  ( 2022-05-19 10:24:36 -0500 )edit

Could you run $LC_NUMERIC in your terminal and give me the output?

Joe28965 gravatar image Joe28965  ( 2022-05-20 02:50:33 -0500 )edit

sure, Joe. if I run:

$LC_NUMERIC

It returns nothing and the shell becomes prepared for the next command.

If I run

LC_NUMERIC

then the output is: bash: LC_NUMERIC: command not found

Actually, I have seen that this command is related to languages and symbols right? My Linux is in Portuguese, but does this affect something in bash? Does something affect Gazebo? It has not found the command...so must I install some library to run this command? WHICH? I have not found on internet what could be installed to be able to run this command...Thanks in advance.

Vini71 gravatar image Vini71  ( 2022-05-20 10:08:14 -0500 )edit

It's really weird that it doesn't return anything. Try

export LC_NUMERIC="en_US.UTF-8"

and (in the same terminal) run Gazebo. If that works. add that line to your bashrc

Joe28965 gravatar image Joe28965  ( 2022-05-20 10:12:01 -0500 )edit

And yes, it has to do with language and how it interprets stuff. Which is one of the many reasons I prefer to install all my software (including OS) in English.

Joe28965 gravatar image Joe28965  ( 2022-05-20 10:13:16 -0500 )edit

Interesting Joe, thanks for the class. Unfortunately, nothing changed in Gazebo exporting this args in terminal or adding to bash...

Do you know if is possible to change the language of the OS after it has already been installed in another language? I do not wish to backup, format, and reinstall Linux again...

About the xacro... other solution you can think of? Is this xacro-macro from my urdf correct? What do you guess? missing some property of gazebo (mandatory to be included? I have read something about this...)

Vini71 gravatar image Vini71  ( 2022-05-20 12:20:53 -0500 )edit

You could try and run the Set locale portion of the Foxy installation. See if that helps.

I don't know if it's possible to change the language. Honestly that might be worth googling as an Ubuntu problem.

As for some missing URDF thing. I checked that you had inertial included, that's a big one that can be a pain. You might also want to replace continuous for the joint with revolute and change the limit line to <limit lower="-1e+16" upper="1e+16" effort="10000" velocity="1000"/> (also, you might want to give effort and velocity realistic values while you're at it). It's basically the same thing. continuous joints don't technically exist in Gazebo. It's just a revolute joint with the limits set to those values. I've had weird issues with continuous joints in the past and stopped using them.

Joe28965 gravatar image Joe28965  ( 2022-05-20 12:32:03 -0500 )edit

You can also try to add extra_gazebo_args:="--verbose" to the end of your command when you start your launch file (roslaunch package launchfile extra_gazebo_args:="--verbose"

Joe28965 gravatar image Joe28965  ( 2022-05-20 12:33:15 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-05-18 11:50:55 -0500

Seen: 182 times

Last updated: May 19 '22