Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add const getters in HumanoidDynamicRobot class.

  • Loading branch information...
commit 4564809ba730c5db0c1a942a003354c8940dfbaf 1 parent 94d60b9
Antonio El Khoury authored
View
42 include/ard/rbdl/model/humanoid-dynamic-robot.hh
@@ -428,6 +428,48 @@ namespace ard
/// \}
+ protected:
+ /// \brief Get a pointer to the waist.
+ virtual void waist (jointWkPtr_t& waist) const;
+
+ /// \brief Get a pointer to the chest.
+ ///
+ ///\note for some humanoid robots, the waist and the chest are
+ ///the same joints.
+ virtual void chest (jointWkPtr_t& chest) const;
+
+ /// \brief Get a pointer to the left wrist.
+ virtual void leftWrist (jointWkPtr_t& leftWrist) const;
+
+ /// \brief Get a pointer to the right wrist.
+ virtual void rightWrist (jointWkPtr_t& rightWrist) const;
+
+ /// \brief Set the pointer to the right hand.
+ virtual void rightHand (handShPtr_t& rightHand) const;
+
+ /// \brief Set the pointer to the left hand.
+ virtual void leftHand (handShPtr_t& leftHand) const;
+
+ /// \brief Get the hand clench value.
+ /// This is a scalar value ranging between 0 and 1 which
+ /// describes the hand clench (0 for open and 1 for closed hand)
+ virtual double getHandClench (to_pointer<CjrlHand>::type hand) const;
+
+ /// \brief Get a pointer to the left ankle.
+ virtual void leftAnkle (jointWkPtr_t& leftAnkle) const;
+
+ /// \brief Get a pointer to the right ankle.
+ virtual void rightAnkle (jointWkPtr_t& rightAnkle) const;
+
+ /// \brief Set the pointer to the left foot joint.
+ virtual void leftFoot (footShPtr_t& leftFoot) const;
+
+ /// \brief Set the pointer to the right foot joint.
+ virtual void rightFoot (footShPtr_t& rightFoot) const;
+
+ /// \brief Get gaze joint.
+ virtual void gazeJoint (jointWkPtr_t& gazeJoint) const;
+
private:
/// \brief Dynamic robot attribute.
dynamicRobotShPtr_t dynamicRobot_;
View
69 src/humanoid-dynamic-robot.cc
@@ -500,6 +500,75 @@ namespace ard
{
return zeroMomentPoint_;
}
+
+ void HumanoidDynamicRobot::waist (jointWkPtr_t& waist) const
+ {
+ waist = getSharedPointer (waist_);
+ }
+
+ void HumanoidDynamicRobot::chest (jointWkPtr_t& chest) const
+ {
+ chest = getSharedPointer (chest_);
+ }
+
+ void HumanoidDynamicRobot::leftWrist (jointWkPtr_t& leftWrist) const
+ {
+ leftWrist = getSharedPointer (leftWrist_);
+ }
+
+ void HumanoidDynamicRobot::rightWrist (jointWkPtr_t& rightWrist) const
+ {
+ rightWrist = getSharedPointer (rightWrist_);
+ }
+
+ void HumanoidDynamicRobot::rightHand (handShPtr_t& rightHand) const
+ {
+ rightHand = rightHand_;
+ }
+
+ void HumanoidDynamicRobot::leftHand (handShPtr_t& leftHand) const
+ {
+ leftHand = leftHand_;
+ }
+
+ double
+ HumanoidDynamicRobot::getHandClench (to_pointer<CjrlHand>::type hand) const
+ {
+ ardHandPtr_t rightHandPtr = getUnsafePointer (rightHand_);
+ ardHandPtr_t leftHandPtr = getUnsafePointer (leftHand_);
+ ardHandPtr_t handPtr = getUnsafePointer (hand);
+ if (rightHandPtr == handPtr)
+ return rightHandClench_;
+ else if (leftHandPtr == handPtr)
+ return leftHandClench_;
+ else
+ throw std::runtime_error ("Hand pointer not found in robot.");
+ }
+
+ void HumanoidDynamicRobot::leftAnkle (jointWkPtr_t& leftAnkle) const
+ {
+ leftAnkle = getSharedPointer (leftAnkle_);
+ }
+
+ void HumanoidDynamicRobot::rightAnkle (jointWkPtr_t& rightAnkle) const
+ {
+ rightAnkle = getSharedPointer (rightAnkle_);
+ }
+
+ void HumanoidDynamicRobot::leftFoot (footShPtr_t& leftFoot) const
+ {
+ leftFoot = leftFoot_;
+ }
+
+ void HumanoidDynamicRobot::rightFoot (footShPtr_t& rightFoot) const
+ {
+ rightFoot = rightFoot_;
+ }
+
+ void HumanoidDynamicRobot::gazeJoint (jointWkPtr_t& gazeJoint) const
+ {
+ gazeJoint = getSharedPointer (gazeJoint_);
+ }
} // end of namespace rbdl.
} // end of namespace ard.
Please sign in to comment.
Something went wrong with that request. Please try again.