机器人 URDF 的轮子 "rolls" 时重置转向角
Wheel of robot URDF resets steering angle when it "rolls"
我目前正在尝试为我们的机器人创建一个基本的 URDF 模型(它基本上是一个改进的机动踏板车,具有前转向 + 后轮驱动,就像汽车一样)以用于 ROS / Gazebo。
我设法使转向正常工作 ("turning the wheel left or right along the Z axis, until a threshold is triggered")。现在我假设我还需要使用类型为 "continuous".
的关节为所有轮子提供向前和向后 drive/roll 的能力
不幸的是,这就是我现在被困的地方。 每次我转向,然后尝试更改 "roll" 参数时,转向位置重置为零。 您可以在此模拟器中查看:http://www.mymodelrobot.appspot.com( URDF代码需要放在右边,然后点击"Load robot URDF",就可以在右上角修改参数了)。我只在一个轮子上试过(左前或 URDF 中的 "links front" - 我有时会用德语写名字)。
真不知道是什么问题,试了几次修改。你知道这里的问题是什么吗?
这是 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>
我从头开始完全重建了 URDF 文件,因为它非常混乱(无意中遇到了其他问题),现在它可以工作了。
这里是新的 URDF 供参考:
<?xml version="1.0"?>
<robot name="ben">
<!-- * * * Link Definitions * * * -->
<!-- * * * Basis * * * -->
<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.50 0.96 0.50"/>
</geometry>
</collision>
</link>
<link name="basis_oben">
<visual>
<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.96 0.68"/>
</geometry>
</collision>
</link>
<!-- * * * Reifen * * * -->
<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>
<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>
<geometry>
<cylinder length ="0.10" radius="0.155"/>
</geometry>
<material name="reifenfarbe">
<color rgba="0 0 0 1.0"/>
</material>
</visual>
</link>
<!-- * * * Sensorik * * * -->
<link name="lidar">
<visual>
<geometry>
<cylinder length ="0.041" radius="0.03625"/>
</geometry>
<material name="lidarfarbe">
<color rgba="0.1 0 0 1"/>
</material>
</visual>
</link>
<link name="zed_left_camera">
<visual>
<origin xyz="0 0 0" rpy="0 1.57 0"/>
<geometry>
<cylinder radius="0.007" length=".031"/>
</geometry>
<material name="dark_grey">
<color rgba="0.1 0.1 0.1 1"/>
</material>
</visual>
</link>
<link name="zed_center">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.02 0.15 0.03"/>
</geometry>
<material name="kamerafarbe">
<color rgba="0 0 1 1"/>
</material>
</visual>
</link>
<link name="zed_right_camera">
<visual>
<origin xyz="0 0 0" rpy="0 1.57 0"/>
<geometry>
<cylinder radius="0.007" length=".031"/>
</geometry>
<material name="dark_grey">
<color rgba="0.1 0.1 0.1 1"/>
</material>
</visual>
</link>
<link name="zed_depth_camera" />
<link name="kamera_links">
<visual>
<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>
<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>
<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>
<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>
<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>
<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>
<geometry>
<cylinder length ="0.10" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtobenl">
<visual>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtobenr">
<visual>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtuntenl">
<visual>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtuntenr">
<visual>
<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>
<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>
<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>
<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>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<!-- * * * JOINT DEFINITIONS * * * -->
<!-- * * * Basis * * * -->
<joint name="basis_zu_basis_oben" type="fixed">
<origin xyz="-0.1 0 0.84" rpy="0 0 0"/>
<parent link="basis_unten"/>
<child link="basis_oben"/>
</joint>
<!-- * * * Reifen Links * * * -->
<joint name="basis_zu_links_front_steering" type="revolute">
<parent link="basis_unten"/>
<child link="links_front_steering"/>
<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="links_front_steering">
<visual>
<geometry>
<box size =".001 .001 .001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
</link>
<joint name="links_front_steering_to_reifen_front_links" type="continuous">
<parent link="links_front_steering"/>
<child link="reifen_front_links"/>
<origin xyz="0.0 0.0 0.0"/>
<axis xyz="0 1 0"/>
</joint>
<!-- * * * Reifen Rechts * * * -->
<joint name="basis_zu_rechts_front_steering" type="revolute">
<parent link="basis_unten"/>
<child link="rechts_front_steering"/>
<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="rechts_front_steering">
<visual>
<geometry>
<box size =".001 .001 .001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
</link>
<joint name="rechts_front_steering_to_reifen_front_rechts" type="continuous">
<parent link="rechts_front_steering"/>
<child link="reifen_front_rechts"/>
<origin xyz="0.0 0.0 0.0"/>
<axis xyz="0 1 0"/>
</joint>
<!-- * * * Reifen hinten * * * -->
<joint name="basis_zu_reifen_back_links" type="continuous">
<parent link="basis_unten"/>
<child link="reifen_back_links"/>
<origin xyz="-0.6 0.29 0.155" rpy="1.57075 0 0"/>
<axis xyz="0 0 1"/>
</joint>
<joint name="basis_zu_reifen_back_rechts" type="continuous">
<parent link="basis_unten"/>
<child link="reifen_back_rechts"/>
<origin xyz="-0.6 -0.29 0.155" rpy="1.57075 0 0"/>
<axis xyz="0 0 1"/>
</joint>
<!-- * * * Sensorik * * * -->
<joint name="basis_zu_lidar" type="fixed">
<parent link="basis_unten"/>
<child link="lidar"/>
<origin rpy="0 0.75 0" xyz="0.75 0 1.15"/>
</joint>
<joint name="basis_zu_zed_center" type="fixed">
<parent link="basis_unten"/>
<child link="zed_center"/>
<origin rpy="0 0 0" xyz="0.77 0 1.01"/>
</joint>
<joint name="zed_left_camera_joint" type="fixed">
<parent link="zed_center"/>
<child link="zed_left_camera"/>
<origin xyz="0 0.06 0" rpy="0 0 0" />
</joint>
<joint name="zed_depth_camera_joint" type="fixed">
<parent link="zed_left_camera"/>
<child link="zed_depth_camera"/>
<origin xyz="0 0 0" rpy="-1.5707963267948966 0 -1.5707963267948966" />
</joint>
<joint name="zed_right_camera_joint" type="fixed">
<parent link="zed_center"/>
<child link="zed_right_camera"/>
<origin xyz="0 -0.06 0" rpy="0 0 0" />
</joint>
<joint name="basis_zu_kamera_links" type="fixed">
<parent link="basis_unten"/>
<child link="kamera_links"/>
<origin xyz="0.50 0.29 1.05" rpy="1.57075 0 0"/>
</joint>
<joint name="basis_zu_kamera_rechts" type="fixed">
<parent link="basis_unten"/>
<child link="kamera_rechts"/>
<origin xyz="0.50 -0.29 1.05" rpy="-1.57075 0 0"/>
</joint>
<joint name="basis_zu_kamera_back" type="fixed">
<parent link="basis_unten"/>
<child link="kamera_back"/>
<origin xyz="-0.85 0 1.11" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_front_links" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_front_links"/>
<origin xyz="0.75 0.29 0.5" rpy="1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_front_rechts" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_front_rechts"/>
<origin xyz="0.75 -0.29 0.5" rpy="-1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_back_links" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_back_links"/>
<origin xyz="-0.75 0.29 0.5" rpy="1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_back_rechts" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_back_rechts"/>
<origin xyz="-0.75 -0.29 0.5" rpy="-1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtobenl" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtobenl"/>
<origin xyz="0.85 0.045 0.77" rpy="1.57 1.82 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtobenr" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtobenr"/>
<origin xyz="0.85 -0.045 0.77" rpy="1.57 1.32 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtuntenl" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtuntenl"/>
<origin xyz="0.85 0.23 0.42" rpy="1.57 1.80 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtuntenr" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtuntenr"/>
<origin xyz="0.85 -0.23 0.42" rpy="1.57 1.34 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenoben" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenoben"/>
<origin xyz="-0.85 0 0.77" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenuntenl" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenuntenl"/>
<origin xyz="-0.85 0.27 0.42" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenuntenm" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenuntenm"/>
<origin xyz="-0.85 0 0.42" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenuntenr" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenuntenr"/>
<origin xyz="-0.85 -0.27 0.42" rpy="0 -1.57 0"/>
</joint>
</robot>
我目前正在尝试为我们的机器人创建一个基本的 URDF 模型(它基本上是一个改进的机动踏板车,具有前转向 + 后轮驱动,就像汽车一样)以用于 ROS / Gazebo。
我设法使转向正常工作 ("turning the wheel left or right along the Z axis, until a threshold is triggered")。现在我假设我还需要使用类型为 "continuous".
的关节为所有轮子提供向前和向后 drive/roll 的能力不幸的是,这就是我现在被困的地方。 每次我转向,然后尝试更改 "roll" 参数时,转向位置重置为零。 您可以在此模拟器中查看:http://www.mymodelrobot.appspot.com( URDF代码需要放在右边,然后点击"Load robot URDF",就可以在右上角修改参数了)。我只在一个轮子上试过(左前或 URDF 中的 "links front" - 我有时会用德语写名字)。
真不知道是什么问题,试了几次修改。你知道这里的问题是什么吗?
这是 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>
我从头开始完全重建了 URDF 文件,因为它非常混乱(无意中遇到了其他问题),现在它可以工作了。
这里是新的 URDF 供参考:
<?xml version="1.0"?>
<robot name="ben">
<!-- * * * Link Definitions * * * -->
<!-- * * * Basis * * * -->
<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.50 0.96 0.50"/>
</geometry>
</collision>
</link>
<link name="basis_oben">
<visual>
<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.96 0.68"/>
</geometry>
</collision>
</link>
<!-- * * * Reifen * * * -->
<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>
<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>
<geometry>
<cylinder length ="0.10" radius="0.155"/>
</geometry>
<material name="reifenfarbe">
<color rgba="0 0 0 1.0"/>
</material>
</visual>
</link>
<!-- * * * Sensorik * * * -->
<link name="lidar">
<visual>
<geometry>
<cylinder length ="0.041" radius="0.03625"/>
</geometry>
<material name="lidarfarbe">
<color rgba="0.1 0 0 1"/>
</material>
</visual>
</link>
<link name="zed_left_camera">
<visual>
<origin xyz="0 0 0" rpy="0 1.57 0"/>
<geometry>
<cylinder radius="0.007" length=".031"/>
</geometry>
<material name="dark_grey">
<color rgba="0.1 0.1 0.1 1"/>
</material>
</visual>
</link>
<link name="zed_center">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.02 0.15 0.03"/>
</geometry>
<material name="kamerafarbe">
<color rgba="0 0 1 1"/>
</material>
</visual>
</link>
<link name="zed_right_camera">
<visual>
<origin xyz="0 0 0" rpy="0 1.57 0"/>
<geometry>
<cylinder radius="0.007" length=".031"/>
</geometry>
<material name="dark_grey">
<color rgba="0.1 0.1 0.1 1"/>
</material>
</visual>
</link>
<link name="zed_depth_camera" />
<link name="kamera_links">
<visual>
<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>
<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>
<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>
<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>
<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>
<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>
<geometry>
<cylinder length ="0.10" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtobenl">
<visual>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtobenr">
<visual>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtuntenl">
<visual>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<link name="ultrasonic_gesichtuntenr">
<visual>
<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>
<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>
<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>
<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>
<geometry>
<cylinder length ="0.02" radius="0.02"/>
</geometry>
<material name="sensorfarbe">
<color rgba="1 0 0 1"/>
</material>
</visual>
</link>
<!-- * * * JOINT DEFINITIONS * * * -->
<!-- * * * Basis * * * -->
<joint name="basis_zu_basis_oben" type="fixed">
<origin xyz="-0.1 0 0.84" rpy="0 0 0"/>
<parent link="basis_unten"/>
<child link="basis_oben"/>
</joint>
<!-- * * * Reifen Links * * * -->
<joint name="basis_zu_links_front_steering" type="revolute">
<parent link="basis_unten"/>
<child link="links_front_steering"/>
<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="links_front_steering">
<visual>
<geometry>
<box size =".001 .001 .001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
</link>
<joint name="links_front_steering_to_reifen_front_links" type="continuous">
<parent link="links_front_steering"/>
<child link="reifen_front_links"/>
<origin xyz="0.0 0.0 0.0"/>
<axis xyz="0 1 0"/>
</joint>
<!-- * * * Reifen Rechts * * * -->
<joint name="basis_zu_rechts_front_steering" type="revolute">
<parent link="basis_unten"/>
<child link="rechts_front_steering"/>
<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="rechts_front_steering">
<visual>
<geometry>
<box size =".001 .001 .001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
</link>
<joint name="rechts_front_steering_to_reifen_front_rechts" type="continuous">
<parent link="rechts_front_steering"/>
<child link="reifen_front_rechts"/>
<origin xyz="0.0 0.0 0.0"/>
<axis xyz="0 1 0"/>
</joint>
<!-- * * * Reifen hinten * * * -->
<joint name="basis_zu_reifen_back_links" type="continuous">
<parent link="basis_unten"/>
<child link="reifen_back_links"/>
<origin xyz="-0.6 0.29 0.155" rpy="1.57075 0 0"/>
<axis xyz="0 0 1"/>
</joint>
<joint name="basis_zu_reifen_back_rechts" type="continuous">
<parent link="basis_unten"/>
<child link="reifen_back_rechts"/>
<origin xyz="-0.6 -0.29 0.155" rpy="1.57075 0 0"/>
<axis xyz="0 0 1"/>
</joint>
<!-- * * * Sensorik * * * -->
<joint name="basis_zu_lidar" type="fixed">
<parent link="basis_unten"/>
<child link="lidar"/>
<origin rpy="0 0.75 0" xyz="0.75 0 1.15"/>
</joint>
<joint name="basis_zu_zed_center" type="fixed">
<parent link="basis_unten"/>
<child link="zed_center"/>
<origin rpy="0 0 0" xyz="0.77 0 1.01"/>
</joint>
<joint name="zed_left_camera_joint" type="fixed">
<parent link="zed_center"/>
<child link="zed_left_camera"/>
<origin xyz="0 0.06 0" rpy="0 0 0" />
</joint>
<joint name="zed_depth_camera_joint" type="fixed">
<parent link="zed_left_camera"/>
<child link="zed_depth_camera"/>
<origin xyz="0 0 0" rpy="-1.5707963267948966 0 -1.5707963267948966" />
</joint>
<joint name="zed_right_camera_joint" type="fixed">
<parent link="zed_center"/>
<child link="zed_right_camera"/>
<origin xyz="0 -0.06 0" rpy="0 0 0" />
</joint>
<joint name="basis_zu_kamera_links" type="fixed">
<parent link="basis_unten"/>
<child link="kamera_links"/>
<origin xyz="0.50 0.29 1.05" rpy="1.57075 0 0"/>
</joint>
<joint name="basis_zu_kamera_rechts" type="fixed">
<parent link="basis_unten"/>
<child link="kamera_rechts"/>
<origin xyz="0.50 -0.29 1.05" rpy="-1.57075 0 0"/>
</joint>
<joint name="basis_zu_kamera_back" type="fixed">
<parent link="basis_unten"/>
<child link="kamera_back"/>
<origin xyz="-0.85 0 1.11" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_front_links" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_front_links"/>
<origin xyz="0.75 0.29 0.5" rpy="1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_front_rechts" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_front_rechts"/>
<origin xyz="0.75 -0.29 0.5" rpy="-1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_back_links" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_back_links"/>
<origin xyz="-0.75 0.29 0.5" rpy="1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_back_rechts" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_back_rechts"/>
<origin xyz="-0.75 -0.29 0.5" rpy="-1.57075 0 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtobenl" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtobenl"/>
<origin xyz="0.85 0.045 0.77" rpy="1.57 1.82 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtobenr" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtobenr"/>
<origin xyz="0.85 -0.045 0.77" rpy="1.57 1.32 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtuntenl" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtuntenl"/>
<origin xyz="0.85 0.23 0.42" rpy="1.57 1.80 0"/>
</joint>
<joint name="basis_zu_ultrasonic_gesichtuntenr" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_gesichtuntenr"/>
<origin xyz="0.85 -0.23 0.42" rpy="1.57 1.34 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenoben" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenoben"/>
<origin xyz="-0.85 0 0.77" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenuntenl" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenuntenl"/>
<origin xyz="-0.85 0.27 0.42" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenuntenm" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenuntenm"/>
<origin xyz="-0.85 0 0.42" rpy="0 -1.57 0"/>
</joint>
<joint name="basis_zu_ultrasonic_rueckenuntenr" type="fixed">
<parent link="basis_unten"/>
<child link="ultrasonic_rueckenuntenr"/>
<origin xyz="-0.85 -0.27 0.42" rpy="0 -1.57 0"/>
</joint>
</robot>