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)
61 BrakeTest::Response& res)
66 res.error_msg =
"Robot is moving, cannot perform brake test";
67 res.error_code.value = BrakeTestErrorCodes::ROBOT_MOTION_DETECTED;
71 ROS_INFO_STREAM(
"Enter hold for braketest. Do not unhold the controller!");
76 ROS_INFO(
"Brake test result: %i", res.success);
79 ROS_INFO(
"Brake test error code: %i", res.error_code.value);
80 if (!res.error_msg.empty())
91 res.error_msg =
"Failed to send brake test result";
92 res.error_code.value = BrakeTestErrorCodes::FAILURE;
DetectRobotMotionFunc detect_robot_motion_func_
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
bool executeBrakeTest(BrakeTest::Request &req, BrakeTest::Response &response)
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)