ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
This might be an old thread but I haven't seen a direct answer. I solved it by defining a world plugin that exposes the WorldPtr
(see Gazebo World Class Reference) in the Load
function and disabling the Physics Engine in the on_update
method:
void DisablePlugin::Load(gazebo::physics::WorldPtr ptr, sdf::ElementPtr sdf) {
_world = ptr;
_update_connection = gazebo::event::Events::ConnectWorldUpdateBegin(
boost::bind(&DisablePlugin::on_update, this, _1));
}
void DisablePlugin::on_update(const gazebo::common::UpdateInfo& /*info*/) {
if (_world->GetEnablePhysicsEngine())
_world->EnablePhysicsEngine(false);
}
You can then set the pose of a model for example by using the SetLinkWorldPose
method.