Home | Tutorials | Wiki | Issues
Ask Your Question

Shared variable between two instance of the same model plugin

asked 2018-12-06 05:20:18 -0600

kincurt gravatar image


I have a model plugin for a robot that use a controller in order to control the robot. The scenario i am working on needs to have two robots walking in the same world. So i am inserting the models with the same model plugin.

The sad thing is that this controller haven't been made with the usual c++ precautions. For instance, there are some variables that are declared outside the classes. And however it would be the best solution, i am not able to alter its code to fix this kind of mistake.

Therefore, when I am starting the simulation, some variables are edited by both robots and that prevents them from walking correctly.

So i was wondering if there is a way of executing both plugins "separatly" so that even if the controller have been badly coded they can't share any variables.

Thanks for your help!

PS: I am working on gazebo 9 with ubuntu 16.04 I am using catking to build the plugins

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-06 10:05:47 -0600

nkoenig gravatar image

Plugins are loaded into the same process, and there is no mechanism to alter this behavior. Unless there is someone with a creative idea, then I think the only solution is to fix the plugin.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-12-06 05:20:18 -0600

Seen: 32 times

Last updated: Dec 06