Gazebo | Ignition | Community
Ask Your Question
-1

Multiple model plugins for a model

asked 2016-06-27 07:50:45 -0600

Anand George gravatar image

Hi
Can I have multiple model plugins for a single model?
Thanks in advance!

edit retag flag offensive close merge delete

Comments

Did you try it? My guess is yes, but I haven't tested it. If you tried it, tell us what you tried.

Peter Mitrano gravatar imagePeter Mitrano ( 2016-06-27 10:20:02 -0600 )edit

I tried it. Added one more plugin in the sdf. It worked!

Anand George gravatar imageAnand George ( 2016-06-28 04:02:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-27 10:52:18 -0600

chapulina gravatar image

Yes, you can have multiple model plugins attached to the same model. See for example the submarine model, which has 5 model plugins.

Just make sure all the plugins are not overriding each other. Depending on what the plugins do, the order in which they're loaded might mix up their behaviours (for example, if they all connect to world update event).

edit flag offensive delete link more

Comments

How can I get output of 'printf' of each plugin in separate terminal?

Anand George gravatar imageAnand George ( 2016-06-28 04:19:12 -0600 )edit

Model plugins run in the same process as gzserver, so I don't think it would be trivial to do that.

chapulina gravatar imagechapulina ( 2016-06-28 09:58:20 -0600 )edit
1

I'd go so far as to say impossible. What you really want is the ability to distinguish between your different plugins. I'd recommend looking at other techniques for that. Prefix all prints with the plugin name, print them all, pipe the output of gazebo to a file, and use `tail -f logfile.txt | grep plugin1name`. That has the effect of separating out the output of one plugin. Do that for all your plugins, and voila..

Peter Mitrano gravatar imagePeter Mitrano ( 2016-06-28 16:45:27 -0600 )edit

I'd go so far as to say impossible. What you really want is the ability to distinguish between your different plugins. I'd recommend looking at other techniques for that. Prefix all prints with the plugin name, print them all, redirect the output of gazebo to a file, and use `tail -f logfile.txt | grep plugin1name`. That has the effect of separating out the output of one plugin. Do that for all your plugins, and voila..

Peter Mitrano gravatar imagePeter Mitrano ( 2016-06-28 16:45:50 -0600 )edit

Thanks! I'll try this out.

Anand George gravatar imageAnand George ( 2016-06-29 00:21:33 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2016-06-27 07:50:45 -0600

Seen: 2,066 times

Last updated: Jun 27 '16