From e3eea62ca19e66f58b6d24e6fbfe9309e5362290 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel <guilhem.saurel@laas.fr> Date: Thu, 5 Dec 2024 23:53:27 +0100 Subject: [PATCH] Transform3f -> Transform3s --- include/hpp/manipulation/device.hh | 2 +- include/hpp/manipulation/fwd.hh | 2 +- include/hpp/manipulation/handle.hh | 10 +++++----- src/device.cc | 4 ++-- src/handle.cc | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hpp/manipulation/device.hh b/include/hpp/manipulation/device.hh index c4691642..62c3d68f 100644 --- a/include/hpp/manipulation/device.hh +++ b/include/hpp/manipulation/device.hh @@ -64,7 +64,7 @@ class HPP_MANIPULATION_DLLAPI Device : public pinocchio::HumanoidRobot { virtual std::ostream& print(std::ostream& os) const; void setRobotRootPosition(const std::string& robotName, - const Transform3f& positionWRTParentJoint); + const Transform3s& positionWRTParentJoint); virtual pinocchio::DevicePtr_t clone() const; diff --git a/include/hpp/manipulation/fwd.hh b/include/hpp/manipulation/fwd.hh index 516b7b78..e7033b9e 100644 --- a/include/hpp/manipulation/fwd.hh +++ b/include/hpp/manipulation/fwd.hh @@ -88,7 +88,7 @@ typedef constraints::RelativeTransformationR3xSO3 RelativeTransformationR3xSO3; typedef constraints::RelativeTransformationPtr_t RelativeTransformationPtr_t; typedef core::value_type value_type; typedef core::size_type size_type; -typedef core::Transform3f Transform3f; +typedef core::Transform3s Transform3s; typedef core::vector_t vector_t; typedef core::vectorIn_t vectorIn_t; typedef core::vectorOut_t vectorOut_t; diff --git a/include/hpp/manipulation/handle.hh b/include/hpp/manipulation/handle.hh index 04291ace..617f1afb 100644 --- a/include/hpp/manipulation/handle.hh +++ b/include/hpp/manipulation/handle.hh @@ -66,7 +66,7 @@ class HPP_MANIPULATION_DLLAPI Handle { /// \return the constraint of relative position between the handle and /// the gripper. static HandlePtr_t create(const std::string& name, - const Transform3f& localPosition, + const Transform3s& localPosition, const DeviceWkPtr_t& robot, const JointPtr_t& joint) { Handle* ptr = new Handle(name, localPosition, robot, joint); @@ -98,10 +98,10 @@ class HPP_MANIPULATION_DLLAPI Handle { /// \} /// Get local position in joint frame - const Transform3f& localPosition() const { return localPosition_; } + const Transform3s& localPosition() const { return localPosition_; } /// Set local position in joint frame - void localPosition(const Transform3f& localPosition) { + void localPosition(const Transform3s& localPosition) { localPosition_ = localPosition; } @@ -175,7 +175,7 @@ class HPP_MANIPULATION_DLLAPI Handle { /// \param grasp object containing the grasp information /// \return the constraint of relative position between the handle and /// the gripper. - Handle(const std::string& name, const Transform3f& localPosition, + Handle(const std::string& name, const Transform3s& localPosition, const DeviceWkPtr_t& robot, const JointPtr_t& joint) : name_(name), localPosition_(localPosition), @@ -192,7 +192,7 @@ class HPP_MANIPULATION_DLLAPI Handle { private: std::string name_; /// Position of the handle in the joint frame. - Transform3f localPosition_; + Transform3s localPosition_; /// Joint to which the handle is linked. JointPtr_t joint_; /// Pointer to the robot diff --git a/src/device.cc b/src/device.cc index 2cb2d749..36d28645 100644 --- a/src/device.cc +++ b/src/device.cc @@ -50,7 +50,7 @@ pinocchio::DevicePtr_t Device::clone() const { return shPtr; } -void Device::setRobotRootPosition(const std::string& rn, const Transform3f& t) { +void Device::setRobotRootPosition(const std::string& rn, const Transform3s& t) { FrameIndices_t idxs = robotFrames(rn); if (idxs.size() == 0) throw std::invalid_argument("No frame for robot name " + rn); @@ -65,7 +65,7 @@ void Device::setRobotRootPosition(const std::string& rn, const Transform3f& t) { return; } - Transform3f shift(t * rootFrame.placement.inverse()); + Transform3s shift(t * rootFrame.placement.inverse()); // Find all the frames that have the same parent joint. for (std::size_t i = 1; i < idxs.size(); ++i) { Frame& frame = m.frames[idxs[i]]; diff --git a/src/handle.cc b/src/handle.cc index 6cb59a76..e7fdf038 100644 --- a/src/handle.cc +++ b/src/handle.cc @@ -204,8 +204,8 @@ ImplicitPtr_t Handle::createGraspAndComplement(const GripperPtr_t& gripper, ImplicitPtr_t Handle::createPreGrasp(const GripperPtr_t& gripper, const value_type& shift, std::string n) const { - Transform3f M = gripper->objectPositionInJoint() * - Transform3f(I3, vector3_t(shift, 0, 0)); + Transform3s M = gripper->objectPositionInJoint() * + Transform3s(I3, vector3_t(shift, 0, 0)); if (n.empty()) n = "Pregrasp_ " + maskToStr(mask_) + "_" + name() + "_" + gripper->name(); ImplicitPtr_t result(Implicit::create( -- GitLab