紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
gazebo显示不了fishbot机器人模型
-
3月份购买了两套fishbot小车,按照先学习理论的思路我先开始学习了《动手学ros》,在学习到了机器人仿真章节(第九章→”9.2为机器人URDF模型注入物理属性并在Gazebo中显示“→ 4. 将启动gazebo和生产fishbot写成launch文件,小节),
在利用launch文件自动导入fishbot小车模型文件时出现问题:,- 我在终端窗口执行完列表命令执行完命令,如下:
(base) rosmaster@ubuntu:~/fishbot_ws/src/fishbot_description$ ros2 launch fishbot_description gazebo.launch.py
之后,出现如下反馈提示:
gazebo2是启动了,但是界面空空如也。
终端反馈的原始信息下如:
[INFO] [launch]: All log files can be found below /home/rosmaster/.ros/log/2024-05-18-19-25-58-941896-ubuntu-3989 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [gazebo-1]: process started with pid [3991] [INFO] [spawn_entity.py-2]: process started with pid [3993] [spawn_entity.py-2] Traceback (most recent call last): [spawn_entity.py-2] File "/opt/ros/foxy/lib/gazebo_ros/spawn_entity.py", line 33, in <module> [spawn_entity.py-2] from rclpy.node import Node [spawn_entity.py-2] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py", line 42, in <module> [spawn_entity.py-2] from rclpy.client import Client [spawn_entity.py-2] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/client.py", line 22, in <module> [spawn_entity.py-2] from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy [spawn_entity.py-2] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/impl/implementation_singleton.py", line 31, in <module> [spawn_entity.py-2] rclpy_implementation = _import('._rclpy') [spawn_entity.py-2] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/impl/init.py", line 28, in _import [spawn_entity.py-2] return importlib.import_module(name, package='rclpy') [spawn_entity.py-2] File "/home/rosmaster/miniconda3/lib/python3.9/importlib/init.py", line 127, in import_module [spawn_entity.py-2] return _bootstrap._gcd_import(name[level:], package, level) [spawn_entity.py-2] ModuleNotFoundError: No module named 'rclpy._rclpy' [spawn_entity.py-2] The C extension '/opt/ros/foxy/lib/python3.8/site-packages/rclpy/_rclpy.cpython-39-x86_64-linux-gnu.so' isn't present on the system. Please refer to 'https://index.ros.org/doc/ros2/Troubleshooting/Installation-Troubleshooting/#import-failing-without-library-present-on-the-system' for possible solutions [ERROR] [spawn_entity.py-2]: process has died [pid 3993, exit code 1, cmd '/opt/ros/foxy/lib/gazebo_ros/spawn_entity.py -entity fishbot -file /home/rosmaster/fishbot_ws/src/fishbot_description/install/fishbot_description/share/fishbot_description/urdf/fishbot_gazebo.urdf --ros-args']. [gazebo-1] Gazebo multi-robot simulator, version 11.11.0 [gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation. [gazebo-1] Released under the Apache 2 License. [gazebo-1] http://gazebosim.org [gazebo-1] [gazebo-1] Gazebo multi-robot simulator, version 11.11.0 [gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation. [gazebo-1] Released under the Apache 2 License. [gazebo-1] http://gazebosim.org [gazebo-1] [gazebo-1] [INFO] [1716031561.325380813] [gazebo_ros_node]: ROS was initialized without arguments.
追加内容1:
- 列表我的功能包结构、lanuch文件内容如下,
launch文件原码如下:
import os from launch import LaunchDescription from launch.actions import ExecuteProcess from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare def generate_launch_description(): robot_name_in_model = 'fishbot' package_name = 'fishbot_description' urdf_name = "fishbot_gazebo.urdf" ld = LaunchDescription() pkg_share = FindPackageShare(package=package_name).find(package_name) urdf_model_path = os.path.join(pkg_share, f'urdf/{urdf_name}') # Start Gazebo server start_gazebo_cmd = ExecuteProcess( cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_factory.so'], output='screen') # Launch the robot spawn_entity_cmd = Node( package='gazebo_ros', executable='spawn_entity.py', arguments=['-entity', robot_name_in_model, '-file', urdf_model_path ], output='screen') ld.add_action(start_gazebo_cmd) ld.add_action(spawn_entity_cmd) return ld
追加信息2:
-
另外,我的模型文件是正常的(从小鱼的github网址中下载的),我使用rqt中的service calls 的xml方式导入到gazebo是显示正常的,见下图:
此问题我已经重新做过很多遍这个例程,网上找了很多方法,一直不能解决,反复折腾已经5天了,还请知道的兄弟帮忙研究下可能是那里的问题。
我看了一下,这个问题不解决,后面的章节无法进行,因为都是相互关联的内容,谢谢!
- 我在终端窗口执行完列表命令执行完命令,如下:
-
@刘豪 可以试试退出conda:conda deactivate 后再运行