Go to the documentation of this file.
62 #include <control_msgs/JointControllerState.h>
63 #include <control_msgs/JointControllerState.h>
71 #include <std_msgs/Float64.h>
123 void setCommand(
double pos_target,
double vel_target);
140 void getGains(
double &p,
double &i,
double &d,
double &i_max,
double &i_min);
145 void getGains(
double &p,
double &i,
double &d,
double &i_max,
double &i_min,
bool &antiwindup);
155 void setGains(
const double &p,
const double &i,
const double &d,
const double &i_max,
const double &i_min,
const bool &antiwindup =
false);
186 void setCommandCB(
const std_msgs::Float64ConstPtr& msg);
void setGains(const double &p, const double &i, const double &d, const double &i_max, const double &i_min, const bool &antiwindup=false)
Set the PID parameters.
JointPositionController()
void getGains(double &p, double &i, double &d, double &i_max, double &i_min)
Get the PID parameters.
ros::Subscriber sub_command_
bool init(hardware_interface::EffortJointInterface *robot, ros::NodeHandle &n)
The init function is called to initialize the controller from a non-realtime thread with a pointer to...
void starting(const ros::Time &time)
This is called from within the realtime thread just before the first call to update.
void printDebug()
Print debug info to console.
control_toolbox::Pid pid_controller_
void update(const ros::Time &time, const ros::Duration &period)
Issues commands to the joint. Should be called at regular intervals.
hardware_interface::JointHandle joint_
std::unique_ptr< realtime_tools::RealtimePublisher< control_msgs::JointControllerState > > controller_state_publisher_
urdf::JointConstSharedPtr joint_urdf_
void setCommand(double pos_target)
Give set position of the joint for next update: revolute (angle) and prismatic (position)
realtime_tools::RealtimeBuffer< Commands > command_
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 enforceJointLimits(double &command)
Check that the command is within the hard limits of the joint. Checks for joint type first....
Joint Position Controller.
~JointPositionController()
double getPosition()
Get the current position of the joint.
void setCommandCB(const std_msgs::Float64ConstPtr &msg)
Callback from /command subscriber for setpoint.