admin管理员组

文章数量:1619183

一、问题描述:

joes@joes:~/jiao/ROS_Project/20_jiao$ roslaunch car_robot start_car_gazebo.launch
... logging to /home/joes/.ros/log/d365cc6e-6d21-11ec-ab78-14f6d8d77445/roslaunch-joes-4115.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros/xacro#Processing_Order
started roslaunch server http://localhost:44319/

SUMMARY
========

PARAMETERS
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.17
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    spawn_model1 (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [4128]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d365cc6e-6d21-11ec-ab78-14f6d8d77445
process[rosout-1]: started with pid [4142]
started core service [/rosout]
process[gazebo-2]: started with pid [4152]
process[gazebo_gui-3]: started with pid [4169]
process[spawn_model1-4]: started with pid [4176]
[ INFO] [1641275259.885211862]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1641275259.885556667]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1641275259.902399473]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1641275259.902753416]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1641275260.232563319]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1641275260.238415925]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1641275260.281767205]: Physics dynamic reconfigure ready.
[ INFO] [1641275260.284706804, 270.818000000]: Physics dynamic reconfigure ready.
[ERROR] [1641275260.389361305, 270.918000000]: SpawnModel: Failure - model name car already exists.
[spawn_model1-4] process has finished cleanly
log file: /home/joes/.ros/log/d365cc6e-6d21-11ec-ab78-14f6d8d77445/spawn_model1-4*.log
^C[gazebo_gui-3] killing on exit
[gazebo-2] killing on exit
^C^C^CSegmentation fault (core dumped)
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete

二、解决方法:

代码是复制其他地方过来的,所以名称存在重复情况,只需要将args中的car改为car_robot即可。

错误代码:

    <node pkg="gazebo_ros" type="spawn_model" name="spawn_model1" args="-urdf -model car -param robot_description"/>

正确代码:

    <node pkg="gazebo_ros" type="spawn_model" name="spawn_model1" args="-urdf -model car_robot -param robot_description"/>

或者在报错环境中,将重复的小车模型删除,另存为原路径,覆盖模型,再进行打开,报错消除。(优先采用第二种,第一种可能会出现两台小车的情况)

本文标签: SpawnModelErrorCarexistsfailure