使用sdf文件+urdf文件模拟机器人示例(不用把urdf转sdf)

2024-01-03 00:34:06

gazebo版本:harmonic;

<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)"/>
</node>
<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 default.sdf"/>
</include>
<node pkg="ros_gz_sim" exec="create" args="-world default -file $(find-pkg-share gazebo_pkg)/urdf/total.urdf"> 
</node> 
<node pkg="ros_gz_bridge" exec="parameter_bridge" args="/chatter@geometry_msgs/msg/Twist@ignition.msgs.Twist"/>
</group>
</launch>

为了保证这次试验的可重复性,我关机后重启再次运行,结果如下:

还是有,说明不是意外了,对了备份,用作也许算灾难恢复

文章来源:https://blog.csdn.net/geniusChinaHN/article/details/135349897
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。