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;
83 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer: error sending sopas command \"" << sopasCmd <<
"\"");
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;
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;
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;
164 ROS_ERROR_STREAM(
"## ERROR SickScanServices::sendSopasAndCheckAnswer failed on sending command\"" << sopasCmd <<
"\"");
169 ROS_INFO_STREAM(
"SickScanServices: response: \"" << sopasReplyString <<
"\"");
virtual ~SickScanServices()
SickScanServices(ros::NodeHandle *nh=0, sick_scan::SickScanCommonTcp *common_tcp=0, bool cola_binary=true)
int convertAscii2BinaryCmd(const char *requestAscii, std::vector< unsigned char > *requestBinary)
Convert ASCII-message to Binary-message.
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool serviceCbColaMsg(sick_scan::ColaMsgSrv::Request &service_request, sick_scan::ColaMsgSrv::Response &service_response)
ros::ServiceServer m_srv_server_LIDoutputstate
service "LIDoutputstate", &sick_scan::SickScanServices::serviceCbLIDoutputstate
bool m_cola_binary
cola ascii or cola binary messages
std::string sopasReplyToString(const std::vector< unsigned char > &reply)
Converts reply from sendSOPASCommand to string.
ros::ServiceServer m_srv_server_ColaMsg
service "ColaMsg", &sick_scan::SickScanServices::serviceCbColaMsg
bool serviceCbLIDoutputstate(sick_scan::LIDoutputstateSrv::Request &service_request, sick_scan::LIDoutputstateSrv::Response &service_response)
#define ROS_INFO_STREAM(args)
int sendSopasAndCheckAnswer(std::string request, std::vector< unsigned char > *reply, int cmdId)
send command and check answer
sick_scan::SickScanCommonTcp * m_common_tcp
common tcp handler
bool sendSopasAndCheckAnswer(const std::string &sopasCmd, std::vector< unsigned char > &sopasReplyBin, std::string &sopasReplyString)
bool serviceCbECRChangeArr(sick_scan::ECRChangeArrSrv::Request &service_request, sick_scan::ECRChangeArrSrv::Response &service_response)
#define ROS_ERROR_STREAM(args)
ros::ServiceServer m_srv_server_ECRChangeArr
service "ECRChangeArr", &sick_scan::SickScanServices::serviceCbECRChangeArr