22 std::vector<std::string>& joint_names,
double max_vel_change, std::string wrench_frame)
23 : controller_(this, nh_)
24 , robot_state_received_(false)
25 , joint_interface_(joint_names)
26 , wrench_interface_(wrench_frame)
27 , position_interface_(follower, joint_interface_, joint_names)
28 , velocity_interface_(commander, joint_interface_, joint_names, max_vel_change)
42 const std::list<hardware_interface::ControllerInfo>& stop_list)
44 LOG_INFO(
"Switching hardware interface");
48 LOG_INFO(
"Stopping active interface");
53 for (
auto const& ci : start_list)
55 std::string requested_interface(
"");
57 #if defined(UR_ROS_CONTROL_INTERFACE_OLD_ROS_CONTROL) 58 requested_interface = ci.hardware_interface;
60 if (!ci.claimed_resources.empty())
61 requested_interface = ci.claimed_resources[0].hardware_interface;
69 auto new_interface = ait->second;
71 LOG_INFO(
"Starting %s", ci.name.c_str());
74 new_interface->
start();
79 if (start_list.size() > 0)
80 LOG_WARN(
"Failed to start interface!");
void update(RTShared &packet)
ROSController(URCommander &commander, TrajectoryFollower &follower, std::vector< std::string > &joint_names, double max_vel_change, std::string wrench_frame)
IMETHOD Vector diff(const Vector &p_w_a, const Vector &p_w_b, double dt=1)
void registerInterface(T *interface)
VelocityInterface velocity_interface_
void doSwitch(const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list)
HardwareInterface * active_interface_
JointInterface joint_interface_
virtual void onRobotStateChange(RobotState state)
PositionInterface position_interface_
#define LOG_INFO(format,...)
controller_manager::ControllerManager controller_
bool robot_state_received_
void registerControllereInterface(T *interface)
std::atomic< bool > service_enabled_
virtual void setupConsumer()
WrenchInterface wrench_interface_
void update(const ros::Time &time, const ros::Duration &period, bool reset_controllers=false)
void update(RTShared &packet)
std::map< std::string, HardwareInterface * > available_interfaces_
#define LOG_WARN(format,...)
std::atomic< uint32_t > service_cooldown_
void read(RTShared &state)