sw2urdf导入Gazebo模型无法显示

5 篇文章 0 订阅
2 篇文章 0 订阅

环境
Windows7 x64下
solidworks 2016 x64 SP4.0
sw2urdf v1.3

Ubuntu 16.04 LTS下
ROS Kinetic
输入
sw2urdfpkg是你通过sw2urdf输出的包的名,由你自己定义。

roslaunch sw2urdfpkg gazebo.launch

报错
此时可以打开Gazebo,但无法显示导入模型。

... logging to /home/usrname/.ros/log/abb29d80-fdb4-11e8-9ebf-6c71d933f91d/roslaunch-usrname-xxxx.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://usrname-xxxxx:xxxxx/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    fake_joint_calibration (rostopic/rostopic)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    spawn_model (gazebo_ros/spawn_model)
    tf_footprint_base (tf/static_transform_publisher)

ROS_MASTER_URI=http://localhost:xxxxx

process[gazebo-1]: started with pid [3626]
process[gazebo_gui-2]: started with pid [3631]
process[tf_footprint_base-3]: started with pid [3636]
process[spawn_model-4]: started with pid [3637]
process[fake_joint_calibration-5]: started with pid [3659]
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/gazebo_ros/spawn_model", line 21, in <module>
    import rospy, sys, os, time
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/client.py", line 52, in <module>
    import roslib
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
    from roslib.launcher import load_manifest
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
    import rospkg
ImportError: No module named rospkg
[spawn_model-4] process has died [pid 3637, exit code 1, cmd /opt/ros/kinetic/lib/gazebo_ros/spawn_model -file /home/usrname/catkin_ws/src/rb08/urdf/rb08.urdf -urdf -model rb08 __name:=spawn_model __log:=/home/usrname/.ros/log/abb29d80-fdb4-11e8-9ebf-6c71d933f91d/spawn_model-4.log].
log file: /home/usrname/.ros/log/abb29d80-fdb4-11e8-9ebf-6c71d933f91d/spawn_model-4*.log
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/rostopic/rostopic", line 34, in <module>
    import rostopic
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 62, in <module>
    import roslib.message
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
    from roslib.launcher import load_manifest
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
    import rospkg
ImportError: No module named rospkg
[fake_joint_calibration-5] process has died [pid 3659, exit code 1, cmd /opt/ros/kinetic/lib/rostopic/rostopic pub /calibrated std_msgs/Bool true __name:=fake_joint_calibration __log:=/home/usrname/.ros/log/abb29d80-fdb4-11e8-9ebf-6c71d933f91d/fake_joint_calibration-5.log].
log file: /home/usrname/.ros/log/abb29d80-fdb4-11e8-9ebf-6c71d933f91d/fake_joint_calibration-5*.log
[ INFO] [1544581617.849852372]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1544581617.850870463]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1544581617.852468122]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1544581617.853356071]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1544581620.620868170, 0.023000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1544581620.622407126, 0.023000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1544581620.770631615, 0.168000000]: Physics dynamic reconfigure ready.
[ INFO] [1544581620.771296101, 0.169000000]: Physics dynamic reconfigure ready.

原因
缺少rospkg

输入

pip install rospkg

输出
安装rospkg,得到如下类似提示时表示安装成功

Successfully built rospkg catkin-pkg
Installing collected packages: argparse, catkin-pkg, rospkg
Successfully installed argparse-1.4.0 catkin-pkg-0.4.9 rospkg-1.1.7

再通过roslaunch打开对应.launch文件可顺利在Gazebo下打开模型。

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值