小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
rviz不显示模型
-
@小鱼 ```
code_text<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578 For more information, please see http://wiki.ros.org/sw_urdf_exporter --> <robot name="aubo"> <link name="base_link"> <inertial> <origin xyz="-6.0857E-09 -0.0015966 0.01627" rpy="0 0 0" /> <mass value="0.56333" /> <inertia ixx="0.001111" ixy="-1.2418E-10" ixz="-5.7439E-11" iyy="0.0011191" iyz="1.2673E-05" izz="0.0020623" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/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://aubo/meshes/base_link.STL" /> </geometry> </collision> </link> <link name="link1"> <inertial> <origin xyz="0.0053837 0.00010866 0.069118" rpy="0 0 0" /> <mass value="1.5659" /> <inertia ixx="0.0032825" ixy="-2.3687E-06" ixz="-0.00026872" iyy="0.0033973" iyz="-5.451E-06" izz="0.0030453" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/link1.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://aubo/meshes/link1.STL" /> </geometry> </collision> </link> <joint name="joint1" type="revolute"> <origin xyz="0 0 0.0432" rpy="0 0 0" /> <parent link="base_link" /> <child link="link1" /> <axis xyz="0 0 1" /> <limit lower="-3.14" upper="3.14" effort="100" velocity="1" /> </joint> <link name="link2"> <inertial> <origin xyz="0.140798896349632 0.147620000724082 -0.0717987797061451" rpy="0 0 0" /> <mass value="4.02044364887504" /> <inertia ixx="0.0136206066525712" ixy="-0.00542918983122672" ixz="-1.5555952332762E-06" iyy="0.0131079089149848" iyz="1.49124830122163E-06" izz="0.0180953643939597" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/link2.STL" /> </geometry> <material name=""> <color rgba="0 0 0 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/link2.STL" /> </geometry> </collision> </link> <joint name="joint2" type="revolute"> <origin xyz="0.061987 0.001257 0.0785" rpy="1.5708 0 -1.5505" /> <parent link="link1" /> <child link="link2" /> <axis xyz="0 0 -1" /> <limit lower="-3.14" upper="3.14" effort="100" velocity="1" /> </joint> <link name="lint3"> <inertial> <origin xyz="-0.167222206882162 0.0776421930307443 0.0442680503335889" rpy="0 0 0" /> <mass value="2.21771793940257" /> <inertia ixx="0.00558326602644924" ixy="0.00790320834744581" ixz="0.000848241191882279" iyy="0.0189679461855047" iyz="-0.000386287109449977" izz="0.0225484350816382" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/lint3.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://aubo/meshes/lint3.STL" /> </geometry> </collision> </link> <joint name="joint3" type="revolute"> <origin xyz="0.28189 0.29497 -0.0070013" rpy="0.0034217 0.0050871 -0.16953" /> <parent link="link2" /> <child link="lint3" /> <axis xyz="0 0 1" /> <limit lower="-3.14" upper="3.14" effort="100" velocity="1" /> </joint> <link name="link4"> <inertial> <origin xyz="-0.038368 0.019705 -0.012782" rpy="0 0 0" /> <mass value="0.46845" /> <inertia ixx="0.00048415" ixy="3.6267E-05" ixz="1.0082E-05" iyy="0.00039727" iyz="-4.0713E-05" izz="0.00048443" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/link4.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://aubo/meshes/link4.STL" /> </geometry> </collision> </link> <joint name="joint4" type="fixed"> <origin xyz="-0.34015 0.1605 -0.0044386" rpy="-0.60887 -1.1061 1.802" /> <parent link="lint3" /> <child link="link4" /> <axis xyz="0 0 0" /> <limit lower="-3.14" upper="3.14" effort="100" velocity="1" /> </joint> <link name="link5"> <inertial> <origin xyz="0.0438157167731668 -0.00824035163864095 0.00600016109616114" rpy="0 0 0" /> <mass value="0.468456466798697" /> <inertia ixx="0.00047850207885934" ixy="3.34417913985168E-05" ixz="-2.43487756017809E-05" iyy="0.000425566713880223" iyz="5.61717864928479E-05" izz="0.000461780729854671" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/link5.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://aubo/meshes/link5.STL" /> </geometry> </collision> </link> <joint name="joint5" type="revolute"> <origin xyz="-0.042159 0.058503 0.0084459" rpy="-2.5479 -0.54644 1.5708" /> <parent link="link4" /> <child link="link5" /> <axis xyz="-1 0 0" /> <limit lower="-3.14" upper="3.14" effort="100" velocity="1" /> </joint> <link name="link6"> <inertial> <origin xyz="-0.020850298863243 0.000102383209233614 -0.000147796940094036" rpy="0 0 0" /> <mass value="0.137129803132374" /> <inertia ixx="9.79575253829952E-05" ixy="-1.60184123774453E-07" ixz="2.31236511443847E-07" iyy="6.11201831738136E-05" iyz="1.14238611370147E-06" izz="6.02624425957772E-05" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://aubo/meshes/link6.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://aubo/meshes/link6.STL" /> </geometry> </collision> </link> <joint name="joint6" type="continuous"> <origin xyz="0.048128 -0.043843 0.03216" rpy="3.1377 0.62946 1.5708" /> <parent link="link5" /> <child link="link6" /> <axis xyz="1 0 0" /> <limit lower="-3.14" upper="3.14" effort="100" velocity="1" /> </joint> </robot>
-
@1464962484 尝试把模型的定位改成用file://而不是package
-
改完之后报错了,其实不光是我的不行用赵虚左老师的那个包里的stl文件也不出模型就是但是不用调用stl的那个小车就有模型出来。 这是按着教程走的不出模型
-
@1464962484 file定位要使用绝对目录
-
此回复已被删除! -
-
@1464962484 看提示说打不开,确认一下
- 文件目录是否正确
- 文件是否正常(STL是否损坏,可以在windows下使用3D打开看看是否正常)
-
@小鱼 stl文件都可以正常打开我不太清楚根目录加不加Ubuntu20.04,这个stl是赵老师那个包里的我也不出模型
-
@1464962484 确实是有问题的,文件定位请使用三个///
eg:file:///home/xxx/xxx.STL
-
@小鱼 加了///也不行,这个wsl2的根目录是在C盘吗,它是自动挂载出来的吧。这个跟wsl没有关系吧
-
@1464962484 在 rviz不显示模型 中说:
它是自动挂载出来的吧。这个跟wsl没有关系吧
感觉你的目录还是错的,文件路径里,都没有看到src。请你再次确认目录是否正确,最好提供一下对应文件夹下的ls和pwd指令结果。
-
@小鱼 没错确实是我路径打错了现在没有报错了,跟package一样了
-
@1464962484 目前猜测有可能是你是用WSL造成。尝试在虚拟机是用相同代码尝试。另外你是是用XServer方式进行的可视化吗?
-
@小鱼 不是用的可视化是用vscode连接Ubuntu和gui,没有用可视化
-
@1464962484 可视化指的是你将WSL里的应用如何在Windows上显示。如果是采用vscode的remote插件估计就是套壳走的X协议。
-
@小鱼 小鱼我在vm装的Ubuntu18可以看见模型,我要是给wsl2装个远程连接或者退回到Ubuntu18版本会不会好用,主要是开了vm后笔记本有点卡
-
@1464962484 可以试一试Xserver的方式进行可视化
-
@小鱼 通过ssh远程连接吗
-
@1464962484 x协议不用通过ssh,你搜一下
-
@小鱼 是安装这个xlaunch,然后安装一个Ubuntu桌面吗