#include <controller_manager.h>
Public Member Functions | |
ControllerManager (pr2_hardware_interface::HardwareInterface *hw, const ros::NodeHandle &nh=ros::NodeHandle()) | |
virtual pr2_controller_interface::Controller * | getControllerByName (const std::string &name) |
bool | initXml (TiXmlElement *config) |
bool | loadController (const std::string &name) |
bool | switchController (const std::vector< std::string > &start_controllers, const std::vector< std::string > &stop_controllers, const int strictness) |
bool | unloadController (const std::string &name) |
void | update () |
virtual | ~ControllerManager () |
Public Attributes | |
pr2_mechanism_model::Robot | model_ |
pr2_mechanism_model::RobotState * | state_ |
Private Member Functions | |
void | getControllerNames (std::vector< std::string > &v) |
void | getControllerSchedule (std::vector< size_t > &schedule) |
bool | listControllersSrv (pr2_mechanism_msgs::ListControllers::Request &req, pr2_mechanism_msgs::ListControllers::Response &resp) |
bool | listControllerTypesSrv (pr2_mechanism_msgs::ListControllerTypes::Request &req, pr2_mechanism_msgs::ListControllerTypes::Response &resp) |
bool | loadControllerSrv (pr2_mechanism_msgs::LoadController::Request &req, pr2_mechanism_msgs::LoadController::Response &resp) |
void | publishJointState () |
void | publishMechanismStatistics () |
bool | reloadControllerLibrariesSrv (pr2_mechanism_msgs::ReloadControllerLibraries::Request &req, pr2_mechanism_msgs::ReloadControllerLibraries::Response &resp) |
bool | switchControllerSrv (pr2_mechanism_msgs::SwitchController::Request &req, pr2_mechanism_msgs::SwitchController::Response &resp) |
bool | unloadControllerSrv (pr2_mechanism_msgs::UnloadController::Request &req, pr2_mechanism_msgs::UnloadController::Response &resp) |
Private Attributes | |
ros::NodeHandle | cm_node_ |
boost::shared_ptr < pluginlib::ClassLoader < pr2_controller_interface::Controller > > | controller_loader_ |
ros::NodeHandle | controller_node_ |
std::vector< ControllerSpec > | controllers_lists_ [2] |
boost::mutex | controllers_lock_ |
std::vector< size_t > | controllers_scheduling_ [2] |
int | current_controllers_list_ |
ros::Time | last_published_joint_state_ |
ros::Time | last_published_mechanism_stats_ |
bool | motors_previously_halted_ |
bool | please_switch_ |
Statistics | post_update_stats_ |
Statistics | pre_update_stats_ |
realtime_tools::RealtimePublisher < sensor_msgs::JointState > | pub_joint_state_ |
realtime_tools::RealtimePublisher < pr2_mechanism_msgs::MechanismStatistics > | pub_mech_stats_ |
ros::Duration | publish_period_joint_state_ |
ros::Duration | publish_period_mechanism_stats_ |
boost::mutex | services_lock_ |
ros::ServiceServer | srv_list_controller_types_ |
ros::ServiceServer | srv_list_controllers_ |
ros::ServiceServer | srv_load_controller_ |
ros::ServiceServer | srv_reload_libraries_ |
ros::ServiceServer | srv_switch_controller_ |
ros::ServiceServer | srv_unload_controller_ |
std::vector < pr2_controller_interface::Controller * > | start_request_ |
std::vector < pr2_controller_interface::Controller * > | stop_request_ |
int | switch_strictness_ |
Statistics | update_stats_ |
int | used_by_realtime_ |
Definition at line 60 of file controller_manager.h.
ControllerManager::ControllerManager | ( | pr2_hardware_interface::HardwareInterface * | hw, |
const ros::NodeHandle & | nh = ros::NodeHandle() |
||
) |
Definition at line 47 of file controller_manager.cpp.
ControllerManager::~ControllerManager | ( | ) | [virtual] |
Definition at line 63 of file controller_manager.cpp.
pr2_controller_interface::Controller * ControllerManager::getControllerByName | ( | const std::string & | name | ) | [virtual] |
Implements pr2_controller_interface::ControllerProvider.
Definition at line 191 of file controller_manager.cpp.
void ControllerManager::getControllerNames | ( | std::vector< std::string > & | v | ) | [private] |
Definition at line 202 of file controller_manager.cpp.
void ControllerManager::getControllerSchedule | ( | std::vector< size_t > & | schedule | ) | [private] |
Definition at line 212 of file controller_manager.cpp.
bool ControllerManager::initXml | ( | TiXmlElement * | config | ) |
Definition at line 70 of file controller_manager.cpp.
bool ControllerManager::listControllersSrv | ( | pr2_mechanism_msgs::ListControllers::Request & | req, |
pr2_mechanism_msgs::ListControllers::Response & | resp | ||
) | [private] |
Definition at line 753 of file controller_manager.cpp.
bool ControllerManager::listControllerTypesSrv | ( | pr2_mechanism_msgs::ListControllerTypes::Request & | req, |
pr2_mechanism_msgs::ListControllerTypes::Response & | resp | ||
) | [private] |
Definition at line 734 of file controller_manager.cpp.
bool ControllerManager::loadController | ( | const std::string & | name | ) |
Definition at line 219 of file controller_manager.cpp.
bool ControllerManager::loadControllerSrv | ( | pr2_mechanism_msgs::LoadController::Request & | req, |
pr2_mechanism_msgs::LoadController::Response & | resp | ||
) | [private] |
Definition at line 790 of file controller_manager.cpp.
void ControllerManager::publishJointState | ( | ) | [private] |
Definition at line 555 of file controller_manager.cpp.
void ControllerManager::publishMechanismStatistics | ( | ) | [private] |
Definition at line 591 of file controller_manager.cpp.
bool ControllerManager::reloadControllerLibrariesSrv | ( | pr2_mechanism_msgs::ReloadControllerLibraries::Request & | req, |
pr2_mechanism_msgs::ReloadControllerLibraries::Response & | resp | ||
) | [private] |
Definition at line 684 of file controller_manager.cpp.
bool ControllerManager::switchController | ( | const std::vector< std::string > & | start_controllers, |
const std::vector< std::string > & | stop_controllers, | ||
const int | strictness | ||
) |
Definition at line 468 of file controller_manager.cpp.
bool ControllerManager::switchControllerSrv | ( | pr2_mechanism_msgs::SwitchController::Request & | req, |
pr2_mechanism_msgs::SwitchController::Response & | resp | ||
) | [private] |
Definition at line 822 of file controller_manager.cpp.
bool ControllerManager::unloadController | ( | const std::string & | name | ) |
Definition at line 370 of file controller_manager.cpp.
bool ControllerManager::unloadControllerSrv | ( | pr2_mechanism_msgs::UnloadController::Request & | req, |
pr2_mechanism_msgs::UnloadController::Response & | resp | ||
) | [private] |
Definition at line 806 of file controller_manager.cpp.
void ControllerManager::update | ( | void | ) |
Definition at line 126 of file controller_manager.cpp.
Definition at line 88 of file controller_manager.h.
boost::shared_ptr<pluginlib::ClassLoader<pr2_controller_interface::Controller> > pr2_controller_manager::ControllerManager::controller_loader_ [private] |
Definition at line 89 of file controller_manager.h.
Definition at line 88 of file controller_manager.h.
std::vector<ControllerSpec> pr2_controller_manager::ControllerManager::controllers_lists_[2] [private] |
Definition at line 98 of file controller_manager.h.
boost::mutex pr2_controller_manager::ControllerManager::controllers_lock_ [private] |
Definition at line 97 of file controller_manager.h.
std::vector<size_t> pr2_controller_manager::ControllerManager::controllers_scheduling_[2] [private] |
Definition at line 99 of file controller_manager.h.
Definition at line 100 of file controller_manager.h.
Definition at line 113 of file controller_manager.h.
Definition at line 113 of file controller_manager.h.
Definition at line 81 of file controller_manager.h.
Definition at line 131 of file controller_manager.h.
bool pr2_controller_manager::ControllerManager::please_switch_ [private] |
Definition at line 93 of file controller_manager.h.
Definition at line 105 of file controller_manager.h.
Definition at line 103 of file controller_manager.h.
realtime_tools::RealtimePublisher<sensor_msgs::JointState> pr2_controller_manager::ControllerManager::pub_joint_state_ [private] |
Definition at line 110 of file controller_manager.h.
realtime_tools::RealtimePublisher<pr2_mechanism_msgs::MechanismStatistics> pr2_controller_manager::ControllerManager::pub_mech_stats_ [private] |
Definition at line 111 of file controller_manager.h.
Definition at line 112 of file controller_manager.h.
Definition at line 112 of file controller_manager.h.
boost::mutex pr2_controller_manager::ControllerManager::services_lock_ [private] |
Definition at line 128 of file controller_manager.h.
Definition at line 129 of file controller_manager.h.
Definition at line 129 of file controller_manager.h.
Definition at line 129 of file controller_manager.h.
Definition at line 130 of file controller_manager.h.
Definition at line 130 of file controller_manager.h.
Definition at line 130 of file controller_manager.h.
std::vector<pr2_controller_interface::Controller*> pr2_controller_manager::ControllerManager::start_request_ [private] |
Definition at line 92 of file controller_manager.h.
Definition at line 82 of file controller_manager.h.
std::vector<pr2_controller_interface::Controller*> pr2_controller_manager::ControllerManager::stop_request_ [private] |
Definition at line 92 of file controller_manager.h.
Definition at line 94 of file controller_manager.h.
Definition at line 104 of file controller_manager.h.
Definition at line 100 of file controller_manager.h.