18 #include <pilz_msgs/BrakeTest.h> 28 : detect_robot_motion_func_(detect_robot_motion_func)
29 , hold_controller_func_(controller_hold_func)
30 , execute_brake_test_func_(trigger_brake_test_func)
31 , unhold_controller_func_(unhold_func)
32 , brake_test_result_func_(brake_test_result_func)
65 res.error_msg =
"Robot is moving, cannot perform brake test";
69 ROS_INFO_STREAM(
"Enter hold for braketest. Do not unhold the controller!");
74 ROS_INFO(
"Brake test result: %i", adapter_result.success);
75 if (!adapter_result.success)
77 ROS_INFO(
"Brake test error code: %i", adapter_result.error_code.value);
78 if (!adapter_result.error_msg.empty())
89 res.error_msg =
"Failed to send brake test result";
93 res.success = adapter_result.success;
94 res.error_msg = adapter_result.error_msg;
DetectRobotMotionFunc detect_robot_motion_func_
bool executeBrakeTest(pilz_msgs::BrakeTest::Request &req, pilz_msgs::BrakeTest::Response &response)
std::function< void()> ControllerHoldFunc
BrakeTestResultFunc brake_test_result_func_
TriggerBrakeTestFunc execute_brake_test_func_
ControllerUnholdFunc unhold_controller_func_
std::function< BrakeTest::Response()> TriggerBrakeTestFunc
std::function< bool(const bool)> BrakeTestResultFunc
std::function< bool()> DetectRobotMotionFunc
#define ROS_INFO_STREAM(args)
ControllerHoldFunc hold_controller_func_
std::function< void()> ControllerUnholdFunc
BrakeTestExecutor(DetectRobotMotionFunc &&detect_robot_motion_func, ControllerHoldFunc &&controller_hold_func, TriggerBrakeTestFunc &&trigger_brake_test_func, ControllerUnholdFunc &&unhold_func, BrakeTestResultFunc &&brake_test_result_fun)