0
$\begingroup$

Rosanswers logo

For a little bit of context, I'm using ros Foxy with Ubuntu 20.04 My initial goal was to use the gazebo_ros_p3d plugin in gazebo by adding :

<gazebo>
<plugin filename="libgazebo_ros_p3d.so" name="gazebo_ros_p3d">
  <bodyName>bannane</bodyName>
  <topicName>ground_truth_odom</topicName>
  <alwaysOn>true</alwaysOn>
  <updateRate>100.0</updateRate>
</plugin>
into my .urdf description of the robot. Everything seem to work fine, the robot spawn in gazebo however i get this error :
[gazebo-4] [ERROR] [1651828364.494524675] [gazebo_ros_p3d]: Missing <body_name>, cannot proceed

This led me to look here : http://docs.ros.org/en/melodic/api/gazebo_plugins/html/gazebo__ros__p3d_8cpp_source.html. Apparently my .sdf file does not contains a body_name which is weird as it seems present in my urdf file.

I then tried to look at what the sdf file looked like, and found an issue :

$ gz sdf -p bot_description.urdf > test
Error: SDF parsing the xml failed

I believe the issue comes from here, gazebo don't need .sdf file to work so the simulation work fine but as the conversion fail i can't get the plugin to work. Is there a way to get more information on why does the conversion is failing ? How can i add my .urdf to this post if needed ? Thank you everyone for taking time to read my question !


Originally posted by Bastian2909 on ROS Answers with karma: 68 on 2022-05-09

Post score: 0


Original comments

Comment by gvdhoorn on 2022-05-09:
Please post your last edit as an answers instead, then accept your own answer.

Comment by Bastian2909 on 2022-05-09:
done, thank you for the advice, will do that from now on. however I can't accept my own answer as I don't have enough points.

Comment by gvdhoorn on 2022-05-09:
I've already accepted it for you.

Comment by Bastian2909 on 2022-05-09:
Thank you !

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Found the issue ! I followed a tutorial telling me to create a .urdf file and calling it a urdf file even though there was some xacro prensent in the code. This led me to beleive my file was a .urdf file but it was a .xacro file. So i first converted my .urdf file to a true .urdf file using the xacro -> urdf converter. Then i was able to convert my true .urdf file into an sdf without any issue.


Originally posted by Bastian2909 with karma: 68 on 2022-05-09

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.