roslaunch打开更改gazebo world报错:SpawnModel: Failure - model name mrobot already exist.

roslaunch mbot_gazebo view_mbot_gazebo_obstacle2.launch 
... logging to /home/suifeng/.ros/log/e98b739c-cd05-11ec-9bfc-b0fc364da57d/roslaunch-suifeng-RESCUER-R720-15IKBN-20614.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.

xacro: in-order processing became default in ROS Melodic. You can drop the option.
Deprecated: xacro tag 'mbot_base_gazebo' w/o 'xacro:' xml namespace prefix (will be forbidden in Noetic)
when processing file: /home/suifeng/catkin_ws/src/mbot_description/urdf/xacro/gazebo/mbot_gazebo.xacro
Use the following command to fix incorrect tag usage:
find . -iname "*.xacro" | xargs sed -i 's#<\([/]\?\)\(if\|unless\|include\|arg\|property\|macro\|insert_block\)#<\1xacro:\2#g'

started roslaunch server http://suifeng-RESCUER-R720-15IKBN:41091/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /robot_description:  = Debug
[ INFO] [1651818584.041610578]: DiffDrive(ns = //):  = 
[DEBUG] [1651818584.041738052]: DiffDrive(ns = //):  = cmd_vel
[DEBUG] [1651818584.041769775]: DiffDrive(ns = //):  = odom
[DEBUG] [1651818584.041786478]: DiffDrive(ns = //):  = /world
[DEBUG] [1651818584.041799374]: DiffDrive(ns = //):  = base_footprint
[DEBUG] [1651818584.041837656]: DiffDrive(ns = //):  = true
[ WARN] [1651818584.042296710]: DiffDrive(ns = //): missing  default is true
[DEBUG] [1651818584.043163478]: DiffDrive(ns = //):  = false
[DEBUG] [1651818584.043611748]: DiffDrive(ns = //):  = 0.38
[DEBUG] [1651818584.043972123]: DiffDrive(ns = //):  = 0.12
[DEBUG] [1651818584.044743630]: DiffDrive(ns = //):  = 1.8
[DEBUG] [1651818584.045279915]: DiffDrive(ns = //):  = 30
[DEBUG] [1651818584.045682620]: DiffDrive(ns = //):  = 100
[DEBUG] [1651818584.047004742]: DiffDrive(ns = //):  = world := 1
[DEBUG] [1651818584.047314133]: DiffDrive(ns = //):  = left_wheel_joint
[DEBUG] [1651818584.048207254]: DiffDrive(ns = //):  = right_wheel_joint
[ INFO] [1651818584.048270458]: Physics dynamic reconfigure ready.
[ INFO] [1651818584.048811759]: DiffDrive(ns = //): Try to subscribe to cmd_vel
[ INFO] [1651818584.050697527]: DiffDrive(ns = //): Subscribe to cmd_vel
[ INFO] [1651818584.051183765]: DiffDrive(ns = //): Advertise odom on odom 
[DEBUG] [1651818584.061767789, 52.380000000]: Trying to publish message of type [nav_msgs/Odometry/cd5e73d190d741a2f92e81eda573aca7] on a publisher with type [nav_msgs/Odometry/cd5e73d190d741a2f92e81eda573aca7]
[INFO] [1651818584.278677, 52.590000]: Calling service /gazebo/spawn_urdf_model
[ERROR] [1651818584.282292823, 52.590000000]: SpawnModel: Failure - model name mrobot already exist.
[INFO] [1651818584.282717, 52.590000]: Spawn status: SpawnModel: Failure - entity already exists.
[ERROR] [1651818584.283950, 52.590000]: Spawn service failed. Exiting.
[urdf_spawner-6] process has died [pid 20657, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -urdf -model mrobot -param robot_description __name:=urdf_spawner __log:=/home/suifeng/.ros/log/e98b739c-cd05-11ec-9bfc-b0fc364da57d/urdf_spawner-6.log].
log file: /home/suifeng/.ros/log/e98b739c-cd05-11ec-9bfc-b0fc364da57d/urdf_spawner-6*.log
^C[robot_state_publisher-5] killing on exit
[joint_state_publisher-4] killing on exit
[gazebo-2] killing on exit
[gazebo_gui-3] killing on exit
[gazebo_gui-3] escalating to SIGTERM
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

错误如上,用roslaunch打开一个gazebo world后更改环境在另外存,打开更改后的world出现出现上述错误。是因为保存环境时在world中定义了一个robot模型,而launch文件中也加载了一个同名的robot模型。

解决方法:

1,打开world删去robot模型.重新保存即可

2,重命名world或者launch文件里的robot模型,但这样会在同一个位置出现两个机器人模型

     

中的mrobot就是名称,更改即可

你可能感兴趣的:(自动驾驶,人工智能,机器学习)