ros-controls / ros_controllers

Generic robotic controllers to accompany ros_control
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
560 stars 526 forks source link

velocity is unavailable in effort_controllers/JointPositionController #544

Open leaf0810 opened 3 years ago

leaf0810 commented 3 years ago

In joint_position_controller.h ,there is

struct Commands
  {
    double position_; // Last commanded position
    double velocity_; // Last commanded velocity
    bool has_velocity_; // false if no velocity command has been specified
  };

but in joint_position_controller.cpp,

void JointPositionController::setCommandCB(const std_msgs::Float64ConstPtr& msg)
{
  setCommand(msg->data);
}

the parameter is only one! why not apply velocity interface?

matthew-reynolds commented 3 years ago

Looks like something that was added in 2013 (https://github.com/ros-controls/ros_controllers/pull/35) to lay the groundwork in case anyone wanted to build on it later, but no one ever found it necessary to use the feature so it's been sitting there untouched ever since (Except for a small bugfix in https://github.com/ros-controls/ros_controllers/issues/52).

If it's something you need, please consider opening a PR and describing the usage.