URDF 在 RVIZ 中加载不正确,但在 Gazebo 中加载正确,这是什么问题?

URDF loading incorrectly in RVIZ but correctly on Gazebo, what is the issue?

我使用 SW2URDF 插件从 Solidworks 导入了一个 urdf 模型。该模型在 Gazebo 上正确加载但在 RVIZ 上看起来很奇怪,即使在尝试远程操作机器人时,机械手的旋转关节移动而不是轮子。有没有人以前遇到过这个问题或有解决方案? 这是它在 Gazebo 上的样子

这是它在 RVIZ 上的样子

这是模型的 URDF 文件:

<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) 
     Commit Version: 1.6.0-1-g15f4949  Build Version: 1.6.7594.29634
     For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
  name="final_assembly3">
  <link name="world" />
  <joint name="fixed" type="fixed">
     <parent link="world" />
     <child link="base_link" />
  </joint>

  <link
    name="base_link">
    <inertial>
      <origin
        xyz="0.14768 0.23303 0.22798"
        rpy="0 0 0" />
      <mass
        value="7.6442" />
      <inertia
        ixx="0.075629"
        ixy="3.85E-09"
        ixz="-9.5343E-08"
        iyy="0.14294"
        iyz="1.6837E-11"
        izz="0.081345" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>
  <link
    name="Wheel 1">
    <inertial>
      <origin
        xyz="-3.2558E-07 1.0722E-07 0.030838"
        rpy="0 0 0" />
      <mass
        value="0.5000" />
      <inertia
        ixx="0.00072916667"
        ixy="0.0000000"
        ixz="0.0000000"
        iyy="0.000625"
        iyz="0.0000000"
        izz="0.00072916667" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.89804 0.91765 0.92941 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 1.STL" />
      </geometry>
    </collision>
    <gravity>0</gravity> 
  </link>
  <joint
    name="Cont 1"
    type="continuous">
    <origin
      xyz="-0.0034084 -0.12798 0.10053"
      rpy="-1.5708 0 1.5708" />
    <parent
      link="base_link" />
    <child
      link="Wheel 1" />
    <axis
      xyz="0 0 1" />
  </joint>
  <link
    name="Wheel 2">
    <inertial>
      <origin
        xyz="-3.2557837015279E-07 1.07217308559227E-07 0.0308380289896838"
        rpy="0 0 0" />
      <mass
        value="0.5000" />
      <inertia
        ixx="0.00072916667"
        ixy="0.0000000"
        ixz="0.0000000"
        iyy="0.000625"
        iyz="0.0000000"
        izz="0.00072916667" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.898039215686275 0.917647058823529 0.929411764705882 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 2.STL" />
      </geometry>
    </collision>
   <gravity>0</gravity> 
  </link>
  <joint
    name="Cont 2"
    type="continuous">
    <origin
      xyz="0.29877 -0.32798 0.10053"
      rpy="1.5708 0 1.5708" />
    <parent
      link="base_link" />
    <child
      link="Wheel 2" />
    <axis
      xyz="0 0 1" />
  </joint>
  <link
    name="Wheel 3">
    <inertial>
      <origin
        xyz="-3.26336083100731E-07 1.07668861937249E-07 -0.0308380347831287"
        rpy="0 0 0" />
      <mass
        value="0.5000" />
      <inertia
        ixx="0.00072916667"
        ixy="0.0000000"
        ixz="0.0000000"
        iyy="0.000625"
        iyz="0.0000000"
        izz="0.00072916667" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 3.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.898039215686275 0.917647058823529 0.929411764705882 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 3.STL" />
      </geometry>
    </collision>
    <gravity>0</gravity> 
  </link>
  <joint
    name="Cont 3"
    type="continuous">
    <origin
      xyz="-0.0034084 -0.32798 0.10053"
      rpy="1.5708 0 1.5708" />
    <parent
      link="base_link" />
    <child
      link="Wheel 3" />
    <axis
      xyz="0 0 1" />
  </joint>
  <link
    name="Wheel 4">
    <inertial>
      <origin
        xyz="-3.26299866348911E-07 1.07652009542769E-07 0.0291707139063403"
        rpy="0 0 0" />
      <mass
        value="0.5000" />
      <inertia
        ixx="0.00072916667"
        ixy="0.0000000"
        ixz="0.0000000"
        iyy="0.000625"
        iyz="0.0000000"
        izz="0.00072916667" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 4.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.898039215686275 0.917647058823529 0.929411764705882 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Wheel 4.STL" />
      </geometry>
    </collision>
    <gravity>0</gravity> 
  </link>
  <joint
    name="Cont 4"
    type="continuous">
    <origin
      xyz="0.30046 -0.12798 0.10053"
      rpy="1.5708 0.62487 1.5708" />
    <parent
      link="base_link" />
    <child
      link="Wheel 4" />
    <axis
      xyz="0 0 1" />
  </joint>
  <gazebo>
    <plugin name="object_controller" filename="libgazebo_ros_planar_move.so">
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <odometryRate>50.0</odometryRate>
      <robotBaseFrame>base_footprint</robotBaseFrame>
    </plugin>
  </gazebo>
  <link
    name="New Static Link">
    <inertial>
      <origin
        xyz="0.0172790917411035 0.102994908792773 -0.000286417787769305"
        rpy="0 0 0" />
      <mass
        value="1.94401355435528" />
      <inertia
        ixx="0.00768941377852196"
        ixy="-0.0023016367314421"
        ixz="2.28881904576314E-05"
        iyy="0.00450259485431559"
        iyz="3.78227208152756E-05"
        izz="0.0103483641272583" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/New Static Link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/New Static Link.STL" />
      </geometry>
    </collision>
    <gravity>0</gravity> 
  </link>
  <joint
    name="Fixed"
    type="fixed">
    <origin
      xyz="0.14768 -0.22798 0.33053"
      rpy="1.5708 0 -1.581" />
    <parent
      link="base_link" />
    <child
      link="New Static Link" />
    <axis
      xyz="0 1 0" />
  </joint>
  <link
    name="Arm">
    <inertial>
      <origin
        xyz="0.13229755761114 -0.000278839398755615 -0.0323012411261709"
        rpy="0 0 0" />
      <mass
        value="1.80462691606488" />
      <inertia
        ixx="0.00337104522287667"
        ixy="2.3173417802539E-05"
        ixz="-0.000161183912931026"
        iyy="0.0199987994056373"
        iyz="-1.64319461670501E-06"
        izz="0.0222082055539029" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Arm.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Arm.STL" />
      </geometry>
    </collision>
    <gravity>0</gravity> 
  </link>
  <joint
    name="Rev1"
    type="revolute">
    <origin
      xyz="0.06 0.18 -0.030782"
      rpy="0 0 0.18829" />
    <parent
      link="New Static Link" />
    <child
      link="Arm" />
    <axis
      xyz="0 0 1" />
    <limit
      lower="0"
      upper="0"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="Pris 1">
    <inertial>
      <origin
        xyz="0.0335816493728636 1.71749397870347E-07 0.0119354658625156"
        rpy="0 0 0" />
      <mass
        value="0.123182781546625" />
      <inertia
        ixx="3.77360992389157E-05"
        ixy="1.28183032967861E-11"
        ixz="-5.81374538385023E-06"
        iyy="0.000122947375330809"
        iyz="2.65123689114698E-10"
        izz="0.000144337931781889" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Pris 1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Pris 1.STL" />
      </geometry>
    </collision>
    <gravity>0</gravity> 
  </link>
  <joint
    name="Pris 1"
    type="revolute">
    <origin
      xyz="0.1 0 -0.063391"
      rpy="3.1416 0 -1.9477" />
    <parent
      link="Arm" />
    <child
      link="Pris 1" />
    <axis
      xyz="0 0 1" />
    <limit
      lower="0"
      upper="0"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="Pris 2">
    <inertial>
      <origin
        xyz="1.8466057571942E-09 -5.55111512312578E-17 0.01"
        rpy="0 0 0" />
      <mass
        value="0.260668670250234" />
      <inertia
        ixx="7.94869252643328E-05"
        ixy="-2.07014852308951E-18"
        ixz="2.73993982613085E-18"
        iyy="0.00115947637560852"
        iyz="1.99348984198689E-09"
        izz="0.00122317832768109" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Pris 2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Pris 2.STL" />
      </geometry>
    </collision>
   <gravity>0</gravity> 
  </link>
  <joint
    name="Pris 2"
    type="revolute">
    <origin
      xyz="-0.0014893 -0.078861 0.020827"
      rpy="0 0 0.90855" />
    <parent
      link="Pris 1" />
    <child
      link="Pris 2" />
    <axis
      xyz="0 0 0" />
    <limit
      lower="0"
      upper="0"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="Pris 3">
    <inertial>
      <origin
        xyz="-0.166565243027124 0.000967072198009372 0.0300000329001753"
        rpy="0 0 0" />
      <mass
        value="0.449710314809642" />
      <inertia
        ixx="0.00137456804218307"
        ixy="-4.43060167581936E-05"
        ixz="9.82391747567394E-10"
        iyy="0.002208699287522"
        iyz="-1.54947639651244E-09"
        izz="0.00315643719811711" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Pris 3.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://final_assembly3/meshes/Pris 3.STL" />
      </geometry>
    </collision>
   <gravity>0</gravity> 
  </link>
  <joint
    name="Pris 3"
    type="prismatic">
    <origin
      xyz="0.20514 0.030503 -0.039218"
      rpy="-1.5708 0 3.1416" />
    <parent
      link="Arm" />
    <child
      link="Pris 3" />
    <axis
      xyz="1 0 0" />
    <limit
      lower="0"
      upper="0"
      effort="0"
      velocity="0" />
  </joint>
  
</robot>

ROS version:ROS旋律

Ubuntu 18.04

所以,我意识到两个问题:

首先,你必须在RViz的全局选项中将固定框架更改为world或提供mapworld之间的转换。

其次,您的 URDF 似乎已损坏。你的 revolute 类型的关节有问题。将它们的类型更改为 fixed 解决了这个问题。我认为,关于第二个问题,您最好单独提出 minimal example 问题。