Skip to content

Commit

Permalink
added readyForSwitch
Browse files Browse the repository at this point in the history
  • Loading branch information
fmessmer committed Nov 1, 2014
1 parent 74f0d03 commit 24034f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ class ControllerManager{
const std::vector<std::string>& stop_controllers,
const int strictness);

/** \brief Notification for switching HW-Interfaces.
*
* \param info_list A list containing ControlInfo about the controllers to be started (containing the HW-Interfaces requested by the resources)
*/
virtual bool notifyHardwareInterface(const std::list<hardware_interface::ControllerInfo> &info_list) {return true;}

/** \brief Get a controller by name.
*
* \param name The name of a controller
Expand Down
10 changes: 8 additions & 2 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ bool ControllerManager::switchController(const std::vector<std::string>& start_c
start_request_.clear();
return false;
}

if(!notifyHardwareInterface(info_list))
{
ROS_ERROR("Could not switch controllers, because switching the HWInterface failed");
stop_request_.clear();
start_request_.clear();
return false;
}

// start the atomic controller switching
switch_strictness_ = strictness;
Expand All @@ -460,8 +468,6 @@ bool ControllerManager::switchController(const std::vector<std::string>& start_c





bool ControllerManager::reloadControllerLibrariesSrv(
controller_manager_msgs::ReloadControllerLibraries::Request &req,
controller_manager_msgs::ReloadControllerLibraries::Response &resp)
Expand Down

0 comments on commit 24034f0

Please sign in to comment.