64 std::string param_name =
"joints";
101 urdf::JointConstSharedPtr joint_urdf = urdf.getJoint(joint_name);
104 ROS_ERROR(
"Could not find joint '%s' in urdf", joint_name.c_str());
112 ROS_ERROR_STREAM(
"Failed to load PID parameters from " << joint_name +
"/pid");
128 double command_position = commands[i];
131 double commanded_effort;
133 double current_position =
joints_[i].getPosition();
148 else if (
joint_urdfs_[i]->type == urdf::Joint::CONTINUOUS)
154 error = command_position - current_position;
161 joints_[i].setCommand(commanded_effort);
169 ROS_ERROR_STREAM(
"Dimension of command (" << msg->data.size() <<
") does not match number of joints (" <<
n_joints_ <<
")! Not executing!");
~JointGroupPositionController()
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
std::vector< hardware_interface::JointHandle > joints_
void commandCB(const std_msgs::Float64MultiArrayConstPtr &msg)
Forward command controller for a set of effort controlled joints (torque or force).
JointGroupPositionController()
Forward command controller for a set of effort controlled joints (torque or force).
void enforceJointLimits(double &command, unsigned int index)
void update(const ros::Time &, const ros::Duration &)
const char * what() const noexcept override
std::vector< std::string > joint_names_
bool getParam(const std::string &key, std::string &s) const
ros::Subscriber sub_command_
URDF_EXPORT bool initParam(const std::string ¶m)
std::vector< control_toolbox::Pid > pid_controllers_
realtime_tools::RealtimeBuffer< std::vector< double > > commands_buffer_
JointHandle getHandle(const std::string &name)
std::vector< urdf::JointConstSharedPtr > joint_urdfs_
const std::string & getNamespace() const
#define ROS_ERROR_STREAM(args)
bool init(hardware_interface::EffortJointInterface *hw, ros::NodeHandle &n)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
def shortest_angular_distance(from_angle, to_angle)
def shortest_angular_distance_with_large_limits(from_angle, to_angle, left_limit, right_limit)