Skip to content

Commit

Permalink
Use pose multiplication instead of addition (#573)
Browse files Browse the repository at this point in the history
The ign-math Pose addition operator is going to be
deprecated, so use the multiplication operator instead.
It works in the opposite order, matching the behavior
of coordinate transform multiplication.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Mar 2, 2022
1 parent e212e06 commit e9516be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/ignition/rendering/base/BaseCamera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ namespace ignition
{
math::Pose3d targetCamPose = math::Pose3d(this->followOffset,
this->WorldRotation());
targetCamPose += this->followNode->WorldPose();
targetCamPose = this->followNode->WorldPose() * targetCamPose;

math::Vector3d pos = this->WorldPosition() +
(targetCamPose.Pos() - this->WorldPosition()) * this->followPGain;
Expand All @@ -371,7 +371,7 @@ namespace ignition
}
else
{
targetPose += this->trackNode->WorldPose();
targetPose = this->trackNode->WorldPose() * targetPose;
}

math::Pose3d p =
Expand Down
2 changes: 1 addition & 1 deletion include/ignition/rendering/base/BaseJointVisual.hh
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ namespace ignition

// get rotation of joint visual in model frame
ignition::math::Quaterniond quatFromModel =
(this->LocalPose() + parentInitPose).Rot();
(parentInitPose * this->LocalPose()).Rot();

// rotate arrow visual so that the axis vector applies to the model
// frame.
Expand Down
2 changes: 1 addition & 1 deletion include/ignition/rendering/base/BaseNode.hh
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ namespace ignition
return pose;
}

return pose + parent->WorldPose();
return parent->WorldPose() * pose;
}

//////////////////////////////////////////////////
Expand Down

0 comments on commit e9516be

Please sign in to comment.