Skip to content

Commit

Permalink
Add accessors (#419)
Browse files Browse the repository at this point in the history
* edit: joint.hpp

add accessors of scale and offset

* edit: segment.hpp

add accessor of f_tip

* edit: rigidbodyinertia.hpp

add accessor of h

* edit: rigidbodyinertia.hpp

change return types of getMass() and getRotationalInertia()

* edit: TreeFkSolverPos_recursive,TreeJntToJacSolver

privat variale this->tree to a const reference

* edit: rigidbodyinertia.hpp

const double& getMass() -> double getMass()

* (joint) Update return types and docstrings

* Revert class member type change

Not ABI compatible

* (joint) change return types

* Revert class member ref change

Not ABI compatible

* (RigidBodyInertia) revert return type change

Not ABI compatible

* Add missing docstring

* edit : segment.hpp

getFrameToTipRaw -> getFrameToTipZero
add docstring to get FrameToTipZero

* edit: segment.hpp

add docstring to get FrameToTipZero

Co-authored-by: Matthijs van der Burgh <MatthijsBurgh@outlook.com>
  • Loading branch information
Masa0u0 and MatthijsBurgh authored Nov 27, 2022
1 parent 4cc7cf9 commit 9a35f0a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
40 changes: 40 additions & 0 deletions orocos_kdl/src/joint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,26 @@ namespace KDL {
}
};

/**
* Request the scale of the joint.
*
* @return const reference to the scale of the joint
*/
const double& getScale() const
{
return scale;
}

/**
* Request the offset of the joint.
*
* @return const reference to the offset of the joint
*/
const double& getOffset() const
{
return offset;
}

/**
* Request the inertia of the joint.
*
Expand Down Expand Up @@ -222,6 +242,26 @@ namespace KDL {
return stiffness;
};

/**
* Request the axis of the joint.
*
* @return const reference to the axis of the joint
*/
const Vector& getAxis() const
{
return axis;
}

/**
* Request the origin of the joint.
*
* @return const reference to the origin of the joint
*/
const Vector& getOrigin() const
{
return origin;
}

virtual ~Joint();

private:
Expand Down
10 changes: 9 additions & 1 deletion orocos_kdl/src/rigidbodyinertia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ namespace KDL {
double getMass() const{
return m;
};


/**
* Get the spatial momentum of the rigid body
*/
const Vector& getSpatialMomentum() const
{
return h;
}

/**
* Get the center of gravity of the rigid body
*/
Expand Down
12 changes: 12 additions & 0 deletions orocos_kdl/src/segment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ namespace KDL {
* @param f_tip_new pose from the joint end to the tip of the segment
*/
void setFrameToTip(const Frame& f_tip_new);

/**
* Request the pose from the end of the joint to the tip of the segment
* at joint position 0.
*
* @return const reference to the pose from the end of the joint to the tip of the segment
* at joint position 0
*/
const Frame& getFrameToTipZero() const
{
return f_tip;
}
};
}//end of namespace KDL

Expand Down

0 comments on commit 9a35f0a

Please sign in to comment.