Gazebo | Ignition | Community
Ask Your Question

How to use ign service in command line?

asked 2022-05-16 13:22:40 -0500

kakcalu13 gravatar image

updated 2022-05-17 13:31:11 -0500

I'm not quite familiar with this. Do you know how to use ignition.msgs in command line? I was following this doc

using EntityFactory which is ignition.msgs.EntityFactory in command line. I wanted to clear sensors to 0 so I used SENSOR or Clear()

So I tried many ways include

ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean  --timeout 300 --req 'clear'

ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean  --timeout 300 --req 'clear: true'

ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean  --timeout 300 --req 'clear = true'

None of them worked. Error just returns like this, [libprotobuf ERROR google/protobuf/] Error parsing text-format ignition.msgs.EntityFactory: 1:7: Message type "ignition.msgs.EntityFactory" has no field named "clear".

I wanted to do this because of respawn. This sensor is actually prevent the respawn due to error where it says camera rgb is already exist in entity [#]. I explained more in github but then I realized, this is just belong to this site

Last question, do you know if there's any documentation or tutorial for this one?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-18 06:43:46 -0500

kakcalu13 gravatar image

I finally find out about this.

So, just run this command after ign service -l and then select one you wanted to use. For me, I used create, so it would be ignition.msgs.EntityFactory,

How do I know that it would be ignition.msgs.EntityFactory? Well, you type in terminal, ign service -is /world/free_world/create

and you get the output:

Service providers [Address, Request Message Type, Response Message Type]:
  tcp://, ignition.msgs.EntityFactory, ignition.msgs.Boolean

So, it says ignition.msgs.EntityFactory, go to msg api (Use this since it gives you the latest version) and then click api and tutorials. Replace index.html to EntityFactory.html which is like this

So, you can see where extra arguments come from.

So as for /world commands, I guess each end of the line is the command. In this case, I picked create out of /world/free_world/create.

More information is at this:

Now we know how to work with ign service usage.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-05-16 13:22:40 -0500

Seen: 875 times

Last updated: May 18 '22