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

2023-05-16

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: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 50.0
 * /rosdistro: melodic
 * /rosversion: 1.14.13
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    urdf_spawner (gazebo_ros/spawn_model)

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

setting /run_id to e98b739c-cd05-11ec-9bfc-b0fc364da57d
process[rosout-1]: started with pid [20638]
started core service [/rosout]
process[gazebo-2]: started with pid [20644]
process[gazebo_gui-3]: started with pid [20650]
process[joint_state_publisher-4]: started with pid [20655]
process[robot_state_publisher-5]: started with pid [20656]
process[urdf_spawner-6]: started with pid [20657]
[ INFO] [1651818582.918998014]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1651818582.921251716]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1651818582.950466591]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1651818582.952298967]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[INFO] [1651818583.367985, 0.000000]: Loading model XML from ros parameter robot_description
[INFO] [1651818583.373654, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1651818584.028696750]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1651818584.038540997]: Starting plugin DiffDrive(ns = //)
[ INFO] [1651818584.040645574]: DiffDrive(ns = //): <rosDebugLevel> = Debug
[ INFO] [1651818584.041610578]: DiffDrive(ns = //): <tf_prefix> = 
[DEBUG] [1651818584.041738052]: DiffDrive(ns = //): <commandTopic> = cmd_vel
[DEBUG] [1651818584.041769775]: DiffDrive(ns = //): <odometryTopic> = odom
[DEBUG] [1651818584.041786478]: DiffDrive(ns = //): <odometryFrame> = /world
[DEBUG] [1651818584.041799374]: DiffDrive(ns = //): <robotBaseFrame> = base_footprint
[DEBUG] [1651818584.041837656]: DiffDrive(ns = //): <publishWheelTF> = true
[ WARN] [1651818584.042296710]: DiffDrive(ns = //): missing <publishOdomTF> default is true
[DEBUG] [1651818584.043163478]: DiffDrive(ns = //): <publishWheelJointState> = false
[DEBUG] [1651818584.043611748]: DiffDrive(ns = //): <wheelSeparation> = 0.38
[DEBUG] [1651818584.043972123]: DiffDrive(ns = //): <wheelDiameter> = 0.12
[DEBUG] [1651818584.044743630]: DiffDrive(ns = //): <wheelAcceleration> = 1.8
[DEBUG] [1651818584.045279915]: DiffDrive(ns = //): <wheelTorque> = 30
[DEBUG] [1651818584.045682620]: DiffDrive(ns = //): <updateRate> = 100
[DEBUG] [1651818584.047004742]: DiffDrive(ns = //): <odometrySource> = world := 1
[DEBUG] [1651818584.047314133]: DiffDrive(ns = //): <leftJoint> = left_wheel_joint
[DEBUG] [1651818584.048207254]: DiffDrive(ns = //): <rightJoint> = 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模型,但这样会在同一个位置出现两个机器人模型

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
          args="-urdf -model mrobot -param robot_description"/> 

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

roslaunch打开更改gazebo world报错:SpawnModel: Failure - model name mrobot already exist. 的相关文章

随机推荐