机器人URDF的车轮在“滚动”时会重置转向角

时间:2018-06-30 14:12:49

标签: ros robot

我目前正在尝试为我们的机器人创建基本的URDF模型(该模型基本上是经过改进的具有前转向+后轮驱动的机动踏板车,例如汽车),用于ROS /凉亭。

我设法使转向工作(“沿Z轴左右旋转车轮,直到触发阈值”)。现在,我假设我还需要使用“ continuous”类型的关节为所有车轮提供前进/后退驱动的能力。

不幸的是,这就是我现在停留的地方。 每次我转向,然后尝试更改“侧倾”参数时,转向位置都会重置为零。您可以在此模拟器中进行检查:http://www.mymodelrobot.appspot.com(需要将URDF代码设置为放在右侧,然后单击“加载机器人URDF”,然后可以在右上方更改参数)。我只试用了一个轮子(在URDF中为左前或“前链接”-有时我用德语写了名字)。

我真的不知道出了什么问题,我尝试了几次修改。您知道这里可能是什么问题吗?

这是URDF:

<?xml version="1.0"?>

<robot name="ben">

  <!-- * * * Link Definitions * * * -->

  <link name="basis_unten">
        <visual>
            <origin xyz="0 0 0.35" rpy="0 0 0"/>
            <geometry>
                <box size="1.70 0.66 0.50"/>
            </geometry>
            <material name="Cyan1">
                <color rgba="0.0 0.9 0.9 0.9"/>
            </material>
        </visual>   
        <collision>
            <geometry>
            <box size="2.70 0.88 0.50"/>
            </geometry>
        </collision>
    </link>

    <link name="basis_oben">
        <visual>
            <origin xyz="-0.1 0 0.84" rpy="0 0 0"/>
            <geometry>
                <box size="1.50 0.66 0.68"/>
            </geometry>
            <material name="Cyan1">
                <color rgba="0.0 0.9 0.9 0.9"/>
            </material>
        </visual>
        <collision>
            <geometry>
            <box size="2.50 0.88 0.68"/>
            </geometry>
        </collision>    
    </link>

   <link name="reifen_front_links">
        <visual>
            <origin xyz="0 0 0" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.155"/>
            </geometry>
            <material name="reifenfarbe">
                <color rgba="0 0 0 1.0"/>
            </material>
        </visual>   
    </link>

    <link name="reifen_front_rechts">
        <visual>
            <origin xyz="0 0 0" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.155"/>
            </geometry>
            <material name="reifenfarbe">
                <color rgba="0 0 0 1.0"/>
            </material>
        </visual>   
    </link>

    <link name="reifen_back_links">
        <visual>
            <origin xyz="-0.6 0.29 0.155" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.155"/>
            </geometry>
            <material name="reifenfarbe">
                <color rgba="0 0 0 1.0"/>
            </material>
        </visual>   
    </link>

    <link name="reifen_back_rechts">
        <visual>
            <origin xyz="-0.6 -0.29 0.155" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.155"/>
            </geometry>
            <material name="reifenfarbe">
                <color rgba="0 0 0 1.0"/>
            </material>
        </visual>   
    </link>

    <link name="lidar">
    <visual>
      <geometry>
        <cylinder length ="0.041" radius="0.03625"/>
      </geometry>
      <material name="lidarfarbe">
        <color rgba="0.1 0 0 1"/>

      </material>
      <origin rpy="0 0.785 0" xyz="0.8 0 1.16"/>
    </visual>
  </link>

<link name="kamera_vorne">
    <visual>
      <geometry>
        <box size="0.02 0.15 0.03"/>
      </geometry>
      <material name="kamerafarbe">
        <color rgba="0 0 1 1"/>
      </material>
      <origin rpy="0 0 0" xyz="0.77 0 1.01"/>
    </visual>
  </link>

<link name="kamera_links">
        <visual>
            <origin xyz="0.50 0.29 1.05" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.02"/>
            </geometry>
            <material name="kamerafarbe">
                <color rgba="0 0 1 1"/>
            </material>
        </visual>   
    </link>

