小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
6.4.2 我在gazebo中无法显示fishbot机器人模型,求求帮看一下是怎么回事,按书上的代码也是一样的报错
-
背景:
我的代码是如下,和鱼哥的视频里的一样,然后我终端执行ros2 launch fishbot_description gazebo_sim.launch.py命令时,终端显示:
[ERROR] [launch]: Caught exception in launch (see debug for traceback): launch configuration 'model' does not exist这串错误,并且gazebo打不开
当我终端执行ros2 launch fishbot_description gazebo_sim.launch.py --debug命令时,gazebo打开了,但是fishbot模型没显示,终端显示:
[Wrn] [GuiIface.cc:120] Could not find the Qt platform plugin "wayland" in ""
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.process.ProcessStderr'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>' ✓ '<launch.event_handlers.on_process_io.OnProcessIO object at 0x72d00b6a6650>'
[gzclient-3] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.process.ProcessStderr'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>' ✓ '<launch.event_handlers.on_process_io.OnProcessIO object at 0x72d00b6a6650>'
这个错误import launch
import launch.launch_description_sources
import launch_ros
from ament_index_python.packages import get_package_share_directory
import os
import launch_ros.descriptions
def generate_launch_description():urdf_package_path = get_package_share_directory('fishbot_description') default_xacro_path = os.path.join(urdf_package_path, 'urdf','fishbot/fishbot.urdf.xacro') # default_xacro_path = os.path.join(urdf_package_path,f'/home/cjl/chapt6/chapt6_ws/src/fishbot_description/urdf/fishbot/fishbot.urdf.xacro') #default_rviz_config_path= os.path.join(urdf_package_path,'config','display_robot_model.rviz') default_gazebo_world_path= os.path.join(urdf_package_path,'world','custom_room.world') #声明一个xacro目录的参数,方便修改 action_declare_arg_mode_path = launch.actions.DeclareLaunchArgument( name='model',default_value=str(default_xacro_path),description='加载的模型文件路径' ) #通过文件路径,获取内容,并转换成参数值对象,以供传入'robot_state_publisher' substitutions_command_result =launch.substitutions.Command(['xacro ',launch. substitutions.LaunchConfiguration('model')]) robot_description_value=launch_ros.parameter_descriptions.ParameterValue(substitutions_command_result, value_type=str) action_robot_state_publisher = launch_ros.actions.Node( package='robot_state_publisher', executable='robot_state_publisher', parameters=[{'robot_description':robot_description_value}] ) # action_joint_state_publisher = launch_ros.actions.Node( # package='joint_state_publisher', # executable='joint_state_publisher', # ) # action_rviz_node = launch_ros.actions.Node( # package='rviz2', # executable='rviz2', # arguments={'-d',default_rviz_config_path} # ) action_launch_gazebo = launch.actions.IncludeLaunchDescription( launch.launch_description_sources.PythonLaunchDescriptionSource( [get_package_share_directory('gazebo_ros'),'/launch','/gazebo.launch.py'] ), launch_arguments=[('world',default_gazebo_world_path),('verbose','true')] ) action_spawn_entity =launch_ros.actions.Node( package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic','/robot_description','-entity','fishbot'] ) return launch.LaunchDescription({ action_declare_arg_mode_path, action_robot_state_publisher, action_launch_gazebo, action_spawn_entity })
-
我车调出来了,之前colcon build 错文件夹了,导致chat6里面有两个install,好像混了,把另外一个删了,车模型就出来,但是我还是有
[Wrn] [GuiIface.cc:120] Could not find the Qt platform plugin "wayland" in ""
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.process.ProcessStderr'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>' ✓ '<launch.event_handlers.on_process_io.OnProcessIO object at 0x72d00b6a6650>'
[gzclient-3] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.process.ProcessStderr'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0x72d00b7d9c30>' ✓ '<launch.event_handlers.on_process_io.OnProcessIO object at 0x72d00b6a6650>'
这个错误
请问怎么解决 -
@抱着咸鱼的啊黄 这个没关系