Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Drone can’t stay in a closed tunnel shape like a doughnut #4672

Open
AI4IS opened this issue Nov 20, 2024 · 2 comments
Open

Bug: Drone can’t stay in a closed tunnel shape like a doughnut #4672

AI4IS opened this issue Nov 20, 2024 · 2 comments

Comments

@AI4IS
Copy link

AI4IS commented Nov 20, 2024

Hi there,
I created a tunnel model (.stl) that is hollow inside. I import it into urdf. I set the collision attribute same as vision attribute (both that stl file) but the drone just can’t stay inside the tunnel and bounce away. If I comment collision attribute of tunnel and set mass to zero, the drone can stay inside. So I guess pybullet can’t deal with hollow objects’ collision. Is there anyone figure it out? I need your help, plz

Tunnel urdf here:

<?xml version="1.0"?>
<robot name="tubehigh">
    <link name="tube">
        <visual>
            <geometry>
                <mesh filename="tunnel3.stl" scale="1 1 1"/>
            </geometry>
            <material name="red">
                <color rgba="1.0 0.0 0.0 1.0"/>
            </material>
        </visual>
        <collision>
            <geometry>
                <mesh filename="tunnel3.stl" scale="1 1 1"/>
            </geometry>
        </collision>
        <inertial>
            <mass value="1.0"/>
            <inertia ixx="0 " ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
        </inertial>
    </link>
</robot>

Drone urdf here:

<?xml version="1.0" ?>

<robot name="cf2">

  <properties arm="0.0397" kf="3.16e-10" km="7.94e-12" thrust2weight="2.25" max_speed_kmh="30" gnd_eff_coeff="11.36859" prop_radius="2.31348e-2" drag_coeff_xy="9.1785e-7" drag_coeff_z="10.311e-7" dw_coeff_1="2267.18" dw_coeff_2=".16" dw_coeff_3="-.11" />

  <link name="base_link"> 

    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0.027"/>
      <inertia ixx="1.4e-5" ixy="0.0" ixz="0.0" iyy="1.4e-5" iyz="0.0" izz="2.17e-5"/>
    </inertial>

    <!-- links>
      <carlos url="https://arxiv.org/pdf/1608.05786.pdf" />
      <julian url="https://www.research-collection.ethz.ch/handle/20.500.11850/214143" />
      <mit url="http://groups.csail.mit.edu/robotics-center/public_papers/Landry15.pdf" />
    </links -->

    <visual>
      <origin rpy="0 0 55" xyz="0 0 0"/>
      <geometry>
        <mesh filename="./cf2.dae" scale=" 1 1 1"/>
      </geometry> 
      <material name="grey">
        <color rgba=".5 .5 .5 1"/>
      </material> 
    </visual>

    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder radius=".06" length=".025"/>
      </geometry>
    </collision>  

  </link>

  <link name="prop0_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.028 -0.028 0"/>
      <mass value="0"/>
      <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial>
  </link>
  <joint name="prop0_joint" type="fixed">
    <parent link="base_link"/>
    <child link="prop0_link"/>
  </joint>

  <link name="prop1_link">
    <inertial>
      <origin rpy="0 0 0" xyz="-0.028 -0.028 0"/>
      <mass value="0"/>
      <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial>
  </link>
  <joint name="prop1_joint" type="fixed">
    <parent link="base_link"/>
    <child link="prop1_link"/>
  </joint>

  <link name="prop2_link">
    <inertial>
      <origin rpy="0 0 0" xyz="-0.028 0.028 0"/>
      <mass value="0"/>
      <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial>
  </link>
  <joint name="prop2_joint" type="fixed">
    <parent link="base_link"/>
    <child link="prop2_link"/>
  </joint>

  <link name="prop3_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.028 0.028 0"/>
      <mass value="0"/>
      <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial>
  </link>
  <joint name="prop3_joint" type="fixed">
    <parent link="base_link"/>
    <child link="prop3_link"/>
  </joint>

  <link name="center_of_mass_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0"/>
      <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial>
  </link>
  <joint name="center_of_mass_joint" type="fixed">
    <parent link="base_link"/>
    <child link="center_of_mass_link"/>
  </joint>

</robot>
@AI4IS AI4IS closed this as completed Nov 20, 2024
@AI4IS AI4IS reopened this Nov 20, 2024
@AI4IS
Copy link
Author

AI4IS commented Nov 20, 2024

I use vhacd in pybullet, but it seems that vhacd can't decompose the object correctly for my doughnut, some part of it is not hollow.

@AI4IS
Copy link
Author

AI4IS commented Nov 20, 2024

assets.zip
These are my .obj and _vhacd.obj files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant