Gazebo | Ignition | Community
Ask Your Question
0

imported models couldn't collide each other

asked 2022-02-18 03:32:43 -0500

fonawork gravatar image

updated 2022-02-18 21:01:25 -0500

azeey gravatar image

Could you help me how can I make collide imported models?

I downloaded SUV model from here. https://app.ignitionrobotics.org/Open...

and I uploaded this model to my world.sdf as below code. you may find if you click the 'play button', two SUVs will be collided by gravity.

I could find these testing results.

  1. Ignition gazebo's Box, Capsule and Sphere,, etc. can collide each other.

  2. downloaded SUV model with Ignition gazebo's Box, Capsule and Sphere,, etc can collide each other.

  3. downloaded SUV models couldn't collide each other.

```

<model name='suv_110'>
    <static>0</static>
    <link name='chassis'>
      <collision name='collision'>
        <pose>0 0 0 0 0 -1.57079632679</pose>
        <geometry>
          <mesh>
            <scale>0.06 0.06 0.06</scale>
            <uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/suv/2/files/meshes/suv.obj</uri>
          </mesh>
        </geometry>
      </collision>
      <visual name='visual'>
        <pose>0 0 0 0 0 -1.57079632679</pose>
        <geometry>
          <mesh>
            <scale>0.06 0.06 0.06</scale>
            <uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/suv/2/files/meshes/suv.obj</uri>
          </mesh>
        </geometry>
      </visual>
      <pose>0 0 0 0 -0 0</pose>
      <inertial>
        <pose>0 0 0 0 -0 0</pose>
        <mass>1</mass>
        <inertia>
          <ixx>1</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>1</iyy>
          <iyz>0</iyz>
          <izz>1</izz>
        </inertia>
      </inertial>
      <enable_wind>0</enable_wind>
    </link>
    <pose>20 0 1 0 0 0</pose>
    <self_collide>0</self_collide>   </model>

```

<model name='suv_111'>
    <static>0</static>
    <link name='chassis'>
      <collision name='collision'>
        <pose>0 0 0 0 0 -1.57079632679</pose>
        <geometry>
          <mesh>
            <scale>0.06 0.06 0.06</scale>
            <uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/suv/2/files/meshes/suv.obj</uri>
          </mesh>
        </geometry>
      </collision>
      <visual name='visual'>
        <pose>0 0 0 0 0 -1.57079632679</pose>
        <geometry>
          <mesh>
            <scale>0.06 0.06 0.06</scale>
            <uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/suv/2/files/meshes/suv.obj</uri>
          </mesh>
        </geometry>
      </visual>
      <pose>0 0 0 0 -0 0</pose>
      <inertial>
        <pose>0 0 0 0 -0 0</pose>
        <mass>1</mass>
        <inertia>
          <ixx>1</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>1</iyy>
          <iyz>0</iyz>
          <izz>1</izz>
        </inertia>
      </inertial>
      <enable_wind>0</enable_wind>
    </link>
    <pose>20 0 10 0 0 0</pose>
    <self_collide>0</self_collide>
  </model>
edit retag flag offensive close merge delete

Comments

[Testing environment] - Linux Mint 20.2 - Installed Ignition version is Garden

