Skip to content
Open
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
37 changes: 33 additions & 4 deletions joint_limits/include/joint_limits/joint_limiter_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class JointLimiterInterface
* @param[in] param_itf node parameters interface object to access parameters.
* @param[in] logging_itf node logging interface to log if error happens.
* @param[in] robot_description_topic string of a topic where robot description is accessible.
* @return true if initialization was successful, otherwise false.
*/
virtual bool init(
const std::vector<std::string> & joint_names,
Expand Down Expand Up @@ -133,7 +134,14 @@ class JointLimiterInterface
}

/**
* @brief Initialize joints from directly provided names and limits.
* @brief Initialize joints from directly provided names, limits, and soft joint limits.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a detailed overview of the parameters and also for the other parts of the codebase

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the docstring with @param entries for all parameters and checked the rest of the codebase for similar issues.

*
* @param[in] joint_names names of the joints to initialize.
* @param[in] joint_limits hard joint limits for each joint.
* @param[in] soft_joint_limits soft joint limits for each joint.
* @param[in] param_itf node parameters interface for parameter handling.
* @param[in] logging_itf node logging interface for logging.
* @return true if initialization was successful, otherwise false.
*/
virtual bool init(
const std::vector<std::string> & joint_names,
Expand Down Expand Up @@ -164,6 +172,11 @@ class JointLimiterInterface
* @brief Initialize joints using a Node pointer.
*
* For details see other init method.
*
* @param[in] joint_names names of joints where limits should be applied.
* @param[in] node pointer to the node to get parameter and logging interfaces.
* @param[in] robot_description_topic string of a topic where robot description is accessible.
* @return true if initialization was successful, otherwise false.
*/
virtual bool init(
const std::vector<std::string> & joint_names, const rclcpp::Node::SharedPtr & node,
Expand All @@ -178,6 +191,12 @@ class JointLimiterInterface
* @brief Initialize joints using a LifecycleNode pointer.
*
* For details see other init method.
*
* @param[in] joint_names names of joints where limits should be applied.
* @param[in] lifecycle_node pointer to the lifecycle node to get parameter and logging
* interfaces.
* @param[in] robot_description_topic string of a topic where robot description is accessible.
* @return true if initialization was successful, otherwise false.
*/
virtual bool init(
const std::vector<std::string> & joint_names,
Expand All @@ -189,6 +208,12 @@ class JointLimiterInterface
lifecycle_node->get_node_logging_interface(), robot_description_topic);
}

/**
* @brief Configure the joint limiter with the current joint states.
*
* @param[in] current_joint_states current joint states a robot is in.
* @return true if configuration was successful, otherwise false.
*/
Comment thread
Rudyy75 marked this conversation as resolved.
virtual bool configure(const JointLimitsStateDataType & current_joint_states)
{
return on_configure(current_joint_states);
Expand All @@ -212,6 +237,9 @@ class JointLimiterInterface
return on_enforce(current_joint_states, desired_joint_states, dt);
}

/**
* @brief Reset the internal states of the joint limiter.
*/
virtual void reset_internals() = 0;

protected:
Expand All @@ -227,15 +255,16 @@ class JointLimiterInterface
* @brief Configure the limiter's internal states and libraries.
*
* Implementation-specific configuration of limiter's internal states and libraries.
* @return true if initialization was successful, otherwise false.
*
* @param[in] current_joint_states current joint states a robot is in.
* @return true if configuration was successful, otherwise false.
*/
virtual bool on_configure(const JointLimitsStateDataType & current_joint_states) = 0;

/**
* @brief Enforce joint limits for multiple dependent physical quantities.
*
* Filter-specific implementation of the joint limits enforce algorithm for multiple dependent
* physical quantities.
* Filter-specific implementation of the joint limits enforce algorithm.
*
* @param[in] current_joint_states current joint states a robot is in.
* @param[in,out] desired_joint_states joint state that should be adjusted to obey the limits.
Expand Down
Loading