Closed BriceRenaudeau closed 5 years ago
You can spawn URDF just like you would spawn SDF using just Ignition, you can try:
ign gazebo empty.sdf
then
ign service -s /world/empty/create \
--reqtype ignition.msgs.EntityFactory \
--reptype ignition.msgs.Boolean \
--timeout 300 \
--req 'sdf: '\
'"<?xml version=\"1.0\" ?>'\
'<robot name=\"will_be_ignored\">'\
'<link name=\"link\">'\
'<visual>'\
'<geometry>'\
'<sphere radius=\"1.0\"/>'\
'</geometry>'\
'</visual>'\
'<collision>'\
'<geometry>'\
'<sphere radius=\"1.0\"/>'\
'</geometry>'\
'</collision>'\
'<inertial>'\
'<mass value=\"1\"/>'\
'<inertia ixx=\"1\" ixy=\"0.0\" ixz=\"0.0\" iyy=\"1\" iyz=\"0.0\" izz=\"1\"/>'\
'</inertial>'\
'</link>'\
'</robot>" '\
'pose: {position: {z: 10}} '\
'name: "new_name" '\
'allow_renaming: true'
This will work for the simulation side. If you need the URDF for RViz for example, you'll need to set the robot_description
parameter separately.
There isn't a pure ROS way of calling the Ignition service yet
I can spawn my robot using robot.sdf but I would like to know if I can use my previous robot.gazebo file and its plugins.
What format does the .gazebo
file use? If it's SDF or URDF then it should work.
Plugins will not work though. Ignition's C++ API is completely different from classic Gazebo, so all plugins must be rewritten.
It's SDF format using
It's SDF format using balise.
What's "balise"?
What is the command line to spawn from a file ?
Use the sdf_filename
field. The whole message is documented here.
What's "balise"?
Sorry I meant <robot >
Markup
Use the sdf_filename field.
I tried but it gives me an error :
[libprotobuf ERROR google/protobuf/text_format.cc:298] Error parsing text-format ignition.msgs.EntityFactory: 1:5: Message type "ignition.msgs.EntityFactory" has no field named "from".
Thanks
Sorry I meant
<robot >
Markup
The <robot>
tag is present on URDF but not on SDF. I suggest you go through some tutorials.
I tried but it gives me an error
It's hard to tell what's going on without knowing the exact command you sent. How about we follow up on Gazebo Answers? You can ask a new question detailing what you're trying to do and what steps you've taken.
I'll leave this issue here since it's a valid request for a ROS interface to the entity create service.
Sorry for bothering you. I succeeded in using a file. I still have trouble going from my previous Gazebo file to the new Ignition one. For exemple :
<color rgba="1.0 1.0 1.0 0.5"/>
syntax doesn't workThanks.
http://answers.gazebosim.org/ is the best place to follow up on these issues :wink:
I'm closing this one, feel free to follow-up on http://answers.gazebosim.org/ .
Hello, I am trying to use Gazebo ignition instead of gazebo and I would like to know if there exists a model spawner that takes urdf input like in gaezbo-ros ?