fonawork gravatar imagefonawork ( 2022-02-20 18:22:30 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-02-20 18:55:58 -0500

fonawork gravatar image

updated 2022-02-20 22:14:21 -0500

Have a nice day! azeey.

Unfortunately, it's weird in my testing. I wrote the sdf file based on this example code /usr/share/ignition/ignition-gazebo6/worlds/heightmap.sdf which has ground plane as below code. this example code has already ground plane and if I just add SUVs, it shows that it is getting worse result. SUVs are through the ground plane without any collision. To avoid this, I had to use ground area 'https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground Plane'.


[solved] That's a plugin reason. by changing loading part of physics plugin from 'heightmap.sdf' to 'tunnel.sdf', it works fine.

<physics name="1ms" type="ignored">
  <max_step_size>0.001</max_step_size>
  <real_time_factor>1.0</real_time_factor>
</physics>

[my testing code]

<sdf version="1.6"> <world name="heightmap"> <physics name="1ms" type="ignored"> <dart> <collision_detector>bullet</collision_detector> </dart> </physics>

<light type="directional" name="sun">
  <cast_shadows>true</cast_shadows>
  <pose>0 0 10 0 0 0</pose>
  <diffuse>0.8 0.8 0.8 1</diffuse>
  <specular>0.2 0.2 0.2 1</specular>
  <attenuation>
    <range>1000</range>
    <constant>0.9</constant>
    <linear>0.01</linear>
    <quadratic>0.001</quadratic>
  </attenuation>
  <direction>-0.5 0.1 -0.9</direction>
</light>

<model name="sphere_red">
  <pose>30 30 10 0 0 0</pose>
  <link name="sphere_link">
    <inertial>
      <inertia>
        <ixx>3</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>3</iyy>
        <iyz>0</iyz>
        <izz>3</izz>
      </inertia>
      <mass>3.0</mass>
    </inertial>
    <collision name="sphere_collision">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
    </collision>
    <visual name="sphere_visual">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
      <material>
        <ambient>1 0 0 1</ambient>
        <diffuse>1 0 0 1</diffuse>
        <specular>1 0 0 1</specular>
      </material>
    </visual>
  </link>
</model>

<model name="sphere_green">
  <pose>30 -30 10 0 0 0</pose>
  <link name="sphere_link">
    <inertial>
      <inertia>
        <ixx>3</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>3</iyy>
        <iyz>0</iyz>
        <izz>3</izz>
      </inertia>
      <mass>3.0</mass>
    </inertial>
    <collision name="sphere_collision">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
    </collision>
    <visual name="sphere_visual">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
      <material>
        <ambient>0 1 0 1</ambient>
        <diffuse>0 1 0 1</diffuse>
        <specular>0 1 0 1</specular>
      </material>
    </visual>
  </link>
</model>

<model name="sphere_blue">
  <pose>-30 30 10 0 0 0</pose>
  <link name="sphere_link">
    <inertial>
      <inertia>
        <ixx>3</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>3</iyy>
        <iyz>0</iyz>
        <izz>3</izz>
      </inertia>
      <mass>3.0</mass>
    </inertial>
    <collision name="sphere_collision">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
    </collision>
    <visual name="sphere_visual">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
      <material>
        <ambient>0 0 1 1</ambient>
        <diffuse>0 0 1 1</diffuse>
        <specular>0 0 1 1</specular>
      </material>
    </visual>
  </link>
</model>

<model name="sphere_yellow">
  <pose>-30 -30 20 0 0 0</pose>
  <link name="sphere_link">
    <inertial>
      <inertia>
        <ixx>3</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>3</iyy>
        <iyz>0</iyz>
        <izz>3</izz>
      </inertia>
      <mass>3.0</mass>
    </inertial ...
(more)
edit flag offensive delete link more
0

answered 2022-02-18 21:08:38 -0500

azeey gravatar image

They collide for me. You might be missing the ground plane. You can insert it into your world from Fuel:

<include>
  <uri>
    https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground Plane
  </uri>
</include>

image description

edit flag offensive delete link more

Comments

Thank you for help, but unfortunately I could see the same result(couldn't collide third one in my question). I modified the code based on the heightmap.sdf file. I uploaded my sdf file.

fonawork gravatar imagefonawork ( 2022-02-20 18:26:41 -0500 )edit

May I ask what's your Ignition Gazebo's version?

fonawork gravatar imagefonawork ( 2022-02-20 20:40:10 -0500 )edit

Could you help me to understand how to use plugins well? Where can I find list of plugins and example code?

fonawork gravatar imagefonawork ( 2022-02-20 22:38:36 -0500 )edit

This tutorial might be useful: https://ignitionrobotics.org/api/gaze.... I tested it on v6.5 and v5.3 and both worked.

Can you try removing <physics name="1ms" type="ignored"> <dart> <collision_detector>bullet</collision_detector> </dart> </physics> from your file?

azeey gravatar imageazeey ( 2022-02-22 13:21:10 -0500 )edit

This tutorial might be useful: https://ignitionrobotics.org/api/gaze.... I tested it on v6.5 and v5.3 and both worked.

Can you try removing <physics name="1ms" type="ignored"> <dart> <collision_detector>bullet</collision_detector> </dart> </physics> from your file?

azeey gravatar imageazeey ( 2022-02-22 13:21:27 -0500 )edit

After changing physics as you mentioned, it works well. Thank you!

fonawork gravatar imagefonawork ( 2022-02-24 19:19:21 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-18 03:32:43 -0500

Seen: 161 times

Last updated: Feb 20 '22