mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 18:10:47 +02:00
Fixed order of starting and stopping controllers
This commit is contained in:
@@ -211,6 +211,7 @@ bool UrHardwareInterface::canSwitch(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// we can always stop a controller
|
||||
return true;
|
||||
}
|
||||
@@ -218,21 +219,6 @@ bool UrHardwareInterface::canSwitch(
|
||||
void UrHardwareInterface::doSwitch(
|
||||
const std::list<hardware_interface::ControllerInfo>& start_list,
|
||||
const std::list<hardware_interface::ControllerInfo>& stop_list) {
|
||||
for (std::list<hardware_interface::ControllerInfo>::const_iterator controller_it =
|
||||
start_list.begin(); controller_it != start_list.end();
|
||||
++controller_it) {
|
||||
if (controller_it->hardware_interface
|
||||
== "hardware_interface::VelocityJointInterface") {
|
||||
velocity_interface_running_ = true;
|
||||
ROS_DEBUG("Starting velocity interface");
|
||||
}
|
||||
if (controller_it->hardware_interface
|
||||
== "hardware_interface::PositionJointInterface") {
|
||||
position_interface_running_ = true;
|
||||
robot_->uploadProg();
|
||||
ROS_DEBUG("Starting position interface");
|
||||
}
|
||||
}
|
||||
for (std::list<hardware_interface::ControllerInfo>::const_iterator controller_it =
|
||||
stop_list.begin(); controller_it != stop_list.end();
|
||||
++controller_it) {
|
||||
@@ -249,6 +235,21 @@ void UrHardwareInterface::doSwitch(
|
||||
ROS_DEBUG("Stopping position interface");
|
||||
}
|
||||
}
|
||||
for (std::list<hardware_interface::ControllerInfo>::const_iterator controller_it =
|
||||
start_list.begin(); controller_it != start_list.end();
|
||||
++controller_it) {
|
||||
if (controller_it->hardware_interface
|
||||
== "hardware_interface::VelocityJointInterface") {
|
||||
velocity_interface_running_ = true;
|
||||
ROS_DEBUG("Starting velocity interface");
|
||||
}
|
||||
if (controller_it->hardware_interface
|
||||
== "hardware_interface::PositionJointInterface") {
|
||||
position_interface_running_ = true;
|
||||
robot_->uploadProg();
|
||||
ROS_DEBUG("Starting position interface");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user