Gazebo | Ignition | Community
Ask Your Question

lmiller's profile - activity

2020-07-13 11:48:19 -0500 answered a question invisible visual mesh in xacro file

I removed the name of the visual. After that it worked!

2020-07-13 07:32:31 -0500 marked best answer invisible visual mesh in xacro file

Hi

I try to convert my Gazebo simulation from gazebo9 to gazebo11.

I took a little part of my xacro code and try to load it with the urdf spawner. The code is similar like this:

<?xml version="1.0"?>
<robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">

  <link name="world"/>

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

  <!-- base_link -->
  <link name="base_link">
    <inertial>
    <origin xyz="0 0 2" rpy="0 0 0"/>
    <mass value="220"/>
    <inertia
        ixx="36" ixy="0.0" ixz="0.0"
        iyy="36" iyz="0.0"
        izz="36"/>
    </inertial>

    <collision name="base_collision">
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="/home/miller/simulation_ws/src/robot_description/meshes/base.dae" />
      </geometry>
    </collision>

    <visual name="base_visual">
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="/home/miller/simulation_ws/src/robot_description/meshes/base.dae" />
      </geometry>
    </visual>
  </link>

  <gazebo reference="base_link">
    <material>Gazebo/DarkGrey</material>
  </gazebo>
</robot>

i start gazebo with a specific world with the ros2 launch command and then i start the urdf_spawner:

ros2 run gazebo_ros spawn_entity.py -file ~/simulation_ws/src/robot_description/urdf/robot.urdf.xacro -entity 'MYROBOT'

The urdf_spawner spawn my robot successfully with following output:

[INFO] [1594364284.474383091] [spawn_entity]: Spawn Entity started
[INFO] [1594364284.474675304] [spawn_entity]: Loading entity XML from file /home/miller/simulation_ws/src/robot_description/urdf/robot.urdf.xacro
[INFO] [1594364284.475676821] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[INFO] [1594364284.475926572] [spawn_entity]: Waiting for service /spawn_entity
[INFO] [1594364284.729346101] [spawn_entity]: Calling service /spawn_entity
[INFO] [1594364284.955232157] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [MYROBOT]

The problem is, the Mesh of the visual is invisible, but its load correctly (I checked it in the Model Editor). Why is the Mesh invisible? I defined the color in the gazebo tag to DarkGrey...

I am working on Ubuntu 20.04 (and ROS2 Foxy)

Thanks

2020-07-13 07:32:31 -0500 received badge  Scholar (source)
2020-07-10 02:41:45 -0500 received badge  Organizer (source)