Go to the documentation of this file.
40 #include <pr2_mechanism_controllers/BaseControllerState.h>
43 #include <geometry_msgs/Twist.h>
45 #include <boost/shared_ptr.hpp>
46 #include <boost/scoped_ptr.hpp>
82 void setCommand(
const geometry_msgs::Twist &cmd_vel);
206 boost::scoped_ptr<realtime_tools::RealtimePublisher<pr2_mechanism_controllers::BaseControllerState> >
state_publisher_;
236 geometry_msgs::Twist
interpolateCommand(
const geometry_msgs::Twist &start,
const geometry_msgs::Twist &end,
const geometry_msgs::Twist &max_rate,
const double &dT);
double timeout_
timeout specifying time that the controller waits before setting the current velocity command to zero
double alpha_stall_
low pass filter value used for finding stalls
void computeDesiredCasterSteer(const double &dT)
computes the desired caster speeds given the desired base speed
Pr2BaseController()
Default Constructor of the Pr2BaseController class.
pthread_mutex_t pr2_base_controller_lock_
mutex lock for setting and getting commands
ros::Time last_publish_time_
Time interval between state publishing.
boost::scoped_ptr< realtime_tools::RealtimePublisher< pr2_mechanism_controllers::BaseControllerState > > state_publisher_
publishes information about the caster and wheel controllers
double cmd_vel_trans_eps_
minimum tranlational velocity value allowable
~Pr2BaseController()
Destructor of the Pr2BaseController class.
geometry_msgs::Twist max_vel_
velocity limits specified externally
void setDesiredCasterSteer()
set the desired caster steer
double max_rotational_velocity_
maximum rotational velocity magnitude allowable
ros::NodeHandle root_handle_
bool new_cmd_available_
true when new command received by node
ros::Time cmd_received_timestamp_
timestamp corresponding to when the command received by the node
geometry_msgs::Twist max_accel_
acceleration limits specified externally
std::vector< control_toolbox::Pid > caster_position_pid_
The pid controllers for caster position.
void computeDesiredWheelSpeeds()
computes the desired wheel speeds given the desired base speed
geometry_msgs::Twist getCommand()
Returns the current position command.
geometry_msgs::Twist base_vel_msg_
callback message, used to remember where the base is commanded to go
void setJointCommands()
set the joint commands
double state_publish_time_
Time interval between state publishing.
void computeJointCommands(const double &dT)
computes the desired caster steers and wheel speeds
std::vector< double > filtered_velocity_
geometry_msgs::Twist cmd_vel_t_
Input speed command vector represents the desired speed requested by the node. Note that this may dif...
std::vector< boost::shared_ptr< JointVelocityController > > wheel_controller_
vector that stores the wheel controllers
void commandCallback(const geometry_msgs::TwistConstPtr &msg)
deal with Twist commands
void setDesiredWheelSpeeds()
sends the desired wheel speeds to the wheel controllers
BaseKinematics base_kin_
class where the robot's information is computed and stored
double cmd_vel_rot_eps_
minimum rotational velocity value allowable
double eps_
generic epsilon value that is used as a minimum or maximum allowable input value
void updateJointControllers()
tells the wheel and caster controllers to update their speeds
double max_translational_velocity_
maximum translational velocity magnitude allowable
void publishState(const ros::Time ¤t_time)
Publish the state.
void setCommand(const geometry_msgs::Twist &cmd_vel)
bool init(pr2_mechanism_model::RobotState *robot, ros::NodeHandle &n)
double kp_caster_steer_
local gain used for speed control of the caster (to achieve resultant position control)
double state_publish_rate_
geometry_msgs::Twist interpolateCommand(const geometry_msgs::Twist &start, const geometry_msgs::Twist &end, const geometry_msgs::Twist &max_rate, const double &dT)
interpolates velocities within a given time based on maximum accelerations
geometry_msgs::Twist desired_vel_
Input speed command vector represents the desired speed requested by the node.
geometry_msgs::Twist cmd_vel_
speed command vector used internally to represent the current commanded speed
void update()
(a) Updates commands to caster and wheels. Called every timestep in realtime
filters::MultiChannelTransferFunctionFilter< double > caster_vel_filter_
ros::Subscriber cmd_sub_deprecated_
ros::Time last_time_
time corresponding to when update was last called
std::vector< boost::shared_ptr< JointVelocityController > > caster_controller_
vector that stores the caster controllers