Exclude model controlled via ign system plugin from physics calculation
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.
Asked by Illuminatur on 2022-04-26 13:05:05 UTC
Answers
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.
Asked by azeey on 2022-04-26 21:58:46 UTC
Comments