diff --git a/Migration.md b/Migration.md index a1df392c5cc..43d0e8f2109 100644 --- a/Migration.md +++ b/Migration.md @@ -5,6 +5,13 @@ Deprecated code produces compile-time warnings. These warning serve as notification to users that their code should be upgraded. The next major release will remove the deprecated code. +## Gazebo Sim 8.x to 9.0 + + * **Modified**: + + In the Physics system, all `*VelocityCmd` components are deleted after + each time step. Persistent velocity commands should be reapplied at + each time step. + ## Gazebo Sim 7.x to 8.0 * **Deprecated** + `gz::sim::components::Factory::Register(const std::string &_type, ComponentDescriptorBase *_compDesc)` and diff --git a/src/systems/physics/Physics.cc b/src/systems/physics/Physics.cc index 1f6defbf449..572b850ccc0 100644 --- a/src/systems/physics/Physics.cc +++ b/src/systems/physics/Physics.cc @@ -3629,9 +3629,9 @@ void PhysicsPrivate::UpdateSim(EntityComponentManager &_ecm, }); _ecm.Each( - [&](const Entity &, components::JointVelocityCmd *_vel) -> bool + [&](const Entity &_entity, components::JointVelocityCmd *) -> bool { - std::fill(_vel->Data().begin(), _vel->Data().end(), 0.0); + _ecm.RemoveComponent(_entity); return true; }); @@ -3644,16 +3644,16 @@ void PhysicsPrivate::UpdateSim(EntityComponentManager &_ecm, GZ_PROFILE_END(); _ecm.Each( - [&](const Entity &, components::AngularVelocityCmd *_vel) -> bool + [&](const Entity &_entity, components::AngularVelocityCmd *) -> bool { - _vel->Data() = math::Vector3d::Zero; + _ecm.RemoveComponent(_entity); return true; }); _ecm.Each( - [&](const Entity &, components::LinearVelocityCmd *_vel) -> bool + [&](const Entity &_entity, components::LinearVelocityCmd *) -> bool { - _vel->Data() = math::Vector3d::Zero; + _ecm.RemoveComponent(_entity); return true; });