<launch>
<group>
<let name="robot_description" value="$(command 'xacro $(find-pkg-share gazebo_pkg)/urdf/total.xacro')"/>
<node pkg="rviz2" exec="rviz2" name="rviz2" output="screen"/>
<node pkg="robot_state_publisher" exec="robot_state_publisher" name="robot_state_publisher">
<param name="robot_description" value="$(var robot_description)" type="str"/>
</node>
<node exec="parameter_bridge" pkg="ros_gz_bridge"/>
<node name="joint_state_publisher" exec="joint_state_publisher" pkg="joint_state_publisher"/>
<include file="$(find-pkg-share ros_gz_sim)/launch/gz_sim.launch.py">
<arg name="gz_args" value="-v 4 -r empty.sdf"/>
</include>
<node exec="create" pkg="ros_gz_sim" args="-urdf -model half -param robot_description"/>
</group>
</launch>
?小小意思不成敬意,哈哈哈请笑纳
知识点说明:
知识点1:
知识点2:
<include file="$(find-pkg-share ros_gz_sim)/launch/gz_sim.launch.py">
? ? ? ? <arg name="gz_args" value="-v 4 -r visualize_lidar.sdf"/>
? ? </include>
向gazebo传入参数的格式:<arg name="gz_args"? value="具体命令内容"/>
例如:? ? ? ? <arg name="gz_args" value="-v 4 -r visualize_lidar.sdf"/>
其中world存放的文件位置:/usr/share/ignition/ignition-gazebo6/worlds;
空白世界名称:empty.sdf