Spawn service failed

HELLO to All.

I am trying to use the source code for the Book on ROS called Hands on ROS for Robotic Programming.

The source code is listed on the following github website: Hands-On-ROS-for-Robotics-Programming/Chapter8_Virtual_SLAM/virtual_slam/launch at master · PacktPublishing/Hands-On-ROS-for-Robotics-Programming · GitHub

I am using the source code exactly as to how it should be executed.

However, when ever I launch the following launch file:

roslaunch virtual_slam gopigo3_basic_world.launch

I receive the following error:

[ERROR] [1613725552.153679, 1298.480000]: Spawn service failed. Exiting.
Warning [parser.cc:950] XML Element[material], child of element[sensor] not defined in SDF. Ignoring[material]. You may have an incorrect SDF file, or an sdformat version that doesn’t support this element.
[ INFO] [1613725552.250527143, 1298.480000000]: Physics dynamic reconfigure ready.
[spawn_urdf-4] process has died [pid 4180, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -urdf -model gopigo3 -x 0.0 -y 0.0 -z 0.0 -param robot_description __name:=spawn_urdf __log:=/home/melodic/.ros/log/a69b4d84-7291-11eb-89da-080027620e65/spawn_urdf-4.log].
log file: /home/melodic/.ros/log/a69b4d84-7291-11eb-89da-080027620e65/spawn_urdf-4*.log

I am not certain as to what this means exactly. This should already be working since it is in a published book from packt publications.

I believe the error might be related to the following warning:

Warning [parser.cc:950] XML Element[material], child of element[sensor] not defined in SDF.

Any help is greatly appreciated.

thanks,

David Blubaugh

It seems like there might be a material tag misplaced in the URDF/SDF model of the robot. I recommend you to have a look at the URDF course to get a sense of how these things work: URDF_COURSE

WELL HERE IS MILLION DOLLAR QUESTION.

If the urdf model of the robot is flawed and cannot be genertaed within Gazebo.

Then why when I execute the following command:

roslaunch gopigo3_description gopigo3_basic_rviz.launch which is found in chapter 8 of page 257 of the Book HANDS ON ROS for robotics programming.

THAT I can still launch that very same urdf robot model in RVIZ FLAWLESSLY.

The robot model works in RVIZ but DOES NOT work in Gazebo…

If the urdf model of the robot was flawed then why I can still generate the urdf model. There might be a problem with the Gazebo tag extensions. I am going to take a look…

David

It works perfectly

Hi,

Good question. Take into accound that RVIZ doesnt need everything defined in the URDF, because its only the visualiser. Gazebo needs more infor for well… Simulated it.

I woudl recommend you to create a Rosject and shere it here so that the comunity can lend you a hand more easily