67 cola_ascii <<
"sMN DevSetLidarConfig";
68 cola_ascii << std::showpos <<
" +" << service_request.index <<
" +" << service_request.minrange <<
" +" << service_request.maxrange <<
" " << service_request.minangle <<
" " << service_request.maxangle
69 <<
" " << service_request.x <<
" " << service_request.y <<
" " << service_request.yaw
70 << std::noshowpos <<
" " << (service_request.upsidedown?1:0)
71 <<
" +" << service_request.ip.length() <<
" " << service_request.ip <<
" +" << service_request.port
72 <<
" " << service_request.interfacetype <<
" " << service_request.maplayer <<
" " << (service_request.active?1:0);
73 return cola_ascii.str();
84 service_response.set =
false;
85 service_response.executed =
false;
86 if(cola_response.parameter.size() == 2)
91 return service_response.set;
102 cola_ascii <<
"sMN DevGetLidarConfig";
103 cola_ascii << std::showpos <<
" " << service_request.scannerindex;
104 return cola_ascii.str();
115 if(cola_response.parameter.size() == 13)
125 service_response.ip = cola_response.parameter[8];
132 if(cola_response.parameter.size() >= 14)
144 service_response.ip = cola_response.parameter[n++];
145 while (n + 4 < cola_response.parameter.size() && service_response.ip.length() < ip_strlen)
147 service_response.ip = service_response.ip +
" " + cola_response.parameter[n++];
166 cola_ascii <<
"sMN LocSetMap +" << service_request.mapfilename.length() <<
" " << service_request.mapfilename;
167 return cola_ascii.str();
178 service_response.set =
false;
179 service_response.executed =
false;
180 if(cola_response.parameter.size() == 2)
185 return service_response.set;
196 cola_ascii <<
"sRN LocMap";
197 return cola_ascii.str();
208 service_response.success =
false;
209 if(cola_response.parameter.size() == 1)
211 service_response.map = cola_response.parameter[0];
212 service_response.success =
true;
214 if(cola_response.parameter.size() > 1)
217 service_response.map = cola_response.parameter[1];
218 for (
int n = 2; n < cola_response.parameter.size() && service_response.map.length() < str_len; n++)
220 service_response.map = service_response.map +
" " + cola_response.parameter[n];
222 service_response.success =
true;
224 return service_response.success;
235 cola_ascii <<
"sRN LocMapState";
236 return cola_ascii.str();
247 service_response.success =
false;
248 if(!cola_response.parameter.empty())
251 service_response.success =
true;
253 return service_response.success;
264 cola_ascii <<
"sMN LocInitializePose";
265 cola_ascii << std::showpos <<
" " << service_request.x <<
" " << service_request.y <<
" " << service_request.yaw <<
" +" << service_request.sigmatranslation;
266 return cola_ascii.str();
277 service_response.success =
false;
278 if(!cola_response.parameter.empty())
282 return service_response.success;
293 cola_ascii <<
"sRN LocInitialPose";
294 return cola_ascii.str();
305 service_response.success =
false;
306 if(cola_response.parameter.size() >= 4)
312 service_response.success =
true;
314 return service_response.success;
326 cola_ascii <<
"sMN LocSetReflectorsForSupportActive";
327 cola_ascii << std::noshowpos <<
" " << (service_request.active?1:0);
328 return cola_ascii.str();
339 service_response.success =
false;
340 if(!cola_response.parameter.empty())
344 return service_response.success;
355 cola_ascii <<
"sRN LocReflectorsForSupportActive";
356 return cola_ascii.str();
367 service_response.success =
false;
368 if(!cola_response.parameter.empty())
371 service_response.success =
true;
373 return service_response.success;
384 cola_ascii <<
"sMN LocSetOdometryActive";
385 cola_ascii << std::noshowpos <<
" " << (service_request.active?1:0);
386 return cola_ascii.str();
397 service_response.set =
false;
398 service_response.executed =
false;
399 if(!cola_response.parameter.empty())
404 return service_response.set;
415 cola_ascii <<
"sRN LocOdometryActive";
416 return cola_ascii.str();
427 service_response.success =
false;
428 if(!cola_response.parameter.empty())
431 service_response.success =
true;
433 return service_response.success;
444 cola_ascii <<
"sMN LocSetOdometryPort";
445 cola_ascii <<
" +" << service_request.port;
446 return cola_ascii.str();
457 service_response.set =
false;
458 if(!cola_response.parameter.empty())
463 return service_response.set;
474 cola_ascii <<
"sRN LocOdometryPort";
475 return cola_ascii.str();
486 service_response.success =
false;
487 if(!cola_response.parameter.empty())
490 service_response.success =
true;
492 return service_response.success;
503 cola_ascii <<
"sMN LocSetOdometryRestrictYMotion";
504 cola_ascii << std::noshowpos <<
" " << (service_request.active?1:0);
505 return cola_ascii.str();
516 service_response.success =
false;
517 if(!cola_response.parameter.empty())
521 return service_response.success;
532 cola_ascii <<
"sRN LocOdometryRestrictYMotion";
533 return cola_ascii.str();
544 service_response.success =
false;
545 if(!cola_response.parameter.empty())
548 service_response.success =
true;
550 return service_response.success;
561 cola_ascii <<
"sMN LocSetAutoStartActive";
562 cola_ascii << std::noshowpos <<
" " << (service_request.active?1:0);
563 return cola_ascii.str();
574 service_response.success =
false;
575 if(!cola_response.parameter.empty())
579 return service_response.success;
590 cola_ascii <<
"sRN LocAutoStartActive";
591 return cola_ascii.str();
602 service_response.success =
false;
603 if(!cola_response.parameter.empty())
606 service_response.success =
true;
608 return service_response.success;
619 cola_ascii <<
"sMN LocSetAutoStartSavePoseInterval";
620 cola_ascii << std::showpos <<
" " << service_request.interval;
621 return cola_ascii.str();
632 service_response.success =
false;
633 if(!cola_response.parameter.empty())
637 return service_response.success;
648 cola_ascii <<
"sRN LocAutoStartSavePoseInterval";
649 return cola_ascii.str();
660 service_response.success =
false;
661 if(!cola_response.parameter.empty())
664 service_response.success =
true;
666 return service_response.success;
677 cola_ascii <<
"sMN LocSetRingBufferRecordingActive";
678 cola_ascii << std::noshowpos <<
" " << (service_request.active?1:0);
679 return cola_ascii.str();
690 service_response.success =
false;
691 if(!cola_response.parameter.empty())
695 return service_response.success;
706 cola_ascii <<
"sRN LocRingBufferRecordingActive";
707 return cola_ascii.str();
718 service_response.success =
false;
719 if(!cola_response.parameter.empty())
722 service_response.success =
true;
724 return service_response.success;
735 cola_ascii <<
"sMN DevGetLidarIdent";
736 cola_ascii << std::showpos <<
" " << service_request.index;
737 return cola_ascii.str();
748 service_response.success =
false;
749 if(cola_response.parameter.size() == 1)
751 service_response.scannerident = cola_response.parameter[0];
752 service_response.success =
true;
754 if(cola_response.parameter.size() > 1)
757 service_response.scannerident = cola_response.parameter[1];
758 for (
int n = 2; n < cola_response.parameter.size() && service_response.scannerident.length() < str_len; n++)
760 service_response.scannerident = service_response.scannerident +
" " + cola_response.parameter[n];
762 service_response.success =
true;
764 return service_response.success;
775 cola_ascii <<
"sMN DevGetLidarState";
776 cola_ascii << std::showpos <<
" " << service_request.index;
777 return cola_ascii.str();
788 service_response.success =
false;
789 if(cola_response.parameter.size() >= 3)
794 service_response.success =
true;
796 return service_response.success;
807 cola_ascii <<
"sMN GetSoftwareVersion";
808 return cola_ascii.str();
819 service_response.success =
false;
820 if(cola_response.parameter.size() == 1)
822 service_response.version = cola_response.parameter[0];
823 service_response.success =
true;
825 if(cola_response.parameter.size() > 1)
828 service_response.version = cola_response.parameter[1];
829 for (
int n = 2; n < cola_response.parameter.size() && service_response.version.length() < str_len; n++)
831 service_response.version = service_response.version +
" " + cola_response.parameter[n];
833 service_response.success =
true;
835 return service_response.success;
846 cola_ascii <<
"sMN LocAutoStartSavePose";
847 return cola_ascii.str();
858 service_response.success =
false;
859 if(!cola_response.parameter.empty())
863 return service_response.success;
874 cola_ascii <<
"sMN LocForceUpdate";
875 return cola_ascii.str();
886 service_response.success =
false;
887 if(!cola_response.parameter.empty())
891 return service_response.success;
902 cola_ascii <<
"sMN LocSaveRingBufferRecording";
903 cola_ascii <<
" +" << service_request.reason.length() <<
" " << service_request.reason;
904 return cola_ascii.str();
915 service_response.success =
false;
916 if(!cola_response.parameter.empty())
920 return service_response.success;
931 cola_ascii <<
"sMN LocStartDemoMapping";
932 return cola_ascii.str();
943 service_response.success =
false;
944 if(!cola_response.parameter.empty())
948 return service_response.success;
959 cola_ascii <<
"sMN ReportUserMessage";
960 cola_ascii <<
" +" << service_request.usermessage.length() <<
" " << service_request.usermessage;
961 return cola_ascii.str();
972 service_response.success =
false;
973 if(!cola_response.parameter.empty())
977 return service_response.success;
988 cola_ascii <<
"sMN SavePermanent";
989 return cola_ascii.str();
1000 service_response.success =
false;
1001 if(!cola_response.parameter.empty())
1005 return service_response.success;
1016 cola_ascii <<
"sRN LocResultPort";
1017 return cola_ascii.str();
1028 service_response.success =
false;
1029 if(!cola_response.parameter.empty())
1032 service_response.success =
true;
1034 return service_response.success;
1045 cola_ascii <<
"sRN LocResultMode";
1046 return cola_ascii.str();
1057 service_response.success =
false;
1058 if(!cola_response.parameter.empty())
1061 service_response.success =
true;
1063 return service_response.success;
1074 cola_ascii <<
"sRN LocResultEndianness";
1075 return cola_ascii.str();
1086 service_response.success =
false;
1087 if(!cola_response.parameter.empty())
1090 service_response.success =
true;
1092 return service_response.success;
1103 cola_ascii <<
"sRN LocResultState";
1104 return cola_ascii.str();
1115 service_response.success =
false;
1116 if(!cola_response.parameter.empty())
1119 service_response.success =
true;
1121 return service_response.success;
1132 cola_ascii <<
"sRN LocResultPoseInterval";
1133 return cola_ascii.str();
1144 service_response.success =
false;
1145 if(!cola_response.parameter.empty())
1148 service_response.success =
true;
1150 return service_response.success;
1161 cola_ascii <<
"sMN DevSetIMUActive";
1162 cola_ascii << std::noshowpos <<
" " << (service_request.active?1:0);
1163 return cola_ascii.str();
1174 service_response.success =
false;
1175 if(!cola_response.parameter.empty())
1179 return service_response.success;
1190 cola_ascii <<
"sRN DevIMUActive";
1191 return cola_ascii.str();
1202 service_response.success =
false;
1203 if(!cola_response.parameter.empty())
1206 service_response.success =
true;
1208 return service_response.success;
static std::string encodeServiceRequest(const sick_scan::SickDevSetLidarConfigSrv::Request &service_request)
static int32_t convertColaArg(const std::string &cola_arg, int base=10, int32_t default_value=0)
static bool convertColaResponseBool(const std::string &cola_response_arg, bool default_value)
static bool parseServiceResponse(const sick_scan::SickLocColaTelegramMsg &cola_response, sick_scan::SickDevSetLidarConfigSrv::Response &service_response)