Gazebo | Ignition | Community
Ask Your Question
0

Question about command line's delay and array

asked 2022-05-31 14:10:48 -0500

kakcalu13 gravatar image

So, I use command to load robots/ground by this line:

ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"models/sdf/new_ground.sdf" pose: {position: {x: 0, y: 0, z: 0}} ''name: "ground_%s" ''allow_renaming: true'

SO if I ran this with a loop, each line takes one second to load approximately. So, it seems that it has a delay. Is there any way to reduce the delay?

Also, is there a way to load more than 5 models at once?

Like for example: ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"model1.sdf, model2.sdf,model3.sdf" 'pose: {position: {x: 0, y: 0, z: 0},{x: 2, y: 0, z: 0},{x: 4, y: 0, z: 0}} '

Obviously, above is just guess or psuedo command line. Is there any official command for it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-06-02 07:41:34 -0500

nkoenig gravatar image

My first guess as to the delay is likely due to transport discovery. Each time you run the command gazebo's transport has to find the service.

You can send a batch request using the /world/WORLD_NAME/create_multiple service. In your example it would look like:

ign service -s /world/free_world/create_multiple --reqtype gnition.msgs.EntityFactory_V --reptype ignition.msgs.Boolean --timeout 2000 --req 'data{MODEL1_INFOMATION} data{MODEL2_INFORMATION} data{MODEL3_INFORMATION}'

edit flag offensive delete link more

Comments

This answered my questions, thank you so much!

Last question if you don't mind! What about remove? I couldn't find remove_multiple

kakcalu13 gravatar imagekakcalu13 ( 2022-06-02 07:51:13 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2022-05-31 14:10:48 -0500

Seen: 24 times

Last updated: Jun 02