Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

From the model plugin attached to the boat you have a pointer to the boat model, let's call it this->boatModel. Then you can get the ocean model like this:

physics::BasePtr parentBase = this->boatModel->GetParent();
physics::WorldPtr world = boost::dynamic_pointer_cast<physics::WorldPtr>(parentBase);
physics::ModelPtr oceanModel = world->GetModel("ocean");