紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
-
下面是完整的报错信息
ros2@ros2-virtual-machine:~/d2lros/chapt8/fishbot_ws$ ros2 launch fishbot_description display_rviz2.launch.py [INFO] [launch]: All log files can be found below /home/ros2/.ros/log/2022-08-18-13-44-13-635600-ros2-virtual-machine-5560 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [5572] [INFO] [joint_state_publisher_gui-2]: process started with pid [5574] [INFO] [rviz2-3]: process started with pid [5576] [rviz2-3] qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" [robot_state_publisher-1] [WARN] [1660801457.094932948] [robot_state_publisher]: No robot_description parameter, but command-line argument available. Assuming argument is name of URDF file. This backwards compatibility fallback will be removed in the future. [robot_state_publisher-1] Link laser_link had 0 children [robot_state_publisher-1] [INFO] [1660801457.720892835] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1660801457.720969078] [robot_state_publisher]: got segment laser_link [rviz2-3] [INFO] [1660801458.613988022] [rviz2]: Stereo is NOT SUPPORTED [rviz2-3] [INFO] [1660801458.614231508] [rviz2]: OpenGl version: 4.1 (GLSL 4.1) [rviz2-3] [INFO] [1660801458.957211916] [rviz2]: Stereo is NOT SUPPORTED [joint_state_publisher_gui-2] qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" [joint_state_publisher_gui-2] [INFO] [1660801460.875772212] [joint_state_publisher_gui]: Centering
-
@1206768372
程序是找小鱼的复制黏贴的
launch文件import os from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare def generate_launch_description(): package_name = 'fishbot_description' urdf_name = "fishbot_base.urdf" ld = LaunchDescription() pkg_share = FindPackageShare(package=package_name).find(package_name) urdf_model_path = os.path.join(pkg_share, f'urdf/{urdf_name}') #robot_state_publisher_node负责发布机器人模型信息robot_description,并将joint_states数据转换tf信息发布 robot_state_publisher_node = Node( package='robot_state_publisher', executable='robot_state_publisher', arguments=[urdf_model_path] ) #负责发布机器人关节数据信息,通过joint_states话题发布 joint_state_publisher_node = Node( package='joint_state_publisher_gui', executable='joint_state_publisher_gui', name='joint_state_publisher_gui', arguments=[urdf_model_path] ) rviz2_node = Node( package='rviz2', executable='rviz2', name='rviz2', output='screen', ) ld.add_action(robot_state_publisher_node) ld.add_action(joint_state_publisher_node) ld.add_action(rviz2_node) return ld
setup文件
from setuptools import setup from glob import glob## import os## package_name = 'fishbot_description' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')),## (os.path.join('share', package_name, 'urdf'), glob('urdf/**')),## ], install_requires=['setuptools'], zip_safe=True, maintainer='root', maintainer_email='root@todo.todo', description='TODO: Package description', license='TODO: License declaration', tests_require=['pytest'], entry_points={ 'console_scripts': [ ], }, )
-
@1206768372 网上搜了下,这个错误好像是vscode中环境配置造成的,你试试直接在电脑的终端里运行程序看看.
-