Robotics StackExchange | Archived questions

Shared variable between two instance of the same model plugin

Hi,

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

Asked by kincurt on 2018-12-06 06:20:18 UTC

Comments

Answers

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.

Asked by nkoenig on 2018-12-06 11:05:47 UTC

Comments

Thanks for your reply. Yep, that's quite annoying, i though that gazebo implemented a way to compute plugins in parallel. It would have been really useful to speed computation time when you use several models with heavy controllers.

Asked by kincurt on 2018-12-17 06:17:11 UTC