问题描述
我试图在代码中切换控制器,但它一直返回 false,我不知道为什么,这是代码:
ros::ServiceClient switch_controller = n.serviceClient<controller_manager_msgs::SwitchController>("egm/controller_manager/switch_controller");
std::vector<std::string> start_controller;
start_controller.push_back("joint_group_veLocity_controller");
std::vector<std::string> stop_controller;
stop_controller.push_back("");
switch_controller_req.start_controllers = start_controller;
switch_controller_req.stop_controllers = stop_controller;
switch_controller_req.strictness = 1;
switch_controller_req.start_asap = false;
switch_controller_req.timeout = 0.0;
ros::service::waitForService("egm/controller_manager/switch_controller",ros::Duration(5));
success = stop_rapid.call(switch_controller_req,switch_controller_resp);
if (success)
{
ROS_INFO_STREAM("Controller switch correctly");
}
else
{
ROS_ERROR_STREAM("Error occured trying to switch controller");
return 0;
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)