<link name="kamera_rechts">
        <visual>
            <origin xyz="0.50 -0.29 1.05" rpy="-1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.02"/>
            </geometry>
            <material name="kamerafarbe">
                <color rgba="0 0 1 1"/>
            </material>
        </visual>   
    </link>

<link name="kamera_back">
        <visual>
            <origin xyz="-0.85 0 1.11" rpy="0 -1.57 0"/>
            <geometry>
                <cylinder length ="0.04" radius="0.02"/>
            </geometry>
            <material name="kamerafarbe">
                <color rgba="0 0 1 1"/>
            </material>
        </visual>   
    </link>

    <link name="ultrasonic_front_links">
        <visual>
            <origin xyz="0.75 0.29 0.5" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<link name="ultrasonic_front_rechts">
        <visual>
            <origin xyz="0.75 -0.29 0.5" rpy="-1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

    <link name="ultrasonic_back_links">
        <visual>
            <origin xyz="-0.75 0.29 0.5" rpy="1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

    <link name="ultrasonic_back_rechts">
        <visual>
            <origin xyz="-0.75 -0.29 0.5" rpy="-1.57075 0 0"/>
            <geometry>
                <cylinder length ="0.10" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<link name="ultrasonic_fresseobenl">
        <visual>
            <origin xyz="0.85 0.045 0.77" rpy="0 1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<link name="ultrasonic_fresseobenr">
        <visual>
            <origin xyz="0.85 -0.045 0.77" rpy="0 1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>


<link name="ultrasonic_fresseuntenl">
        <visual>
            <origin xyz="0.85 0.23 0.42" rpy="0 1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<link name="ultrasonic_fresseuntenr">
        <visual>
            <origin xyz="0.85 -0.23 0.42" rpy="0 1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>




<link name="ultrasonic_rueckenoben">
        <visual>
            <origin xyz="-0.85 0 0.77" rpy="0 -1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>



<link name="ultrasonic_rueckenuntenl">
        <visual>
            <origin xyz="-0.85 0.27 0.42" rpy="0 -1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<link name="ultrasonic_rueckenuntenm">
        <visual>
            <origin xyz="-0.85 0 0.42" rpy="0 -1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<link name="ultrasonic_rueckenuntenr">
        <visual>
            <origin xyz="-0.85 -0.27 0.42" rpy="0 -1.57 0"/>
            <geometry>
                <cylinder length ="0.02" radius="0.02"/>
            </geometry>
            <material name="sensorfarbe">
                <color rgba="1 0 0 1"/>
            </material>
        </visual>   
    </link>

<joint name="reifenlinks_joint" type="revolute">
        <parent link="basis_unten"/>
        <child link="reifen_front_links"/>
        <origin xyz="0.46 0.29 0.155" rpy="0 0 0"/>
        <axis xyz="0 0 1"/>
        <limit lower="-0.35" upper="0.35" effort="10" velocity="3"/>
    </joint>

<joint name="reifenrechts_joint" type="revolute">
        <parent link="basis_unten"/>
        <child link="reifen_front_rechts"/>
        <origin xyz="0.46 -0.29 0.155" rpy="0 0 0"/>
        <axis xyz="0 0 1"/>
        <limit lower="-0.35" upper="0.35" effort="10" velocity="3"/>
    </joint>

<link name="right_front_steering">
    <visual>
      <geometry>
        <box size ="0.01 0.01 0.01"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
  </link>

  <joint name="right_front_steering_to_right_front_wheel" type="continuous">
    <parent link="right_front_steering"/>
    <child link="reifen_front_links"/>
    <origin xyz="0.46 0.29 0.155"/>
    <axis   xyz="0 1 0"/>
  </joint>
</robot>

1 个答案:

答案 0 :(得分:0)

我从头开始完全重建了URDF文件,因为它很混乱(偶然遇到其他问题),现在可以正常工作了。

以下是新的URDF供参考:

foreach($relations as $relation){
    $relation->user->name; //get the name of the related user
}