44 : m_common_tcp(common_tcp), m_cola_binary(cola_binary)
69 std::string sopasRequest = std::string(
"\x02") + sopasCmd +
"\x03";
73 std::vector<unsigned char> reqBinary;
74 m_common_tcp->convertAscii2BinaryCmd(sopasRequest.c_str(), &reqBinary);
75 result = m_common_tcp->sendSopasAndCheckAnswer(reqBinary, &sopasReplyBin, -1);
79 result = m_common_tcp->sendSopasAndCheckAnswer(sopasRequest.c_str(), &sopasReplyBin, -1);
83 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer: error sending sopas command \"" << sopasCmd <<
"\"");
87 sopasReplyString = m_common_tcp->sopasReplyToString(sopasReplyBin);
88 ROS_INFO_STREAM(
"SickScanServices: Request \"" << sopasCmd <<
"\" successfully sent, received reply \"" << sopasReplyString <<
"\"");
94 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer: m_common_tcp not initialized");
107 std::string sopasCmd = service_request.request;
108 std::vector<unsigned char> sopasReplyBin;
109 std::string sopasReplyString;
111 if(!sendSopasAndCheckAnswer(sopasCmd, sopasReplyBin, sopasReplyString))
113 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer failed on sending command\"" << sopasCmd <<
"\"");
118 ROS_INFO_STREAM(
"SickScanServices: response: \"" << sopasReplyString <<
"\"");
120 service_response.response = sopasReplyString;
133 std::string sopasCmd = std::string(
"sEN ECRChangeArr ") + (service_request.active ?
"1" :
"0");
134 std::vector<unsigned char> sopasReplyBin;
135 std::string sopasReplyString;
137 if(!sendSopasAndCheckAnswer(sopasCmd, sopasReplyBin, sopasReplyString))
139 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer failed on sending command\"" << sopasCmd <<
"\"");
144 ROS_INFO_STREAM(
"SickScanServices: response: \"" << sopasReplyString <<
"\"");
158 std::string sopasCmd = std::string(
"sEN LIDoutputstate ") + (service_request.active ?
"1" :
"0");
159 std::vector<unsigned char> sopasReplyBin;
160 std::string sopasReplyString;
162 if(!sendSopasAndCheckAnswer(sopasCmd, sopasReplyBin, sopasReplyString))
164 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer failed on sending command\"" << sopasCmd <<
"\"");
169 ROS_INFO_STREAM(
"SickScanServices: response: \"" << sopasReplyString <<
"\"");