Gazebo | Ignition | Community
Ask Your Question
0

Exclude model controlled via ign system plugin from physics calculation

asked 2022-04-26 13:05:05 -0600

Illuminatur gravatar image

Dear community,

we have implemented a SystemPlugin for Ignition Fortress, which is able to change a model's world pose imitating the implementation of UserCommands [1], actually providing this capabilities as ign services. In the plugin's PreUpdate() interface, we react to incoming ign topics of type ignition::msgs::Pose and move the model according to this pose.

void MySystemPlugin::PreUpdate(const ignition::gazebo::UpdateInfo &_info, ignition::gazebo::EntityComponentManager &_ecm)
{
  [...]
  auto poseCmdComp = _ecm.Component<ignition::gazebo::components::WorldPoseCmd>(this->dataPtr->entity);
  if (!poseCmdComp)
  {
      _ecm.CreateComponent(this->dataPtr->entity, ignition::gazebo::components::WorldPoseCmd(current_pose));
  }
  else
  {
       auto state = poseCmdComp->SetData(current_pose, pose3Eql) ? ignition::gazebo::ComponentState::OneTimeChange : ignition::gazebo::ComponentState::NoChange;
    _ecm.SetChanged(this->dataPtr->entity, ignition::gazebo::components::WorldPoseCmd::typeId, state);
  }
}

Moving the model around typically results to the model being influenced by physics during the Update() interface. This is obvious when moving the model upwards (+z) and consequently gravity is applied. The object then is falling down to the ground.

Since we want to calculate the model's physics completely outside ign, we would like to exclude this model from physics calculation. Is this somehow possible?

BR and thx.

[1] https://github.com/ignitionrobotics/i...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-26 21:58:46 -0600

azeey gravatar image

Making the model static would cause it to not be influenced by physics. You can do this by setting the tag <static> in the SDFormat file.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-04-26 13:05:05 -0600

Seen: 68 times

Last updated: Apr 26 '22