Skip to content

Use pose multiplication instead of addition #1369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ math::Pose3d worldPose(const Entity &_entity,
if (!parentPose)
break;
// transform pose
pose = pose + parentPose->Data();
pose = parentPose->Data() * pose;
// keep going up the tree
p = _ecm.Component<components::ParentEntity>(p->Data());
}
Expand Down
4 changes: 2 additions & 2 deletions src/rendering/RenderUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ void RenderUtil::Update()
trajPose.Rot() = tf.second["actorPose"].Rotation();
}

actorVisual->SetLocalPose(trajPose + globalPose);
actorVisual->SetLocalPose(globalPose * trajPose);

tf.second.erase("actorPose");
actorMesh->SetSkeletonLocalTransforms(tf.second);
Expand Down Expand Up @@ -3035,7 +3035,7 @@ void RenderUtilPrivate::UpdateAnimation(const std::unordered_map<Entity,
trajPose.Rot() = poseFrame.Rotation();
}

actorVisual->SetLocalPose(trajPose + globalPose);
actorVisual->SetLocalPose(globalPose * trajPose);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/systems/optical_tactile_plugin/Visualization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ void OpticalTactilePluginVisualization::AddNormalForceToMarkerMsgs(
ignition::math::Pose3f normalForcePoseFromSensor(
normalForcePositionFromSensor, normalForceOrientationFromSensor);

ignition::math::Pose3f normalForcePoseFromWorld =
(normalForcePoseFromSensor + this->depthCameraOffset) + _sensorWorldPose;
ignition::math::Pose3f normalForcePoseFromWorld = _sensorWorldPose *
this->depthCameraOffset * normalForcePoseFromSensor;
normalForcePoseFromWorld.Correct();

// Get the start point of the normal force
Expand All @@ -222,8 +222,8 @@ void OpticalTactilePluginVisualization::AddNormalForceToMarkerMsgs(
normalForcePoseFromSensor.Set(normalForcePositionFromSensor +
_normalForce * this->forceLength, normalForceOrientationFromSensor);

normalForcePoseFromWorld =
(normalForcePoseFromSensor + this->depthCameraOffset) + _sensorWorldPose;
normalForcePoseFromWorld = _sensorWorldPose * this->depthCameraOffset *
normalForcePoseFromSensor;
normalForcePoseFromWorld.Correct();

ignition::math::Vector3f endPointFromWorld =
Expand Down