我需要进行什么操作才能让机器人模型显示出来呢
launch文件:
<launch>
<param name="robot_description" textfile="$(find urdf02_gazebo)/urdf/helloworld.urdf" />
<include file="$(find gazebo_ros)/launch/empty_world.launch" />
<node pkg="gazebo_ros" type="spawn_model" name="model" args="-urdf -model mycar -param robot_description" />
</launch>
URDF文件:
<robot name="mycar">
<link name="base_link">
<visual>
<geometry>
<box size="0.5 0.2 0.1" />
</geometry>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
<material name="yellow">
<color rgba="0.5 0.3 0.0 1" />
</material>
</visual>
<collision>
<geometry>
<box size="0.5 0.2 0.1" />
</geometry>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
</collision>
<inertial>
<origin xyz="0 0 0" />
<mass value="6" />
<inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1" />
</inertial>
</link>
<gazebo reference="base_link">
<material>Gazebo/Black</material>
</gazebo>
</robot>
运行日志:
milk@milk:~/DEMO05_WS$ roslaunch urdf02_gazebo demo01_helloworld.launch
... logging to /home/milk/.ros/log/2bc6078c-ce90-11ec-910d-94b86d736de2/roslaunch-milk-15810.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://milk:40587/
SUMMARY
========
PARAMETERS
* /gazebo/enable_ros_network: True
* /robot_description: <robot name="myca...
* /rosdistro: melodic
* /rosversion: 1.14.13
* /use_sim_time: True
NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
ROS_MASTER_URI=http://localhost:11311
process[gazebo-1]: started with pid [15832]
[ INFO] [1651989570.981390379]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1651989570.983231402]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
process[gazebo_gui-2]: started with pid [15846]
[ INFO] [1651989571.250818696, 0.007000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1651989571.274818693, 0.030000000]: Physics dynamic reconfigure ready.
[ INFO] [1651989571.447270882]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1651989571.448756653]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...