18 #ifndef BRAKE_TEST_EXECUTOR_NODE_SERVICE_CALLS_H 19 #define BRAKE_TEST_EXECUTOR_NODE_SERVICE_CALLS_H 22 #include <std_srvs/Trigger.h> 24 #include <prbt_hardware_support/BrakeTestErrorCodes.h> 25 #include <prbt_hardware_support/BrakeTest.h> 26 #include <prbt_hardware_support/SendBrakeTestResult.h> 35 std_srvs::Trigger srv;
36 if ( !client.call(srv) )
38 ROS_WARN_STREAM(
"Calling service " << client.getService() <<
" failed.");
42 if (!srv.response.success)
45 <<
" failed with error message\n:" 46 << srv.response.message);
55 if ( !client.call(srv) )
57 ROS_WARN_STREAM(
"Calling service " << client.getService() <<
" failed.");
58 BrakeTest::Response res;
60 res.error_msg =
"Failed to trigger brake test via service " + client.getService();
61 res.error_code.value = BrakeTestErrorCodes::TRIGGER_BRAKETEST_SERVICE_FAILURE;
69 const bool brake_test_result)
72 SendBrakeTestResult srv;
73 srv.request.result = brake_test_result;
74 return client.call(srv);
79 #endif // BRAKE_TEST_EXECUTOR_NODE_SERVICE_CALLS_H static bool sendBrakeTestResultCall(T &client, const bool brake_test_result)
static void triggerServiceCall(T &client)
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
static BrakeTest::Response executeBrakeTestCall(T &client)