Skip to content

Commit

Permalink
Merge branch 'gz-sim8' into feature/break-out-server-constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoenig authored Oct 4, 2024
2 parents c32ebee + 63b210a commit bdf7522
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/systems/physics/Physics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,14 @@ void PhysicsPrivate::UpdatePhysics(EntityComponentManager &_ecm)
<< std::endl;
return true;
}
math::Pose3d worldPoseCmd = _poseCmd->Data();
if (!worldPoseCmd.Pos().IsFinite() || !worldPoseCmd.Rot().IsFinite() ||
worldPoseCmd.Rot() == math::Quaterniond::Zero)
{
gzerr << "Unable to set world pose. Invalid pose value: "
<< worldPoseCmd << std::endl;
return true;
}

// TODO(addisu) Store the free group instead of searching for it at
// every iteration
Expand All @@ -2423,7 +2431,7 @@ void PhysicsPrivate::UpdatePhysics(EntityComponentManager &_ecm)
math::Pose3d linkPose =
this->RelativePose(_entity, linkEntity, _ecm);

freeGroup->SetWorldPose(math::eigen3::convert(_poseCmd->Data() *
freeGroup->SetWorldPose(math::eigen3::convert(worldPoseCmd *
linkPose));

// Process pose commands for static models here, as one-time changes
Expand All @@ -2432,7 +2440,7 @@ void PhysicsPrivate::UpdatePhysics(EntityComponentManager &_ecm)
auto worldPoseComp = _ecm.Component<components::Pose>(_entity);
if (worldPoseComp)
{
auto state = worldPoseComp->SetData(_poseCmd->Data(),
auto state = worldPoseComp->SetData(worldPoseCmd,
this->pose3Eql) ?
ComponentState::OneTimeChange :
ComponentState::NoChange;
Expand Down

0 comments on commit bdf7522

Please sign in to comment.