Go to the documentation of this file.
69 #include <control_msgs/JointControllerState.h>
70 #include <control_msgs/JointControllerState.h>
78 #include <std_msgs/Float64.h>
130 void setCommand(
double pos_target,
double vel_target);
147 void getGains(
double &p,
double &i,
double &d,
double &i_max,
double &i_min);
152 void getGains(
double &p,
double &i,
double &d,
double &i_max,
double &i_min,
bool &antiwindup);
162 void setGains(
const double &p,
const double &i,
const double &d,
const double &i_max,
const double &i_min,
const bool &antiwindup =
false);
193 void setCommandCB(
const std_msgs::Float64ConstPtr& msg);
void printDebug()
Print debug info to console.
void setCommandCB(const std_msgs::Float64ConstPtr &msg)
Callback from /command subscriber for setpoint.
void starting(const ros::Time &time)
This is called from within the realtime thread just before the first call to update.
void update(const ros::Time &time, const ros::Duration &period)
Issues commands to the joint. Should be called at regular intervals.
realtime_tools::RealtimeBuffer< Commands > command_
ros::Subscriber sub_command_
urdf::JointConstSharedPtr joint_urdf_
void enforceJointLimits(double &command)
Check that the command is within the hard limits of the joint. Checks for joint type first....
control_toolbox::Pid pid_controller_
std::string getJointName()
Get the name of the joint this controller uses.
Store position and velocity command in struct to allow easier realtime buffer usage.
void getGains(double &p, double &i, double &d, double &i_max, double &i_min)
Get the PID parameters.
void setCommand(double pos_target)
Give set position of the joint for next update: revolute (angle) and prismatic (position)
JointPositionController()
std::unique_ptr< realtime_tools::RealtimePublisher< control_msgs::JointControllerState > > controller_state_publisher_
hardware_interface::JointHandle joint_
Joint Position Controller.
~JointPositionController()
bool init(hardware_interface::VelocityJointInterface *robot, ros::NodeHandle &n)
The init function is called to initialize the controller from a non-realtime thread with a pointer to...
void setGains(const double &p, const double &i, const double &d, const double &i_max, const double &i_min, const bool &antiwindup=false)
Get the PID parameters.
double getPosition()
Get the current position of the joint.