Hi,
I'm using gazebo revision number 8676.
I found that when you nest models in the world description
(e.g., in the pioneer2dx_camera.world, the sonyvid30_model is nested inside
the pioneer2dx_model1)
the controllers of the nested models are correctly initialized but NOT
updated.
Hence, nested controllers are not considered at all during the simulation
loop.
I found this problem after updating gazebo. I got crazy trying to make a
sonyvid30_model ptz controller work.
Then, I found that the problem was in the gazebo code.
I found a temporary solution. In the function
void Model::Attach(XMLConfigNode *node)
I replaced these two original lines
if (this->parent->GetType() == Entity::MODEL)
parentModel = (Model*)this->parent;
with these new ones
if (this->parent->GetType() == Entity::MODEL)
{
parentModel = (Model*)this->parent;
// Copy the controllers into the parent controller vector
parentModel->controllers.insert( this->controllers.begin(),
this->controllers.end() );
}
Everything seems to work now, but there are some remaining issues with this
patch:
- this solves the problem only with controllers nested only one time, that
is with controllers of models which are direct children of level-0 models.
The controller vector of a nested model should be copied in the controller
vector of its root model!
- controllers are intialized twice.
Waiting for your comments.
- Xfly
------------------------------------------------------------------------------
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo