浏览代码

solve problem of seg fault as don't call Release in plcData. complete glog logging. add log path. edit locks in lidars, region_worker and PlcData.

youchen 5 年之前
父节点
当前提交
31dd864be0

+ 2 - 0
.gitignore

@@ -32,3 +32,5 @@ _ReSharper*/
 packages/
 build/*
 devel/*
+src/findwheel/log/*
+src/findwheel/data/*

+ 155 - 154
cloud_scan3.txt

@@ -1,210 +1,211 @@
-2.746 -1.431 0.000
-2.780 -1.427 0.000
+2.746 -1.430 0.000
+2.778 -1.426 0.000
 2.816 -1.425 0.000
-2.848 -1.421 0.000
+2.846 -1.421 0.000
 2.870 -1.414 0.000
-2.886 -1.404 0.000
-2.897 -1.392 0.000
+2.885 -1.404 0.000
+2.899 -1.394 0.000
 2.904 -1.379 0.000
-2.908 -1.364 0.000
+2.907 -1.364 0.000
 2.908 -1.348 0.000
-2.906 -1.330 0.000
-2.900 -1.311 0.000
-2.893 -1.290 0.000
-2.888 -1.271 0.000
-2.914 -1.267 0.000
-3.057 -1.321 0.000
-3.120 -1.336 0.000
-3.128 -1.325 0.000
-3.125 -1.308 0.000
-3.129 -1.294 0.000
-3.147 -1.287 0.000
-3.138 -1.266 0.000
-3.133 -1.247 0.000
-3.141 -1.236 0.000
-3.159 -1.229 0.000
-3.159 -1.213 0.000
-3.149 -1.191 0.000
-3.118 -1.156 0.000
-3.037 -1.091 0.000
-2.906 -0.994 0.000
-2.878 -0.958 0.000
+2.905 -1.330 0.000
+2.900 -1.310 0.000
+2.892 -1.290 0.000
+2.889 -1.272 0.000
+2.906 -1.263 0.000
+3.039 -1.312 0.000
+3.117 -1.335 0.000
+3.122 -1.322 0.000
+3.117 -1.303 0.000
+3.125 -1.291 0.000
+3.144 -1.285 0.000
+3.135 -1.265 0.000
+3.127 -1.244 0.000
+3.135 -1.232 0.000
+3.149 -1.224 0.000
+3.155 -1.211 0.000
+3.137 -1.184 0.000
+3.108 -1.150 0.000
+3.031 -1.087 0.000
+2.905 -0.993 0.000
+2.879 -0.958 0.000
 2.883 -0.941 0.000
 2.888 -0.925 0.000
-2.895 -0.911 0.000
-2.909 -0.899 0.000
-2.953 -0.909 0.000
-3.135 -1.010 0.000
-3.236 -1.060 0.000
-3.279 -1.072 0.000
-3.308 -1.075 0.000
-3.357 -1.092 0.000
-3.410 -1.113 0.000
-3.428 -1.109 0.000
-3.393 -1.068 0.000
-2.975 -0.703 0.000
-2.952 -0.665 0.000
+2.893 -0.909 0.000
+2.904 -0.896 0.000
+2.940 -0.900 0.000
+3.097 -0.985 0.000
+3.225 -1.052 0.000
+3.272 -1.067 0.000
+3.303 -1.072 0.000
+3.347 -1.085 0.000
+3.404 -1.109 0.000
+3.431 -1.111 0.000
+3.398 -1.071 0.000
+2.967 -0.697 0.000
+2.951 -0.665 0.000
 2.880 -0.588 0.000
-2.840 -0.535 0.000
-2.833 -0.507 0.000
-2.813 -0.247 0.000
-2.810 -0.220 0.000
-2.812 -0.195 0.000
-2.811 -0.168 0.000
-2.810 -0.140 0.000
-2.813 -0.116 0.000
-2.814 -0.090 0.000
-2.815 -0.064 0.000
-2.817 -0.038 0.000
+2.842 -0.537 0.000
+2.831 -0.506 0.000
+2.805 -0.241 0.000
+2.815 -0.224 0.000
+2.815 -0.198 0.000
+2.816 -0.172 0.000
+2.814 -0.144 0.000
+2.811 -0.114 0.000
+2.810 -0.087 0.000
+2.812 -0.061 0.000
+2.819 -0.040 0.000
 4.272 -1.407 0.000
-4.281 -1.404 0.000
-4.292 -1.403 0.000
+4.284 -1.407 0.000
+4.291 -1.402 0.000
 4.304 -1.404 0.000
 4.318 -1.406 0.000
 4.328 -1.406 0.000
 4.342 -1.409 0.000
 4.354 -1.410 0.000
-4.363 -1.408 0.000
+4.362 -1.407 0.000
 4.373 -1.408 0.000
-4.381 -1.405 0.000
+4.383 -1.407 0.000
 4.393 -1.406 0.000
-4.401 -1.404 0.000
-4.410 -1.403 0.000
-4.419 -1.402 0.000
-4.429 -1.401 0.000
-4.437 -1.398 0.000
-4.445 -1.396 0.000
+4.402 -1.405 0.000
+4.410 -1.402 0.000
+4.421 -1.404 0.000
+4.430 -1.402 0.000
+4.435 -1.396 0.000
+4.446 -1.397 0.000
 4.454 -1.395 0.000
-4.461 -1.391 0.000
-4.465 -1.384 0.000
-4.469 -1.377 0.000
+4.460 -1.390 0.000
+4.466 -1.386 0.000
+4.469 -1.376 0.000
 4.473 -1.369 0.000
-4.476 -1.361 0.000
-4.479 -1.352 0.000
-4.482 -1.343 0.000
-4.483 -1.331 0.000
+4.477 -1.362 0.000
+4.480 -1.353 0.000
+4.480 -1.340 0.000
+4.484 -1.331 0.000
 4.483 -1.316 0.000
-4.480 -1.299 0.000
+4.481 -1.300 0.000
 4.478 -1.282 0.000
 4.474 -1.261 0.000
-4.469 -1.239 0.000
-4.467 -1.221 0.000
+4.470 -1.241 0.000
+4.466 -1.220 0.000
 4.468 -1.208 0.000
-4.470 -1.195 0.000
+4.471 -1.196 0.000
 4.468 -1.176 0.000
-4.456 -1.141 0.000
+4.457 -1.143 0.000
 4.451 -1.117 0.000
-4.451 -1.100 0.000
-4.452 -1.084 0.000
+4.452 -1.100 0.000
+4.452 -1.085 0.000
 4.458 -1.076 0.000
-4.465 -1.069 0.000
+4.464 -1.068 0.000
 4.466 -1.054 0.000
-4.461 -1.027 0.000
-4.464 -1.013 0.000
-4.467 -0.998 0.000
-4.469 -0.983 0.000
-4.472 -0.968 0.000
-4.473 -0.949 0.000
-4.479 -0.939 0.000
+4.462 -1.029 0.000
+4.465 -1.014 0.000
+4.467 -0.999 0.000
+4.470 -0.984 0.000
+4.472 -0.969 0.000
+4.474 -0.951 0.000
+4.477 -0.937 0.000
 4.312 1.396 0.000
-4.337 1.391 0.000
-4.360 1.391 0.000
-4.383 1.392 0.000
-4.407 1.393 0.000
-4.429 1.397 0.000
+4.336 1.395 0.000
+4.360 1.390 0.000
+4.384 1.390 0.000
+4.406 1.395 0.000
+4.429 1.396 0.000
 4.451 1.402 0.000
-4.471 1.419 0.000
-4.483 1.477 0.000
-4.482 1.598 0.000
-4.483 1.723 0.000
-6.042 1.834 0.000
-6.054 1.762 0.000
-6.059 1.658 0.000
+4.472 1.415 0.000
+4.483 1.474 0.000
+4.482 1.599 0.000
+4.483 1.724 0.000
+4.473 1.911 0.000
+6.042 1.832 0.000
+6.056 1.773 0.000
+6.060 1.662 0.000
 6.064 1.556 0.000
 6.072 1.479 0.000
-6.093 1.463 0.000
+6.093 1.464 0.000
 6.115 1.455 0.000
-6.138 1.456 0.000
-6.162 1.454 0.000
-6.187 1.459 0.000
-6.210 1.458 0.000
+6.139 1.457 0.000
+6.162 1.455 0.000
+6.187 1.458 0.000
+6.211 1.459 0.000
 6.235 1.461 0.000
-6.273 1.514 0.000
-7.636 2.100 0.000
+6.276 1.527 0.000
+7.632 2.092 0.000
 7.603 1.974 0.000
-7.611 1.927 0.000
-6.193 -0.762 0.000
-6.187 -0.796 0.000
+7.616 1.936 0.000
+6.195 -0.757 0.000
+6.186 -0.797 0.000
 6.186 -0.820 0.000
 6.187 -0.839 0.000
-6.190 -0.855 0.000
+6.190 -0.854 0.000
 6.193 -0.870 0.000
-6.196 -0.886 0.000
-6.200 -0.899 0.000
-6.203 -0.915 0.000
-6.206 -0.929 0.000
-6.204 -0.952 0.000
-6.205 -0.970 0.000
-6.205 -0.987 0.000
-6.206 -1.004 0.000
-6.209 -1.018 0.000
+6.195 -0.888 0.000
+6.200 -0.900 0.000
+6.204 -0.914 0.000
+6.207 -0.929 0.000
+6.205 -0.951 0.000
+6.204 -0.971 0.000
+6.206 -0.986 0.000
+6.207 -1.003 0.000
+6.209 -1.017 0.000
 6.211 -1.033 0.000
-6.211 -1.050 0.000
-6.207 -1.072 0.000
+6.209 -1.052 0.000
+6.207 -1.073 0.000
 6.202 -1.097 0.000
-6.202 -1.114 0.000
-6.200 -1.132 0.000
+6.200 -1.115 0.000
+6.200 -1.131 0.000
 6.201 -1.146 0.000
-6.203 -1.160 0.000
+6.204 -1.158 0.000
 6.205 -1.172 0.000
-6.207 -1.184 0.000
+6.208 -1.183 0.000
 6.211 -1.194 0.000
 6.217 -1.202 0.000
-6.222 -1.209 0.000
+6.221 -1.210 0.000
 6.228 -1.217 0.000
-6.237 -1.220 0.000
+6.236 -1.221 0.000
 6.244 -1.225 0.000
-6.253 -1.228 0.000
-6.263 -1.230 0.000
+6.254 -1.227 0.000
+6.264 -1.228 0.000
 6.278 -1.226 0.000
-6.287 -1.229 0.000
+6.288 -1.228 0.000
 6.300 -1.229 0.000
-6.314 -1.227 0.000
-6.325 -1.227 0.000
-6.338 -1.228 0.000
-6.353 -1.224 0.000
-6.363 -1.228 0.000
-6.380 -1.223 0.000
-6.392 -1.223 0.000
-6.405 -1.224 0.000
+6.314 -1.226 0.000
+6.325 -1.228 0.000
+6.339 -1.226 0.000
+6.353 -1.225 0.000
+6.364 -1.227 0.000
+6.382 -1.221 0.000
+6.393 -1.223 0.000
+6.406 -1.223 0.000
 7.763 -0.634 0.000
-7.760 -0.658 0.000
-7.761 -0.679 0.000
-7.758 -0.703 0.000
-7.762 -0.722 0.000
-7.765 -0.741 0.000
-7.771 -0.758 0.000
-7.774 -0.776 0.000
-7.781 -0.793 0.000
-7.784 -0.812 0.000
+7.762 -0.656 0.000
+7.760 -0.680 0.000
+7.759 -0.702 0.000
+7.761 -0.722 0.000
+7.766 -0.740 0.000
+7.771 -0.757 0.000
+7.776 -0.775 0.000
+7.782 -0.792 0.000
+7.786 -0.810 0.000
 7.788 -0.830 0.000
-7.786 -0.851 0.000
+7.787 -0.851 0.000
 7.789 -0.870 0.000
 7.792 -0.888 0.000
 7.793 -0.907 0.000
-7.793 -0.927 0.000
+7.792 -0.928 0.000
 7.789 -0.950 0.000
-7.787 -0.970 0.000
+7.787 -0.971 0.000
 7.784 -0.992 0.000
-7.784 -1.011 0.000
+7.782 -1.012 0.000
 7.782 -1.031 0.000
-7.783 -1.050 0.000
-7.784 -1.068 0.000
-7.788 -1.085 0.000
-7.792 -1.101 0.000
-7.801 -1.115 0.000
+7.782 -1.050 0.000
+7.785 -1.068 0.000
+7.789 -1.084 0.000
+7.794 -1.100 0.000
+7.799 -1.116 0.000
 7.817 -1.126 0.000
 7.838 -1.134 0.000
-7.866 -1.138 0.000
-7.906 -1.138 0.000
+7.868 -1.138 0.000
+7.909 -1.136 0.000
 7.943 -1.139 0.000

+ 68 - 68
cloud_scan4.txt

@@ -1,84 +1,84 @@
-12.087 -2.460 0.000
-7.964 -0.902 0.000
-7.960 -0.785 0.000
-7.958 -0.661 0.000
-7.945 -0.600 0.000
-7.924 -0.586 0.000
+12.088 -2.462 0.000
+7.965 -0.899 0.000
+7.959 -0.788 0.000
+7.958 -0.663 0.000
+7.944 -0.607 0.000
+7.923 -0.588 0.000
 7.901 -0.579 0.000
-7.876 -0.579 0.000
-7.852 -0.577 0.000
-7.827 -0.580 0.000
-7.801 -0.583 0.000
-7.776 -0.584 0.000
-7.752 -0.581 0.000
-7.864 1.653 0.000
-7.861 1.673 0.000
-7.864 1.705 0.000
-7.861 1.723 0.000
-7.858 1.743 0.000
+7.876 -0.577 0.000
+7.852 -0.578 0.000
+7.827 -0.578 0.000
+7.802 -0.580 0.000
+7.777 -0.582 0.000
+7.753 -0.578 0.000
+7.864 1.654 0.000
+7.862 1.675 0.000
+7.863 1.703 0.000
+7.862 1.725 0.000
+7.858 1.742 0.000
 7.854 1.759 0.000
-7.849 1.774 0.000
-7.845 1.789 0.000
-7.841 1.804 0.000
-7.839 1.824 0.000
-7.840 1.847 0.000
-7.840 1.868 0.000
+7.848 1.772 0.000
+7.845 1.788 0.000
+7.839 1.802 0.000
+7.840 1.824 0.000
+7.838 1.845 0.000
+7.838 1.865 0.000
 7.837 1.886 0.000
-7.836 1.904 0.000
-7.838 1.928 0.000
-7.837 1.946 0.000
+7.838 1.906 0.000
+7.837 1.925 0.000
+7.838 1.947 0.000
 7.841 1.971 0.000
-7.848 2.003 0.000
+7.847 2.000 0.000
 7.848 2.022 0.000
-7.850 2.042 0.000
-7.847 2.056 0.000
-7.843 2.067 0.000
+7.849 2.040 0.000
+7.846 2.054 0.000
+7.843 2.068 0.000
 7.839 2.078 0.000
 7.835 2.090 0.000
-7.829 2.098 0.000
-7.822 2.104 0.000
-7.817 2.114 0.000
-7.809 2.119 0.000
-7.799 2.121 0.000
-7.789 2.124 0.000
-7.779 2.126 0.000
+7.830 2.099 0.000
+7.823 2.106 0.000
+7.817 2.113 0.000
+7.810 2.120 0.000
+7.799 2.122 0.000
+7.789 2.123 0.000
+7.780 2.127 0.000
 7.766 2.124 0.000
 7.756 2.127 0.000
 7.741 2.123 0.000
-7.729 2.123 0.000
-7.717 2.124 0.000
-7.703 2.122 0.000
-7.691 2.123 0.000
-7.679 2.123 0.000
-7.664 2.121 0.000
-7.650 2.121 0.000
-7.636 2.119 0.000
-6.292 1.570 0.000
-6.294 1.594 0.000
-6.293 1.616 0.000
-6.294 1.639 0.000
-6.295 1.662 0.000
-6.291 1.681 0.000
-6.287 1.700 0.000
-6.284 1.719 0.000
-6.280 1.738 0.000
-6.276 1.756 0.000
-6.276 1.777 0.000
-6.272 1.795 0.000
+7.729 2.124 0.000
+7.716 2.123 0.000
+7.704 2.124 0.000
+7.692 2.124 0.000
+7.679 2.124 0.000
+7.665 2.123 0.000
+7.652 2.122 0.000
+7.638 2.122 0.000
+6.294 1.572 0.000
+6.293 1.594 0.000
+6.294 1.617 0.000
+6.293 1.639 0.000
+6.293 1.661 0.000
+6.290 1.680 0.000
+6.286 1.699 0.000
+6.285 1.720 0.000
+6.282 1.739 0.000
+6.277 1.757 0.000
+6.274 1.776 0.000
+6.271 1.794 0.000
 6.270 1.815 0.000
 6.272 1.836 0.000
-6.273 1.858 0.000
+6.274 1.858 0.000
 6.275 1.879 0.000
-6.275 1.900 0.000
-6.275 1.919 0.000
-6.275 1.939 0.000
-6.275 1.959 0.000
-6.271 1.977 0.000
-6.267 1.993 0.000
+6.276 1.900 0.000
+6.277 1.921 0.000
+6.277 1.940 0.000
+6.273 1.958 0.000
+6.272 1.977 0.000
+6.268 1.994 0.000
 6.261 2.009 0.000
 6.252 2.023 0.000
 6.235 2.033 0.000
-6.212 2.040 0.000
-6.178 2.040 0.000
-6.135 2.036 0.000
-6.098 2.036 0.000
+6.211 2.039 0.000
+6.179 2.040 0.000
+6.138 2.038 0.000
+6.099 2.037 0.000

+ 79 - 79
cloud_scan5.txt

@@ -1,99 +1,99 @@
-13.111 1.821 0.000
-13.082 1.572 0.000
+13.081 1.568 0.000
 13.081 1.456 0.000
-13.089 1.388 0.000
-13.084 1.269 0.000
-13.099 1.236 0.000
-13.118 1.219 0.000
-13.142 1.222 0.000
-13.163 1.217 0.000
-13.186 1.219 0.000
-13.210 1.220 0.000
-13.233 1.220 0.000
-13.071 -0.847 0.000
-13.053 -0.902 0.000
-13.053 -0.923 0.000
-13.056 -0.939 0.000
+13.089 1.387 0.000
+13.085 1.272 0.000
+13.099 1.234 0.000
+13.119 1.224 0.000
+13.140 1.217 0.000
+13.163 1.218 0.000
+13.186 1.218 0.000
+13.209 1.219 0.000
+13.233 1.221 0.000
+13.327 1.384 0.000
+13.067 -0.853 0.000
+13.054 -0.901 0.000
+13.052 -0.924 0.000
+13.056 -0.938 0.000
 13.060 -0.952 0.000
-13.062 -0.969 0.000
+13.063 -0.968 0.000
 13.064 -0.985 0.000
-13.066 -1.001 0.000
+13.066 -1.002 0.000
 13.071 -1.013 0.000
-13.074 -1.026 0.000
+13.074 -1.027 0.000
 13.075 -1.043 0.000
-13.062 -1.082 0.000
-13.053 -1.115 0.000
-13.052 -1.132 0.000
-13.053 -1.149 0.000
+13.063 -1.080 0.000
+13.054 -1.113 0.000
+13.052 -1.133 0.000
+13.052 -1.150 0.000
 13.054 -1.164 0.000
 13.060 -1.171 0.000
-13.069 -1.174 0.000
-13.070 -1.188 0.000
-13.062 -1.216 0.000
+13.069 -1.173 0.000
+13.071 -1.187 0.000
+13.061 -1.216 0.000
 13.058 -1.237 0.000
-13.060 -1.249 0.000
-13.055 -1.271 0.000
+13.059 -1.250 0.000
+13.056 -1.269 0.000
 13.051 -1.290 0.000
 13.050 -1.306 0.000
-13.052 -1.317 0.000
-13.054 -1.328 0.000
+13.051 -1.319 0.000
+13.055 -1.328 0.000
 13.058 -1.337 0.000
-13.062 -1.346 0.000
-13.067 -1.352 0.000
-13.071 -1.360 0.000
-13.079 -1.364 0.000
+13.062 -1.345 0.000
+13.068 -1.351 0.000
+13.072 -1.360 0.000
+13.080 -1.362 0.000
 13.088 -1.366 0.000
-13.096 -1.369 0.000
-13.105 -1.371 0.000
-13.116 -1.371 0.000
+13.095 -1.370 0.000
+13.105 -1.370 0.000
+13.114 -1.372 0.000
 13.124 -1.373 0.000
-13.133 -1.376 0.000
+13.134 -1.375 0.000
 13.144 -1.376 0.000
-13.155 -1.376 0.000
-13.166 -1.376 0.000
-13.177 -1.378 0.000
+13.156 -1.375 0.000
+13.166 -1.377 0.000
+13.176 -1.378 0.000
 13.186 -1.380 0.000
-13.199 -1.379 0.000
-13.209 -1.380 0.000
-13.219 -1.382 0.000
-14.576 -0.716 0.000
-14.592 -0.725 0.000
-14.618 -0.728 0.000
-14.643 -0.731 0.000
-14.625 -0.766 0.000
-14.535 -0.849 0.000
-14.529 -0.872 0.000
-14.525 -0.895 0.000
-14.525 -0.915 0.000
-14.528 -0.932 0.000
-14.534 -0.948 0.000
-14.539 -0.963 0.000
-14.550 -0.976 0.000
-14.568 -0.984 0.000
-14.586 -0.992 0.000
-14.598 -1.004 0.000
-14.593 -1.025 0.000
-14.549 -1.070 0.000
-14.532 -1.099 0.000
+13.199 -1.378 0.000
+13.210 -1.379 0.000
+13.218 -1.383 0.000
+14.572 -0.718 0.000
+14.594 -0.724 0.000
+14.619 -0.728 0.000
+14.643 -0.732 0.000
+14.626 -0.764 0.000
+14.538 -0.846 0.000
+14.530 -0.872 0.000
+14.527 -0.894 0.000
+14.524 -0.916 0.000
+14.529 -0.931 0.000
+14.535 -0.947 0.000
+14.539 -0.964 0.000
+14.551 -0.975 0.000
+14.566 -0.985 0.000
+14.586 -0.991 0.000
+14.598 -1.003 0.000
+14.591 -1.027 0.000
+14.552 -1.069 0.000
+14.533 -1.098 0.000
 14.517 -1.125 0.000
-14.519 -1.142 0.000
-14.527 -1.156 0.000
-14.534 -1.169 0.000
-14.561 -1.173 0.000
-14.598 -1.170 0.000
+14.520 -1.142 0.000
+14.526 -1.156 0.000
+14.533 -1.170 0.000
+14.560 -1.173 0.000
+14.599 -1.170 0.000
 14.609 -1.182 0.000
-14.618 -1.196 0.000
-14.664 -1.190 0.000
+14.617 -1.196 0.000
+14.665 -1.189 0.000
 14.590 -1.245 0.000
-14.540 -1.288 0.000
+14.538 -1.289 0.000
 14.529 -1.311 0.000
 14.522 -1.331 0.000
-14.518 -1.349 0.000
-14.519 -1.366 0.000
-14.526 -1.379 0.000
-14.531 -1.393 0.000
-14.544 -1.403 0.000
-14.568 -1.409 0.000
-14.598 -1.412 0.000
-14.636 -1.413 0.000
-14.709 -1.398 0.000
+14.519 -1.349 0.000
+14.520 -1.365 0.000
+14.524 -1.379 0.000
+14.530 -1.393 0.000
+14.545 -1.403 0.000
+14.567 -1.410 0.000
+14.599 -1.412 0.000
+14.635 -1.413 0.000
+14.707 -1.399 0.000

+ 4 - 2
src/.vscode/settings.json

@@ -62,6 +62,8 @@
         "utility": "cpp",
         "typeindex": "cpp",
         "typeinfo": "cpp",
-        "core": "cpp"
-    }
+        "core": "cpp",
+        "*.ipp": "cpp"
+    },
+    "workbench.colorTheme": "Default Light+"
 }

+ 4 - 1
src/findwheel/CMakeLists.txt

@@ -162,7 +162,10 @@ add_executable(${PROJECT_NAME}_node
     src/region_worker.cpp
     src/tools/globalmsg.pb.cc
     src/tools/s7_plc.cpp
-    src/PlcData.cpp)
+    src/tools/pathcreator.cpp
+    src/PlcData.cpp
+    src/PlcData.h
+    )
 target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES} snap7 libnnxx.a libnanomsg.so ${OpenCV_LIBS} libglog.a libgflags.a)
 
 ## Rename C++ executable without prefix

+ 0 - 404
src/findwheel/data/2019-12-23_18:08:05.txt

@@ -1,404 +0,0 @@
-2.744631 -1.429858 0.000000
-2.778322 -1.426318 0.000000
-2.813821 -1.423892 0.000000
-2.844642 -1.419930 0.000000
-2.869898 -1.413963 0.000000
-2.884108 -1.403530 0.000000
-2.895607 -1.392032 0.000000
-2.901672 -1.378206 0.000000
-2.906905 -1.364007 0.000000
-2.907673 -1.347757 0.000000
-2.905829 -1.330220 0.000000
-2.898679 -1.310072 0.000000
-2.893488 -1.290665 0.000000
-2.888444 -1.271161 0.000000
-2.908673 -1.263915 0.000000
-3.045227 -1.314909 0.000000
-3.115974 -1.334478 0.000000
-3.124148 -1.322849 0.000000
-3.120857 -1.305273 0.000000
-3.125654 -1.291825 0.000000
-3.146400 -1.286897 0.000000
-3.138135 -1.266416 0.000000
-3.129161 -1.245318 0.000000
-3.135203 -1.232367 0.000000
-3.153505 -1.226344 0.000000
-3.157928 -1.212529 0.000000
-3.142558 -1.187160 0.000000
-3.116215 -1.154969 0.000000
-3.040383 -1.092685 0.000000
-2.909600 -0.995817 0.000000
-2.878757 -0.958030 0.000000
-2.883950 -0.942003 0.000000
-2.889249 -0.925986 0.000000
-2.894653 -0.909981 0.000000
-2.906883 -0.898328 0.000000
-2.943438 -0.902641 0.000000
-3.114917 -0.996791 0.000000
-3.228745 -1.055000 0.000000
-3.275643 -1.069529 0.000000
-3.305824 -1.073223 0.000000
-3.353125 -1.089223 0.000000
-3.409163 -1.112065 0.000000
-3.429870 -1.110530 0.000000
-3.402712 -1.074632 0.000000
-2.972930 -0.702072 0.000000
-2.949550 -0.663321 0.000000
-2.879750 -0.588305 0.000000
-2.839962 -0.535125 0.000000
-2.833723 -0.507388 0.000000
-2.811017 -0.246042 0.000000
-2.814070 -0.223070 0.000000
-2.813603 -0.196700 0.000000
-2.813360 -0.170251 0.000000
-2.811876 -0.142364 0.000000
-2.814278 -0.117806 0.000000
-2.809633 -0.086312 0.000000
-2.813925 -0.063001 0.000000
-2.819839 -0.041054 0.000000
-4.272307 -1.406718 0.000000
-4.282441 -1.405210 0.000000
-4.290482 -1.401621 0.000000
-4.304035 -1.403897 0.000000
-4.317528 -1.406294 0.000000
-4.327563 -1.405146 0.000000
-4.342980 -1.409981 0.000000
-4.352271 -1.408286 0.000000
-4.364215 -1.409647 0.000000
-4.374126 -1.408864 0.000000
-4.384015 -1.408162 0.000000
-4.392574 -1.406026 0.000000
-4.402426 -1.405477 0.000000
-4.409676 -1.401950 0.000000
-4.418858 -1.400778 0.000000
-4.429932 -1.401993 0.000000
-4.435912 -1.397097 0.000000
-4.445055 -1.396133 0.000000
-4.454802 -1.396022 0.000000
-4.459581 -1.389698 0.000000
-4.465632 -1.384975 0.000000
-4.468670 -1.376319 0.000000
-4.471780 -1.367663 0.000000
-4.476163 -1.360609 0.000000
-4.480600 -1.353571 0.000000
-4.480964 -1.340894 0.000000
-4.483789 -1.331430 0.000000
-4.482636 -1.316262 0.000000
-4.481633 -1.301043 0.000000
-4.479068 -1.283312 0.000000
-4.473287 -1.260566 0.000000
-4.468305 -1.238544 0.000000
-4.466891 -1.221409 0.000000
-4.468958 -1.209224 0.000000
-4.470047 -1.195348 0.000000
-4.466937 -1.174718 0.000000
-4.457060 -1.143044 0.000000
-4.451781 -1.117987 0.000000
-4.452036 -1.101325 0.000000
-4.452458 -1.084622 0.000000
-4.457182 -1.074727 0.000000
-4.464043 -1.068277 0.000000
-4.466895 -1.054967 0.000000
-4.462845 -1.029536 0.000000
-4.463538 -1.011821 0.000000
-4.467361 -0.999292 0.000000
-4.469842 -0.984139 0.000000
-4.472473 -0.968967 0.000000
-4.473346 -0.950260 0.000000
-4.478183 -0.938570 0.000000
-4.311643 1.396596 0.000000
-4.336298 1.392422 0.000000
-4.360173 1.391008 0.000000
-4.383545 1.391393 0.000000
-4.405784 1.396511 0.000000
-4.429563 1.394665 0.000000
-4.451820 1.399516 0.000000
-4.471652 1.415984 0.000000
-4.482905 1.475473 0.000000
-4.482086 1.599718 0.000000
-4.483249 1.721154 0.000000
-4.472363 1.915479 0.000000
-6.041595 1.832287 0.000000
-6.054839 1.765813 0.000000
-6.059031 1.656122 0.000000
-6.064695 1.560261 0.000000
-6.071873 1.477211 0.000000
-6.092730 1.463695 0.000000
-6.114938 1.456910 0.000000
-6.138397 1.455856 0.000000
-6.161650 1.453684 0.000000
-6.186508 1.458189 0.000000
-6.210510 1.458646 0.000000
-6.235029 1.460897 0.000000
-6.277532 1.533759 0.000000
-7.631461 2.090867 0.000000
-7.602523 1.972774 0.000000
-7.614850 1.934476 0.000000
-6.191054 -0.765297 0.000000
-6.186553 -0.795971 0.000000
-6.185672 -0.819577 0.000000
-6.187538 -0.837914 0.000000
-6.190732 -0.853626 0.000000
-6.193265 -0.870182 0.000000
-6.195124 -0.887572 0.000000
-6.199403 -0.900655 0.000000
-6.204084 -0.912882 0.000000
-6.206014 -0.929358 0.000000
-6.204584 -0.950881 0.000000
-6.205089 -0.968964 0.000000
-6.207043 -0.984483 0.000000
-6.206109 -1.004158 0.000000
-6.208847 -1.017940 0.000000
-6.210341 -1.033365 0.000000
-6.209439 -1.052067 0.000000
-6.206649 -1.073182 0.000000
-6.203073 -1.095037 0.000000
-6.200428 -1.115170 0.000000
-6.200488 -1.131159 0.000000
-6.200394 -1.147104 0.000000
-6.203691 -1.158164 0.000000
-6.205700 -1.170824 0.000000
-6.208193 -1.182665 0.000000
-6.210581 -1.194493 0.000000
-6.217129 -1.200756 0.000000
-6.222408 -1.208633 0.000000
-6.228246 -1.215744 0.000000
-6.235280 -1.221317 0.000000
-6.244165 -1.224596 0.000000
-6.253044 -1.227938 0.000000
-6.263191 -1.229801 0.000000
-6.278481 -1.225603 0.000000
-6.288685 -1.227651 0.000000
-6.298900 -1.229777 0.000000
-6.313707 -1.226690 0.000000
-6.325289 -1.227496 0.000000
-6.338223 -1.226899 0.000000
-6.351868 -1.225669 0.000000
-6.362875 -1.227518 0.000000
-6.379983 -1.222826 0.000000
-6.393780 -1.221956 0.000000
-6.404884 -1.224121 0.000000
-7.762633 -0.634393 0.000000
-7.761618 -0.657023 0.000000
-7.758788 -0.680731 0.000000
-7.759052 -0.702064 0.000000
-7.759977 -0.722776 0.000000
-7.765714 -0.740075 0.000000
-7.769671 -0.758496 0.000000
-7.774333 -0.776354 0.000000
-7.780548 -0.793117 0.000000
-7.784970 -0.810980 0.000000
-7.786737 -0.830447 0.000000
-7.787517 -0.850412 0.000000
-7.788999 -0.869805 0.000000
-7.792900 -0.887596 0.000000
-7.791543 -0.908480 0.000000
-7.791746 -0.928273 0.000000
-7.790942 -0.948523 0.000000
-7.788258 -0.969715 0.000000
-7.783677 -0.991819 0.000000
-7.781537 -1.012346 0.000000
-7.782738 -1.030854 0.000000
-7.782933 -1.049809 0.000000
-7.785630 -1.067290 0.000000
-7.787327 -1.085227 0.000000
-7.792439 -1.101274 0.000000
-7.800114 -1.115953 0.000000
-7.816604 -1.126121 0.000000
-7.833954 -1.135986 0.000000
-7.869184 -1.137107 0.000000
-7.910774 -1.135515 0.000000
-7.942562 -1.139145 0.000000
-12.085672 -2.457631 0.000000
-7.964524 -0.899762 0.000000
-7.959761 -0.785016 0.000000
-7.957818 -0.662511 0.000000
-7.944414 -0.604865 0.000000
-7.923230 -0.588351 0.000000
-7.900561 -0.579556 0.000000
-7.876059 -0.579429 0.000000
-7.851964 -0.577202 0.000000
-7.827196 -0.577755 0.000000
-7.801704 -0.581076 0.000000
-7.776143 -0.584236 0.000000
-7.752195 -0.580441 0.000000
-7.864043 1.653419 0.000000
-7.861203 1.673811 0.000000
-7.864000 1.704874 0.000000
-7.860720 1.723397 0.000000
-7.857625 1.741899 0.000000
-7.854247 1.759494 0.000000
-7.849623 1.774427 0.000000
-7.844187 1.787600 0.000000
-7.838873 1.800779 0.000000
-7.839055 1.823562 0.000000
-7.838978 1.845416 0.000000
-7.837129 1.863748 0.000000
-7.836974 1.884639 0.000000
-7.837539 1.906338 0.000000
-7.836271 1.924545 0.000000
-7.837258 1.946134 0.000000
-7.840036 1.970215 0.000000
-7.846235 1.999305 0.000000
-7.849007 2.022352 0.000000
-7.848247 2.039418 0.000000
-7.846024 2.053925 0.000000
-7.844487 2.069247 0.000000
-7.838674 2.077874 0.000000
-7.834046 2.088181 0.000000
-7.828945 2.097669 0.000000
-7.822220 2.104700 0.000000
-7.816690 2.113403 0.000000
-7.809499 2.119675 0.000000
-7.799440 2.121919 0.000000
-7.789375 2.124235 0.000000
-7.779306 2.126623 0.000000
-7.765656 2.124265 0.000000
-7.754348 2.125220 0.000000
-7.741202 2.123873 0.000000
-7.728618 2.123428 0.000000
-7.715379 2.122295 0.000000
-7.703950 2.123628 0.000000
-7.691878 2.124267 0.000000
-7.679150 2.124223 0.000000
-7.664488 2.121960 0.000000
-7.651037 2.121365 0.000000
-7.636902 2.120114 0.000000
-7.624007 2.120509 0.000000
-6.294290 1.572243 0.000000
-6.292173 1.593200 0.000000
-6.293422 1.616511 0.000000
-6.294054 1.639151 0.000000
-6.293250 1.660543 0.000000
-6.289365 1.679546 0.000000
-6.287248 1.699692 0.000000
-6.282825 1.718079 0.000000
-6.280999 1.738168 0.000000
-6.275198 1.755393 0.000000
-6.273655 1.775429 0.000000
-6.271430 1.794870 0.000000
-6.271015 1.815382 0.000000
-6.270756 1.835842 0.000000
-6.274856 1.858954 0.000000
-6.273231 1.878211 0.000000
-6.276829 1.900620 0.000000
-6.274652 1.919250 0.000000
-6.275167 1.939416 0.000000
-6.272408 1.957460 0.000000
-6.271493 1.976506 0.000000
-6.265542 1.992476 0.000000
-6.261423 2.009467 0.000000
-6.251339 2.022983 0.000000
-6.236102 2.033622 0.000000
-6.213913 2.040502 0.000000
-6.181198 2.041821 0.000000
-6.138738 2.038240 0.000000
-6.098798 2.036518 0.000000
-13.081808 1.570402 0.000000
-13.080239 1.453978 0.000000
-13.088829 1.387401 0.000000
-13.084902 1.271237 0.000000
-13.098574 1.232984 0.000000
-13.118369 1.220895 0.000000
-13.140532 1.218389 0.000000
-13.163203 1.217684 0.000000
-13.185899 1.216841 0.000000
-13.208617 1.215857 0.000000
-13.232979 1.220510 0.000000
-13.380362 1.479694 0.000000
-13.066305 -0.855171 0.000000
-13.053082 -0.901477 0.000000
-13.052448 -0.923962 0.000000
-13.055504 -0.939414 0.000000
-13.058904 -0.953980 0.000000
-13.061663 -0.969399 0.000000
-13.063766 -0.985662 0.000000
-13.064689 -1.003619 0.000000
-13.070071 -1.013823 0.000000
-13.073282 -1.027456 0.000000
-13.075314 -1.042779 0.000000
-13.062350 -1.081816 0.000000
-13.053244 -1.113896 0.000000
-13.051354 -1.134039 0.000000
-13.051440 -1.150760 0.000000
-13.053010 -1.164930 0.000000
-13.059991 -1.170754 0.000000
-13.067492 -1.175786 0.000000
-13.070449 -1.187466 0.000000
-13.060210 -1.218048 0.000000
-13.057680 -1.237003 0.000000
-13.057852 -1.251807 0.000000
-13.054963 -1.270633 0.000000
-13.051886 -1.289383 0.000000
-13.049212 -1.307251 0.000000
-13.051139 -1.318633 0.000000
-13.053564 -1.329200 0.000000
-13.057716 -1.337372 0.000000
-13.061192 -1.346344 0.000000
-13.066439 -1.352956 0.000000
-13.069777 -1.361943 0.000000
-13.078040 -1.364687 0.000000
-13.085671 -1.368267 0.000000
-13.093925 -1.371125 0.000000
-13.104092 -1.371734 0.000000
-13.112994 -1.373957 0.000000
-13.123198 -1.374721 0.000000
-13.133422 -1.375569 0.000000
-13.143012 -1.377252 0.000000
-13.154595 -1.376759 0.000000
-13.165552 -1.377111 0.000000
-13.176537 -1.377554 0.000000
-13.185527 -1.380305 0.000000
-13.197909 -1.379449 0.000000
-13.207605 -1.381624 0.000000
-13.217309 -1.383877 0.000000
-14.571663 -0.719062 0.000000
-14.592288 -0.725263 0.000000
-14.618610 -0.727567 0.000000
-14.641722 -0.732431 0.000000
-14.626345 -0.764444 0.000000
-14.534983 -0.848509 0.000000
-14.528640 -0.872839 0.000000
-14.524580 -0.895364 0.000000
-14.523668 -0.915571 0.000000
-14.528452 -0.931872 0.000000
-14.533123 -0.948175 0.000000
-14.539368 -0.963402 0.000000
-14.549742 -0.975978 0.000000
-14.565138 -0.985448 0.000000
-14.585611 -0.991900 0.000000
-14.597546 -1.003736 0.000000
-14.590558 -1.026982 0.000000
-14.550687 -1.069460 0.000000
-14.531124 -1.099316 0.000000
-14.513893 -1.127397 0.000000
-14.519014 -1.142375 0.000000
-14.524040 -1.157367 0.000000
-14.533344 -1.169952 0.000000
-14.558379 -1.173974 0.000000
-14.597532 -1.170659 0.000000
-14.607658 -1.183233 0.000000
-14.617719 -1.195880 0.000000
-14.662369 -1.190714 0.000000
-14.593078 -1.244071 0.000000
-14.539342 -1.288508 0.000000
-14.526410 -1.311896 0.000000
-14.521378 -1.331152 0.000000
-14.518905 -1.349012 0.000000
-14.519918 -1.365097 0.000000
-14.522638 -1.380311 0.000000
-14.528895 -1.393852 0.000000
-14.543276 -1.403725 0.000000
-14.565844 -1.410075 0.000000
-14.599411 -1.411840 0.000000
-14.634873 -1.413171 0.000000
-14.705389 -1.400052 0.000000
-7.785986 1.987306 0.000000
-6.241595 -1.087902 0.000000
-7.818628 -0.841812 0.000000
-6.233057 1.751774 0.000000
-7.024202 0.448513 0.000000
-6.121551 0.448513 0.000000
-7.926853 0.448513 0.000000
-7.024202 1.874979 0.000000
-7.024202 -0.964339 0.000000

+ 0 - 403
src/findwheel/data/2019-12-23_18:08:08.txt

@@ -1,403 +0,0 @@
-2.745561 -1.430225 0.000000
-2.780179 -1.427063 0.000000
-2.813821 -1.423892 0.000000
-2.847414 -1.421079 0.000000
-2.871741 -1.414739 0.000000
-2.886866 -1.404711 0.000000
-2.895607 -1.392032 0.000000
-2.901672 -1.378206 0.000000
-2.907817 -1.364416 0.000000
-2.905854 -1.346928 0.000000
-2.904921 -1.329800 0.000000
-2.899584 -1.310498 0.000000
-2.890781 -1.289373 0.000000
-2.888444 -1.271161 0.000000
-2.911365 -1.265239 0.000000
-3.053280 -1.318927 0.000000
-3.119543 -1.336284 0.000000
-3.125038 -1.323306 0.000000
-3.118196 -1.303886 0.000000
-3.128306 -1.293226 0.000000
-3.144638 -1.285953 0.000000
-3.137257 -1.265939 0.000000
-3.132665 -1.247249 0.000000
-3.142187 -1.236268 0.000000
-3.150894 -1.224866 0.000000
-3.159662 -1.213524 0.000000
-3.146880 -1.189674 0.000000
-3.115353 -1.154461 0.000000
-3.041241 -1.093197 0.000000
-2.904467 -0.992710 0.000000
-2.876200 -0.956462 0.000000
-2.884799 -0.942531 0.000000
-2.888403 -0.925453 0.000000
-2.894653 -0.909981 0.000000
-2.903523 -0.896158 0.000000
-2.946786 -0.904831 0.000000
-3.124087 -1.002866 0.000000
-3.229575 -1.055557 0.000000
-3.278125 -1.071215 0.000000
-3.307472 -1.074356 0.000000
-3.349843 -1.086937 0.000000
-3.408345 -1.111489 0.000000
-3.429056 -1.109949 0.000000
-3.394608 -1.068774 0.000000
-2.970530 -0.700273 0.000000
-2.952736 -0.665739 0.000000
-2.878958 -0.587696 0.000000
-2.842330 -0.536966 0.000000
-2.833723 -0.507388 0.000000
-2.810268 -0.245380 0.000000
-2.817049 -0.225739 0.000000
-2.812862 -0.196028 0.000000
-2.810412 -0.167548 0.000000
-2.812608 -0.143044 0.000000
-2.809175 -0.113015 0.000000
-2.811809 -0.088378 0.000000
-2.812483 -0.061615 0.000000
-2.820556 -0.041752 0.000000
-4.272307 -1.406718 0.000000
-4.283138 -1.405928 0.000000
-4.291866 -1.403065 0.000000
-4.304035 -1.403897 0.000000
-4.317528 -1.406294 0.000000
-4.328243 -1.405880 0.000000
-4.342980 -1.409981 0.000000
-4.352942 -1.409028 0.000000
-4.362882 -1.408156 0.000000
-4.373464 -1.408115 0.000000
-4.381383 -1.405150 0.000000
-4.393228 -1.406783 0.000000
-4.402426 -1.405477 0.000000
-4.409031 -1.401186 0.000000
-4.419498 -1.401546 0.000000
-4.428660 -1.400449 0.000000
-4.437174 -1.398648 0.000000
-4.446308 -1.397691 0.000000
-4.454802 -1.396022 0.000000
-4.460199 -1.390485 0.000000
-4.465632 -1.384975 0.000000
-4.469887 -1.377906 0.000000
-4.472384 -1.368460 0.000000
-4.476762 -1.361410 0.000000
-4.479411 -1.351962 0.000000
-4.481554 -1.341702 0.000000
-4.482619 -1.329808 0.000000
-4.482056 -1.315447 0.000000
-4.480482 -1.299407 0.000000
-4.479068 -1.283312 0.000000
-4.473287 -1.260566 0.000000
-4.469428 -1.240199 0.000000
-4.466891 -1.221409 0.000000
-4.467855 -1.207556 0.000000
-4.470594 -1.196185 0.000000
-4.466937 -1.174718 0.000000
-4.457060 -1.143044 0.000000
-4.451781 -1.117987 0.000000
-4.450455 -1.098776 0.000000
-4.452458 -1.084622 0.000000
-4.457182 -1.074727 0.000000
-4.465067 -1.069995 0.000000
-4.466388 -1.054105 0.000000
-4.462845 -1.029536 0.000000
-4.464035 -1.012689 0.000000
-4.467361 -0.999292 0.000000
-4.469356 -0.983265 0.000000
-4.471991 -0.968090 0.000000
-4.474300 -0.952018 0.000000
-4.476768 -0.935924 0.000000
-4.312863 1.391748 0.000000
-4.336059 1.393393 0.000000
-4.360173 1.391008 0.000000
-4.383091 1.393341 0.000000
-4.406448 1.393586 0.000000
-4.428699 1.398571 0.000000
-4.452030 1.398538 0.000000
-4.471038 1.418920 0.000000
-4.481911 1.480373 0.000000
-4.482279 1.598736 0.000000
-4.483436 1.720171 0.000000
-6.041062 1.829335 0.000000
-6.055937 1.771711 0.000000
-6.059408 1.658086 0.000000
-6.064501 1.559280 0.000000
-6.072073 1.478191 0.000000
-6.092113 1.460759 0.000000
-6.115149 1.457888 0.000000
-6.138397 1.455856 0.000000
-6.162096 1.455634 0.000000
-6.186050 1.456242 0.000000
-6.210276 1.457674 0.000000
-6.235508 1.462838 0.000000
-6.276058 1.527942 0.000000
-7.633774 2.095299 0.000000
-7.601587 1.971006 0.000000
-7.612959 1.930953 0.000000
-6.192020 -0.763546 0.000000
-6.185088 -0.798589 0.000000
-6.184193 -0.822186 0.000000
-6.187040 -0.838781 0.000000
-6.189725 -0.855354 0.000000
-6.193773 -0.869321 0.000000
-6.195124 -0.887572 0.000000
-6.199921 -0.899799 0.000000
-6.203561 -0.913734 0.000000
-6.206014 -0.929358 0.000000
-6.204051 -0.951727 0.000000
-6.205626 -0.968121 0.000000
-6.205414 -0.987002 0.000000
-6.206109 -1.004158 0.000000
-6.208847 -1.017940 0.000000
-6.210899 -1.032535 0.000000
-6.209439 -1.052067 0.000000
-6.206081 -1.074005 0.000000
-6.201929 -1.096677 0.000000
-6.200428 -1.115170 0.000000
-6.201069 -1.130345 0.000000
-6.200394 -1.147104 0.000000
-6.201918 -1.160583 0.000000
-6.204508 -1.172431 0.000000
-6.208193 -1.182665 0.000000
-6.210581 -1.194493 0.000000
-6.215910 -1.202342 0.000000
-6.221180 -1.210211 0.000000
-6.228865 -1.214958 0.000000
-6.234034 -1.222881 0.000000
-6.243537 -1.225375 0.000000
-6.253677 -1.227163 0.000000
-6.263828 -1.229030 0.000000
-6.278481 -1.225603 0.000000
-6.288685 -1.227651 0.000000
-6.299550 -1.229017 0.000000
-6.313707 -1.226690 0.000000
-6.325289 -1.227496 0.000000
-6.337560 -1.227647 0.000000
-6.351868 -1.225669 0.000000
-6.364891 -1.225297 0.000000
-6.381336 -1.221353 0.000000
-6.393099 -1.222689 0.000000
-6.404884 -1.224121 0.000000
-7.760200 -0.636147 0.000000
-7.762433 -0.656444 0.000000
-7.758788 -0.680731 0.000000
-7.759052 -0.702064 0.000000
-7.760802 -0.722211 0.000000
-7.765714 -0.740075 0.000000
-7.770503 -0.757940 0.000000
-7.775168 -0.775803 0.000000
-7.780548 -0.793117 0.000000
-7.795060 -0.804485 0.000000
-7.787581 -0.829911 0.000000
-7.787517 -0.850412 0.000000
-7.787298 -0.870858 0.000000
-7.792900 -0.887596 0.000000
-7.792398 -0.907964 0.000000
-7.792605 -0.927761 0.000000
-7.790942 -0.948523 0.000000
-7.786528 -0.970718 0.000000
-7.784545 -0.991323 0.000000
-7.781537 -1.012346 0.000000
-7.780991 -1.031826 0.000000
-7.782933 -1.049809 0.000000
-7.785630 -1.067290 0.000000
-7.785563 -1.086169 0.000000
-7.793324 -1.100808 0.000000
-7.798338 -1.116874 0.000000
-7.816604 -1.126121 0.000000
-7.836633 -1.134635 0.000000
-7.867393 -1.137997 0.000000
-7.908080 -1.136835 0.000000
-7.943462 -1.138711 0.000000
-12.087147 -2.460243 0.000000
-7.964169 -0.901730 0.000000
-7.960310 -0.782068 0.000000
-7.957818 -0.662511 0.000000
-7.944804 -0.602904 0.000000
-7.924032 -0.584432 0.000000
-7.900355 -0.580534 0.000000
-7.876059 -0.579429 0.000000
-7.851964 -0.577202 0.000000
-7.827643 -0.575806 0.000000
-7.801934 -0.580102 0.000000
-7.775908 -0.585209 0.000000
-7.751955 -0.581411 0.000000
-7.864485 1.654316 0.000000
-7.861650 1.674705 0.000000
-7.863095 1.703091 0.000000
-7.859804 1.721619 0.000000
-7.857162 1.741013 0.000000
-7.854715 1.760378 0.000000
-7.849150 1.773546 0.000000
-7.845143 1.789356 0.000000
-7.840323 1.803406 0.000000
-7.839055 1.823562 0.000000
-7.838978 1.845416 0.000000
-7.837628 1.864615 0.000000
-7.837478 1.885503 0.000000
-7.838556 1.908060 0.000000
-7.836785 1.925403 0.000000
-7.837777 1.946989 0.000000
-7.841084 1.971919 0.000000
-7.845178 1.997607 0.000000
-7.849540 2.023198 0.000000
-7.850400 2.042789 0.000000
-7.844937 2.052246 0.000000
-7.843939 2.068410 0.000000
-7.839227 2.078707 0.000000
-7.834046 2.088181 0.000000
-7.829507 2.098495 0.000000
-7.822787 2.105523 0.000000
-7.817262 2.114223 0.000000
-7.809499 2.119675 0.000000
-7.800604 2.123546 0.000000
-7.788789 2.123425 0.000000
-7.778123 2.125010 0.000000
-7.766848 2.125871 0.000000
-7.754348 2.125220 0.000000
-7.740597 2.123077 0.000000
-7.728618 2.123428 0.000000
-7.717222 2.124662 0.000000
-7.702712 2.122057 0.000000
-7.692502 2.125049 0.000000
-7.679150 2.124223 0.000000
-7.663855 2.121186 0.000000
-7.651037 2.121365 0.000000
-7.637544 2.120881 0.000000
-6.296672 1.574066 0.000000
-6.291375 1.592597 0.000000
-6.293422 1.616511 0.000000
-6.293250 1.638557 0.000000
-6.294058 1.661132 0.000000
-6.288553 1.678962 0.000000
-6.288877 1.700851 0.000000
-6.284462 1.719228 0.000000
-6.280178 1.737598 0.000000
-6.276848 1.756523 0.000000
-6.275311 1.776550 0.000000
-6.272261 1.795426 0.000000
-6.271850 1.815932 0.000000
-6.270756 1.835842 0.000000
-6.272332 1.857331 0.000000
-6.274919 1.879283 0.000000
-6.275982 1.900089 0.000000
-6.276353 1.920302 0.000000
-6.276875 1.940459 0.000000
-6.273264 1.957976 0.000000
-6.271493 1.976506 0.000000
-6.267266 1.993488 0.000000
-6.261423 2.009467 0.000000
-6.252207 2.023479 0.000000
-6.236973 2.034113 0.000000
-6.213913 2.040502 0.000000
-6.178568 2.040378 0.000000
-6.137858 2.037764 0.000000
-6.098798 2.036518 0.000000
-13.081808 1.570402 0.000000
-13.080239 1.453978 0.000000
-13.089505 1.390324 0.000000
-13.085133 1.272210 0.000000
-13.098574 1.232984 0.000000
-13.118853 1.222835 0.000000
-13.140779 1.219357 0.000000
-13.163203 1.217684 0.000000
-13.186158 1.217806 0.000000
-13.209411 1.218750 0.000000
-13.232979 1.220510 0.000000
-13.272602 1.277869 0.000000
-13.381797 1.484483 0.000000
-13.066780 -0.854291 0.000000
-13.053082 -0.901477 0.000000
-13.053418 -0.922213 0.000000
-13.055014 -0.940285 0.000000
-13.059894 -0.952242 0.000000
-13.061663 -0.969399 0.000000
-13.063766 -0.985662 0.000000
-13.065710 -1.001899 0.000000
-13.070071 -1.013823 0.000000
-13.073802 -1.026602 0.000000
-13.075314 -1.042779 0.000000
-13.061820 -1.082664 0.000000
-13.053244 -1.113896 0.000000
-13.051895 -1.133197 0.000000
-13.051986 -1.149921 0.000000
-13.053560 -1.164095 0.000000
-13.059991 -1.170754 0.000000
-13.069170 -1.173300 0.000000
-13.069321 -1.189117 0.000000
-13.060780 -1.217226 0.000000
-13.057106 -1.237822 0.000000
-13.059009 -1.250176 0.000000
-13.056130 -1.269008 0.000000
-13.050710 -1.291000 0.000000
-13.050397 -1.305641 0.000000
-13.050541 -1.319435 0.000000
-13.053564 -1.329200 0.000000
-13.058323 -1.336577 0.000000
-13.062414 -1.344761 0.000000
-13.065823 -1.353743 0.000000
-13.071017 -1.360375 0.000000
-13.078665 -1.363907 0.000000
-13.086930 -1.366713 0.000000
-13.094559 -1.370352 0.000000
-13.105369 -1.370196 0.000000
-13.114281 -1.372425 0.000000
-13.122550 -1.375483 0.000000
-13.133422 -1.375569 0.000000
-13.143668 -1.376498 0.000000
-13.154595 -1.376759 0.000000
-13.164222 -1.378604 0.000000
-13.174528 -1.379782 0.000000
-13.184854 -1.381044 0.000000
-13.198587 -1.378713 0.000000
-13.208969 -1.380162 0.000000
-13.218682 -1.382422 0.000000
-14.572469 -0.718470 0.000000
-14.593098 -0.724676 0.000000
-14.617798 -0.728150 0.000000
-14.644171 -0.730698 0.000000
-14.626345 -0.764444 0.000000
-14.534161 -0.849078 0.000000
-14.530292 -0.871712 0.000000
-14.523751 -0.895922 0.000000
-14.523668 -0.915571 0.000000
-14.527616 -0.932420 0.000000
-14.534801 -0.947086 0.000000
-14.539368 -0.963402 0.000000
-14.548051 -0.977047 0.000000
-14.566834 -0.984389 0.000000
-14.585611 -0.991900 0.000000
-14.599255 -1.002697 0.000000
-14.590558 -1.026982 0.000000
-14.550687 -1.069460 0.000000
-14.531124 -1.099316 0.000000
-14.517359 -1.125399 0.000000
-14.516407 -1.143859 0.000000
-14.525784 -1.156388 0.000000
-14.533344 -1.169952 0.000000
-14.559257 -1.173495 0.000000
-14.599294 -1.169711 0.000000
-14.609425 -1.182295 0.000000
-14.616833 -1.196344 0.000000
-14.663258 -1.190255 0.000000
-14.592186 -1.244524 0.000000
-14.541130 -1.287611 0.000000
-14.527307 -1.311453 0.000000
-14.521378 -1.331152 0.000000
-14.518003 -1.349445 0.000000
-14.518111 -1.365951 0.000000
-14.524451 -1.379466 0.000000
-14.530713 -1.393018 0.000000
-14.546010 -1.402491 0.000000
-14.566757 -1.409668 0.000000
-14.598495 -1.412241 0.000000
-14.633955 -1.413566 0.000000
-14.705389 -1.400052 0.000000
-7.789766 1.984627 0.000000
-6.241416 -1.088192 0.000000
-7.818792 -0.841554 0.000000
-6.233291 1.751788 0.000000
-7.025328 0.449218 0.000000
-6.121378 0.449218 0.000000
-7.929277 0.449218 0.000000
-7.025328 1.872632 0.000000
-7.025328 -0.964295 0.000000

+ 0 - 404
src/findwheel/data/2019-12-23_18:08:11.txt

@@ -1,404 +0,0 @@
-2.746491 -1.430591 0.000000
-2.778322 -1.426318 0.000000
-2.814747 -1.424270 0.000000
-2.844642 -1.419930 0.000000
-2.869898 -1.413963 0.000000
-2.884108 -1.403530 0.000000
-2.897441 -1.392830 0.000000
-2.903501 -1.379015 0.000000
-2.906905 -1.364007 0.000000
-2.906763 -1.347342 0.000000
-2.904921 -1.329800 0.000000
-2.899584 -1.310498 0.000000
-2.890781 -1.289373 0.000000
-2.889344 -1.271597 0.000000
-2.907775 -1.263473 0.000000
-3.034489 -1.309551 0.000000
-3.113297 -1.333122 0.000000
-3.120591 -1.321022 0.000000
-3.119083 -1.304348 0.000000
-3.125654 -1.291825 0.000000
-3.141993 -1.284536 0.000000
-3.133742 -1.264029 0.000000
-3.127410 -1.244353 0.000000
-3.135203 -1.232367 0.000000
-3.142192 -1.219939 0.000000
-3.150989 -1.208547 0.000000
-3.133050 -1.181629 0.000000
-3.107600 -1.149890 0.000000
-3.029222 -1.086017 0.000000
-2.901900 -0.991156 0.000000
-2.877905 -0.957507 0.000000
-2.883950 -0.942003 0.000000
-2.890095 -0.926519 0.000000
-2.892967 -0.908906 0.000000
-2.901844 -0.895073 0.000000
-2.935069 -0.897167 0.000000
-3.099077 -0.986299 0.000000
-3.217949 -1.047758 0.000000
-3.269026 -1.065034 0.000000
-3.296761 -1.066989 0.000000
-3.344099 -1.082936 0.000000
-3.402625 -1.107455 0.000000
-3.428242 -1.109368 0.000000
-3.397850 -1.071117 0.000000
-2.968929 -0.699073 0.000000
-2.951143 -0.664530 0.000000
-2.878958 -0.587696 0.000000
-2.839962 -0.535125 0.000000
-2.834509 -0.508006 0.000000
-2.809519 -0.244716 0.000000
-2.817049 -0.225739 0.000000
-2.813603 -0.196700 0.000000
-2.816307 -0.172955 0.000000
-2.813341 -0.143724 0.000000
-2.812091 -0.115753 0.000000
-2.812534 -0.089066 0.000000
-2.813204 -0.062308 0.000000
-2.820556 -0.041752 0.000000
-4.272307 -1.406718 0.000000
-4.283834 -1.406646 0.000000
-4.290482 -1.401621 0.000000
-4.305411 -1.405348 0.000000
-4.316845 -1.405565 0.000000
-4.328243 -1.405880 0.000000
-4.342980 -1.409981 0.000000
-4.353612 -1.409769 0.000000
-4.362882 -1.408156 0.000000
-4.373464 -1.408115 0.000000
-4.382699 -1.406656 0.000000
-4.392574 -1.406026 0.000000
-4.401128 -1.403956 0.000000
-4.410965 -1.403479 0.000000
-4.420138 -1.402314 0.000000
-4.429932 -1.401993 0.000000
-4.437174 -1.398648 0.000000
-4.445055 -1.396133 0.000000
-4.454179 -1.395239 0.000000
-4.459581 -1.389698 0.000000
-4.466246 -1.385765 0.000000
-4.469887 -1.377906 0.000000
-4.472988 -1.369257 0.000000
-4.476163 -1.360609 0.000000
-4.479411 -1.351962 0.000000
-4.482144 -1.342509 0.000000
-4.483204 -1.330619 0.000000
-4.482636 -1.316262 0.000000
-4.481633 -1.301043 0.000000
-4.479068 -1.283312 0.000000
-4.473287 -1.260566 0.000000
-4.469989 -1.241027 0.000000
-4.466335 -1.220578 0.000000
-4.467855 -1.207556 0.000000
-4.471141 -1.197022 0.000000
-4.466395 -1.173878 0.000000
-4.455986 -1.141356 0.000000
-4.451781 -1.117987 0.000000
-4.452563 -1.102175 0.000000
-4.453502 -1.086328 0.000000
-4.457700 -1.075583 0.000000
-4.464555 -1.069136 0.000000
-4.465880 -1.053243 0.000000
-4.462845 -1.029536 0.000000
-4.464532 -1.013557 0.000000
-4.467361 -0.999292 0.000000
-4.469842 -0.984139 0.000000
-4.471991 -0.968090 0.000000
-4.473346 -0.950260 0.000000
-4.478183 -0.938570 0.000000
-4.311887 1.395627 0.000000
-4.336059 1.393393 0.000000
-4.360173 1.391008 0.000000
-4.383545 1.391393 0.000000
-4.406448 1.393586 0.000000
-4.429131 1.396618 0.000000
-4.452030 1.398538 0.000000
-4.471652 1.415984 0.000000
-4.483501 1.472533 0.000000
-4.483051 1.594811 0.000000
-4.483436 1.720171 0.000000
-4.471456 1.920396 0.000000
-6.041949 1.834256 0.000000
-6.055388 1.768763 0.000000
-6.060163 1.662014 0.000000
-6.064889 1.561241 0.000000
-6.071473 1.475252 0.000000
-6.092319 1.461738 0.000000
-6.114514 1.454956 0.000000
-6.138615 1.456832 0.000000
-6.161650 1.453684 0.000000
-6.186279 1.457215 0.000000
-6.210276 1.457674 0.000000
-6.235508 1.462838 0.000000
-6.276058 1.527942 0.000000
-7.634699 2.097073 0.000000
-7.602056 1.971890 0.000000
-7.609649 1.924784 0.000000
-6.192986 -0.761795 0.000000
-6.186065 -0.796844 0.000000
-6.185179 -0.820446 0.000000
-6.187538 -0.837914 0.000000
-6.190228 -0.854490 0.000000
-6.192248 -0.871904 0.000000
-6.195637 -0.886714 0.000000
-6.199921 -0.899799 0.000000
-6.203038 -0.914587 0.000000
-6.204429 -0.931905 0.000000
-6.205118 -0.950035 0.000000
-6.205626 -0.968121 0.000000
-6.204871 -0.987842 0.000000
-6.206109 -1.004158 0.000000
-6.209400 -1.017107 0.000000
-6.210341 -1.033365 0.000000
-6.210001 -1.051240 0.000000
-6.206081 -1.074005 0.000000
-6.201929 -1.096677 0.000000
-6.200428 -1.115170 0.000000
-6.201069 -1.130345 0.000000
-6.200980 -1.146294 0.000000
-6.202509 -1.159777 0.000000
-6.205104 -1.171628 0.000000
-6.208193 -1.182665 0.000000
-6.211791 -1.192900 0.000000
-6.215910 -1.202342 0.000000
-6.221180 -1.210211 0.000000
-6.226390 -1.218100 0.000000
-6.235280 -1.221317 0.000000
-6.242909 -1.226153 0.000000
-6.252412 -1.228713 0.000000
-6.264465 -1.228259 0.000000
-6.277839 -1.226370 0.000000
-6.288039 -1.228414 0.000000
-6.300200 -1.228258 0.000000
-6.313052 -1.227446 0.000000
-6.324630 -1.228248 0.000000
-6.338223 -1.226899 0.000000
-6.352536 -1.224924 0.000000
-6.362875 -1.227518 0.000000
-6.380659 -1.222090 0.000000
-6.394460 -1.221224 0.000000
-6.404884 -1.224121 0.000000
-7.761011 -0.635562 0.000000
-7.762433 -0.656444 0.000000
-7.758788 -0.680731 0.000000
-7.759052 -0.702064 0.000000
-7.760802 -0.722211 0.000000
-7.764886 -0.740636 0.000000
-7.771334 -0.757384 0.000000
-7.773499 -0.776905 0.000000
-7.780548 -0.793117 0.000000
-7.785811 -0.810438 0.000000
-7.787581 -0.829911 0.000000
-7.785822 -0.851475 0.000000
-7.788999 -0.869805 0.000000
-7.791194 -0.888639 0.000000
-7.792398 -0.907964 0.000000
-7.792605 -0.927761 0.000000
-7.790942 -0.948523 0.000000
-7.787393 -0.970217 0.000000
-7.783677 -0.991819 0.000000
-7.781537 -1.012346 0.000000
-7.780991 -1.031826 0.000000
-7.782056 -1.050290 0.000000
-7.784751 -1.067766 0.000000
-7.788209 -1.084756 0.000000
-7.792439 -1.101274 0.000000
-7.799226 -1.116414 0.000000
-7.817494 -1.125665 0.000000
-7.835740 -1.135086 0.000000
-7.866498 -1.138443 0.000000
-7.908978 -1.136395 0.000000
-7.940761 -1.140015 0.000000
-8.974403 3.064203 0.000000
-8.950295 3.101094 0.000000
-8.932526 3.127801 0.000000
-7.965946 -0.891889 0.000000
-7.960310 -0.782068 0.000000
-7.958953 -0.656620 0.000000
-7.944609 -0.603884 0.000000
-7.923832 -0.585411 0.000000
-7.900767 -0.578577 0.000000
-7.876059 -0.579429 0.000000
-7.851747 -0.578178 0.000000
-7.827643 -0.575806 0.000000
-7.801247 -0.583023 0.000000
-7.775674 -0.586181 0.000000
-7.752195 -0.580441 0.000000
-7.864927 1.655213 0.000000
-7.862097 1.675599 0.000000
-7.864000 1.704874 0.000000
-7.861177 1.724287 0.000000
-7.858551 1.743672 0.000000
-7.854247 1.759494 0.000000
-7.849623 1.774427 0.000000
-7.843709 1.786722 0.000000
-7.839839 1.802530 0.000000
-7.839544 1.824434 0.000000
-7.840459 1.848025 0.000000
-7.838127 1.865482 0.000000
-7.838485 1.887231 0.000000
-7.837539 1.906338 0.000000
-7.836785 1.925403 0.000000
-7.837777 1.946989 0.000000
-7.842655 1.974474 0.000000
-7.846235 1.999305 0.000000
-7.849540 2.023198 0.000000
-7.848247 2.039418 0.000000
-7.847653 2.056444 0.000000
-7.844487 2.069247 0.000000
-7.839227 2.078707 0.000000
-7.834046 2.088181 0.000000
-7.830070 2.099322 0.000000
-7.822787 2.105523 0.000000
-7.817262 2.114223 0.000000
-7.809499 2.119675 0.000000
-7.800022 2.122732 0.000000
-7.789375 2.124235 0.000000
-7.778715 2.125816 0.000000
-7.766252 2.125068 0.000000
-7.754949 2.126019 0.000000
-7.741202 2.123873 0.000000
-7.728008 2.122635 0.000000
-7.716608 2.123873 0.000000
-7.702712 2.122057 0.000000
-7.691878 2.124267 0.000000
-7.679150 2.124223 0.000000
-7.665120 2.122735 0.000000
-7.651675 2.122136 0.000000
-7.637544 2.120881 0.000000
-6.296672 1.574066 0.000000
-6.292173 1.593200 0.000000
-6.293422 1.616511 0.000000
-6.295664 1.640338 0.000000
-6.293250 1.660543 0.000000
-6.292611 1.681883 0.000000
-6.286432 1.699113 0.000000
-6.283644 1.718654 0.000000
-6.281821 1.738737 0.000000
-6.276023 1.755958 0.000000
-6.274483 1.775989 0.000000
-6.272261 1.795426 0.000000
-6.271850 1.815932 0.000000
-6.272431 1.836933 0.000000
-6.274856 1.858954 0.000000
-6.275763 1.879819 0.000000
-6.276829 1.900620 0.000000
-6.276353 1.920302 0.000000
-6.276021 1.939937 0.000000
-6.273264 1.957976 0.000000
-6.272353 1.977018 0.000000
-6.267266 1.993488 0.000000
-6.261423 2.009467 0.000000
-6.252207 2.023479 0.000000
-6.236102 2.033622 0.000000
-6.212165 2.039530 0.000000
-6.176814 2.039416 0.000000
-6.136099 2.036813 0.000000
-6.097033 2.035577 0.000000
-13.081808 1.570402 0.000000
-13.080459 1.454953 0.000000
-13.089280 1.389350 0.000000
-13.084902 1.271237 0.000000
-13.098337 1.232012 0.000000
-13.118853 1.222835 0.000000
-13.141027 1.220326 0.000000
-13.163457 1.218652 0.000000
-13.186676 1.219738 0.000000
-13.208881 1.216821 0.000000
-13.233520 1.222436 0.000000
-13.067254 -0.853411 0.000000
-13.053562 -0.900599 0.000000
-13.053418 -0.922213 0.000000
-13.055994 -0.938542 0.000000
-13.059894 -0.952242 0.000000
-13.062663 -0.967668 0.000000
-13.064271 -0.984799 0.000000
-13.065710 -1.001899 0.000000
-13.070586 -1.012966 0.000000
-13.074323 -1.025748 0.000000
-13.075314 -1.042779 0.000000
-13.061820 -1.082664 0.000000
-13.054314 -1.112206 0.000000
-13.052435 -1.132356 0.000000
-13.051986 -1.149921 0.000000
-13.053010 -1.164930 0.000000
-13.060545 -1.169922 0.000000
-13.068051 -1.174957 0.000000
-13.069884 -1.188291 0.000000
-13.061348 -1.216404 0.000000
-13.057106 -1.237822 0.000000
-13.058430 -1.250991 0.000000
-13.056130 -1.269008 0.000000
-13.050710 -1.291000 0.000000
-13.049805 -1.306446 0.000000
-13.051737 -1.317832 0.000000
-13.055973 -1.326007 0.000000
-13.058323 -1.336577 0.000000
-13.063025 -1.343970 0.000000
-13.065823 -1.353743 0.000000
-13.072258 -1.358806 0.000000
-13.078040 -1.364687 0.000000
-13.086930 -1.366713 0.000000
-13.093925 -1.371125 0.000000
-13.106007 -1.369426 0.000000
-13.114281 -1.372425 0.000000
-13.124493 -1.373197 0.000000
-13.133422 -1.375569 0.000000
-13.143668 -1.376498 0.000000
-13.153935 -1.377510 0.000000
-13.165552 -1.377111 0.000000
-13.175867 -1.378297 0.000000
-13.185527 -1.380305 0.000000
-13.197909 -1.379449 0.000000
-13.208287 -1.380893 0.000000
-13.218682 -1.382422 0.000000
-14.574080 -0.717285 0.000000
-14.593098 -0.724676 0.000000
-14.619423 -0.726985 0.000000
-14.642538 -0.731853 0.000000
-14.630442 -0.761579 0.000000
-14.534983 -0.848509 0.000000
-14.528640 -0.872839 0.000000
-14.524580 -0.895364 0.000000
-14.524501 -0.915017 0.000000
-14.528452 -0.931872 0.000000
-14.533123 -0.948175 0.000000
-14.539368 -0.963402 0.000000
-14.551432 -0.974910 0.000000
-14.566834 -0.984389 0.000000
-14.586463 -0.991376 0.000000
-14.600964 -1.001658 0.000000
-14.592274 -1.025953 0.000000
-14.548965 -1.070480 0.000000
-14.531124 -1.099316 0.000000
-14.516492 -1.125899 0.000000
-14.518146 -1.142870 0.000000
-14.525784 -1.156388 0.000000
-14.534220 -1.169467 0.000000
-14.560135 -1.173016 0.000000
-14.597532 -1.170659 0.000000
-14.609425 -1.182295 0.000000
-14.618605 -1.195416 0.000000
-14.664146 -1.189797 0.000000
-14.594860 -1.243164 0.000000
-14.539342 -1.288508 0.000000
-14.526410 -1.311896 0.000000
-14.522276 -1.330714 0.000000
-14.519806 -1.348580 0.000000
-14.519918 -1.365097 0.000000
-14.523544 -1.379888 0.000000
-14.528895 -1.393852 0.000000
-14.543276 -1.403725 0.000000
-14.565844 -1.410075 0.000000
-14.596663 -1.413043 0.000000
-14.633955 -1.413566 0.000000
-14.709992 -1.398101 0.000000
-7.794058 1.986317 0.000000
-6.241426 -1.088144 0.000000
-7.818521 -0.841474 0.000000
-6.233304 1.751761 0.000000
-7.024753 0.448541 0.000000
-6.121957 0.448541 0.000000
-7.927548 0.448541 0.000000
-7.024753 1.872500 0.000000
-7.024753 -0.964250 0.000000

+ 1 - 0
src/findwheel/scripts/EleFence.proto

@@ -35,4 +35,5 @@ message globalParam
     repeated lidarParam lidar_params=1;
     repeated Region regions=2;
     optional string data_path=3 [default=""];
+    optional string fence_log_path=4 [default=""];
 }

+ 39 - 0
src/findwheel/scripts/setting.prototxt

@@ -1,4 +1,43 @@
 data_path:"/home/youchen/Documents/measure/MainStructure/elecfence_ws/src/findwheel/data"
+fence_log_path:"/home/youchen/Documents/measure/MainStructure/elecfence_ws/src/findwheel/log"
+
+lidar_params
+{
+    topic:"/scan1"
+	transform
+	{
+		m00:0.0082915
+		m01:0.9999656
+		m02:-1.61686
+		m10:0.9999656
+		m11:-0.0082915
+		m12:-2.433125
+	}
+	minx:0.1
+    maxx:5
+    miny:0
+    maxy:3.5
+	dist_limit:10
+}
+
+lidar_params
+{
+    topic:"/scan2"
+	transform
+	{
+		m00:0.0099967
+		m01:-0.9999499
+		m02:1.75814
+		m10:-0.9999499
+		m11:-0.0099967
+		m12:3.435875
+	}
+	minx:0.1
+    maxx:6
+    miny:-3.5
+    maxy:3.5
+	dist_limit:10
+}
 
 lidar_params
 {

+ 79 - 40
src/findwheel/src/FenceController.cpp

@@ -33,42 +33,61 @@ void FenceController::save_cloud_txt(std::string txt, pcl::PointCloud<pcl::Point
 FenceController::FenceController(std::string path):
 m_initialized(0)
 {
-    // char buf[100];
-    // getcwd(buf, sizeof(buf));
-    //printf("%s\n",buf);
-    //FLAGS_log_dir = buf;
-    // google::InitGoogleLogging("path");
+    char curr_dir[100];
+    getcwd(curr_dir, sizeof(curr_dir));
     p_merged_cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
     m_initialized = ReadProtoParam(path);
+    // create log path
+    if(m_global_param.has_fence_log_path() && m_global_param.fence_log_path()!= ""){
+        PathCreator path_creator;
+        path_creator.CreateDatePath(m_global_param.fence_log_path(), false);
+        FLAGS_log_dir = path_creator.GetCurPath();
+    }else{
+        FLAGS_log_dir = curr_dir;
+    }
+    // create data path
+    if(m_global_param.has_data_path() && m_global_param.data_path() != ""){
+        PathCreator path_creator;
+        path_creator.Mkdir(m_global_param.data_path());
+    }
+    google::InitGoogleLogging("path");
+    google::SetStderrLogging(google::INFO);
+    LOG(INFO)<<"init param and glog";
     const int lidar_size = m_global_param.lidar_params_size();
     const int region_size = m_global_param.regions_size();
     p_lidars.resize(lidar_size);
     p_region_workers.resize(region_size);
     p_plc_data = PlcData::GetInstance("192.168.0.1");
-
-    // init wheel handling thread and queue
-    m_cond_wheel_exit.Notify(false);
-
-    if(m_wheel_soc){
-        m_wheel_soc.bind(CONNECTSTRING);
-    }
-    m_wheel_recv_thread = new std::thread(wheelMsgRecvThread, this);
-    m_wheel_send_thread=new std::thread(wheelMsgHandlingThread,this);
+    LOG(INFO) << "create plc data handler"<<p_plc_data;
 
     // init lidar instances
-    for (int i = 0; i < m_global_param.lidar_params_size(); ++i) {
+    for (int i = 0; i < m_global_param.lidar_params_size(); ++i)
+    {
         p_lidars[i] = new Lidar(m_global_param.lidar_params(i), m_handle);
     }
     // init region_detector instances
-    for (int j = 0; j < m_global_param.regions_size(); ++j) {
+    for (int j = 0; j < m_global_param.regions_size(); ++j)
+    {
         p_region_workers[j] = new Region_worker(j, m_global_param.regions(j));
     }
+    LOG(INFO) << "create lidars and region workers";
+
+    // init wheel handling thread
+    m_cond_wheel_exit.Notify(false);
+    if(m_wheel_soc){
+        m_wheel_soc.bind(CONNECTSTRING);
+    }
+    m_wheel_send_thread=new std::thread(wheelMsgHandlingThread,this);
+    m_wheel_send_thread->detach();
+    m_wheel_recv_thread = new std::thread(wheelMsgRecvThread, this);
+    m_wheel_recv_thread->detach();
+    LOG(INFO)<<"create wheel msg handle threads";
+
     m_cond_exit.Notify(false);
     m_update_thread = new std::thread(cloudMergeUpdate, this);
-//    while(m_initialized){
-//        cloudMergeUpdate(this);
-//        usleep(1000*50);
-//    }
+    m_update_thread->detach();
+    LOG(INFO)<<"create cloud merge thread";
+
 }
 
 FenceController::~FenceController()
@@ -82,7 +101,7 @@ FenceController::~FenceController()
         delete m_update_thread;
         m_update_thread = 0;
     }
-    std::cout<<"exit 00"<<std::endl;
+    LOG(INFO)<<"exit update cloud thread";
     if(m_wheel_recv_thread){
         if(m_wheel_recv_thread->joinable()){
             m_wheel_recv_thread->join();
@@ -90,7 +109,7 @@ FenceController::~FenceController()
         delete m_wheel_recv_thread;
         m_wheel_recv_thread = 0;
     }
-    std::cout<<"exit 01"<<std::endl;
+    LOG(INFO)<<"exit receive wheel msg thread";
     if(m_wheel_send_thread){
         if(m_wheel_send_thread->joinable()){
             m_wheel_send_thread->join();
@@ -98,18 +117,26 @@ FenceController::~FenceController()
         delete m_wheel_send_thread;
         m_wheel_send_thread = 0;
     }
-    std::cout<<"exit 02"<<std::endl;
+    LOG(INFO)<<"exit send wheel result thread";
     // delete lidar instances
     for (int i = 0; i < m_global_param.lidar_params_size(); ++i) {
-        delete p_lidars[i];
+        if(p_lidars[i]){
+            delete p_lidars[i];
+            p_lidars[i] = 0;
+        }
     }
+    LOG(INFO)<<"exit lidar handlers";
     // delete region_detector instances
     for (int j = 0; j < m_global_param.regions_size(); ++j) {
-        delete p_region_workers[j];
+        if(p_region_workers[j]){
+            delete p_region_workers[j];
+            p_region_workers[j] = 0;
+        }
     }
-    std::cout<<"exit 03"<<std::endl;
-    PlcData::Release();
-    // google::ShutdownGoogleLogging();
+    LOG(INFO)<<"exit region worker handles";
+    //PlcData::Release();
+    LOG(INFO)<<"exit plc communicator";
+    google::ShutdownGoogleLogging();
 }
 void FenceController::GetCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_out){
     m_cloud_mutex.lock();
@@ -155,7 +182,8 @@ void FenceController::wheelMsgRecvThread(FenceController* fc)
                 task.sock_controller=c1;
                 fc->m_msg_queue.push(task);
 
-                std::cout<<"-------recv msg -------"<<task.cmd<<std::endl;
+                // std::cout<<"-------recv msg -------"<<task.cmd<<std::endl;
+                LOG(INFO) << "-------recv msg " << task.cmd.c_str() << "-------";
             }
         }
         // std::cout<<"++++++++++++++++"<<std::endl;
@@ -184,15 +212,19 @@ void FenceController::wheelMsgHandlingThread(FenceController* fc){
             if(task.cmd.size()>8 && task.cmd.substr(0, 8) == "Terminal")
             {
                 int terminal_id = atoi(task.cmd.substr(8, task.cmd.length() - 8).c_str());
-                std::cout << "terminal id: " << terminal_id << std::endl;
+                // std::cout << "terminal id: " << terminal_id << std::endl;
+                LOG(INFO)<<"handling msg from terminal id: " << terminal_id;
                 while (count-- >= 0 && !result.correctness())
                 {
-                    std::cout<<" times :"<<count<<std::endl;
+                    // std::cout<<" times :"<<count<<std::endl;
+                    LOG(INFO)<<"times :"<<count;
                     for (int i = 0; i < fc->p_region_workers.size(); ++i)
                     {
+                        // LOG(INFO)<<"--------callback try to find terminal------" << fc->p_region_workers[i]->get_id();
                         if (terminal_id >= 0 && fc->p_region_workers[i]->get_id() == terminal_id)
                         {
-                             std::cout << "--------callback find terminal------" << terminal_id << std::endl;
+                            //  std::cout << "--------callback find terminal------" << terminal_id << std::endl;
+                            LOG(INFO)<<"--------callback find terminal------" << terminal_id;
                             double x = 0, y = 0, c = 0, wheelbase = 0, width = 0;
                             // std::cout << "--------callback get time------" << std::endl;
                             fc->m_cloud_mutex.lock();
@@ -200,32 +232,37 @@ void FenceController::wheelMsgHandlingThread(FenceController* fc){
                             for (int i = 0; i < fc->p_lidars.size(); ++i)
                             {
                                 pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
-                                if (fc->p_lidars[i]->GetCloud(cloud))
+                                if (fc->p_lidars[i]->GetCloud(cloud, 600, false))
                                 {
                                     total_cloud->operator+=(*cloud);
                                 }
                             }
                             fc->m_cloud_mutex.unlock();
-                             std::cout << "--------callback get cloud------" << std::endl;
+                            // std::cout << "--------callback get cloud, size: "<<total_cloud->size()<<"------" << std::endl;
+                            LOG(INFO)<< "--------callback get cloud, size: "<<total_cloud->size();
                             if (total_cloud->size() > 0 &&
                                 fc->p_region_workers[i]->get_wheel_result(total_cloud, x, y, c, wheelbase, width))
                             {
                                 result.set_correctness(true);
                                 // save cloud txt
-                                if (fc->m_global_param.data_path() != "")
+                                if (fc->m_global_param.has_data_path()&& fc->m_global_param.data_path() != "")
                                 {
+                                    PathCreator path_creator;
+                                    path_creator.CreateDatePath(fc->m_global_param.data_path(), false);
                                     char cloud_txt_filename[255];
                                     memset(cloud_txt_filename, 0, 255);
-                                    sprintf(cloud_txt_filename, "%s//%s.txt", fc->m_global_param.data_path().c_str(), result.time().c_str());
+                                    sprintf(cloud_txt_filename, "%s/%s.txt", path_creator.GetCurPath().c_str(), result.time().c_str());
                                     fc->save_cloud_txt(cloud_txt_filename, total_cloud);
-                                    std::cout << " save cloud   " << cloud_txt_filename << std::endl;
+                                    // std::cout << " save cloud   " << cloud_txt_filename << std::endl;
+                                    LOG(INFO)<<" save cloud " << cloud_txt_filename;
                                 }
                             }
                             else
                             {
                                 result.set_correctness(false);
                             }
-                             std::cout << "--------callback get result------" << std::endl;
+                            //  std::cout << "--------callback get result------" << std::endl;
+                            LOG(INFO)<<"--------callback get result------";
                             result.set_x(x * 1000.0);
                             result.set_y(y * 1000.0);
                             result.set_c(c);
@@ -238,12 +275,14 @@ void FenceController::wheelMsgHandlingThread(FenceController* fc){
                 }
             }
             std::string result_str = result.SerializeAsString();
-            std::cout << "--------callback serialized: " <<std::endl<< result.DebugString() << "------" << std::endl;
+            // std::cout << "--------callback serialized: " <<std::endl<< result.DebugString() << "------" << std::endl;
+            LOG(INFO)<<"--------callback serialized: " <<std::endl<< result.DebugString() << "------";
             fc->m_mutex_wheel_handling.lock();
             if (fc->m_wheel_soc) {
                 fc->m_wheel_soc.send(result_str.data(), result_str.length(), 0,
                                      std::move(*task.sock_controller));
-                std::cout << "------- callback msg sent -------" << std::endl;
+                // std::cout << "------- callback msg sent -------" << std::endl;
+                LOG(INFO)<<"------- callback msg sent -------";
             }
             fc->m_mutex_wheel_handling.unlock();
             delete task.sock_controller;

+ 1 - 0
src/findwheel/src/FenceController.h

@@ -35,6 +35,7 @@ using google::protobuf::Message;
 #include "tools/s7_plc.h"
 #include "PlcData.h"
 #include "string.h"
+#include "tools/pathcreator.h"
 
 #include <nnxx/message.h>
 #include <nnxx/message_control.h>

+ 26 - 6
src/findwheel/src/Lidar.cpp

@@ -39,11 +39,12 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr  laserScan2Cloud(const sensor_msgs::LaserSca
     }
     return point_cloud;
 }
+
 void SaveTxtCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,std::string strFile)
 {
     CLogFile log;
     log.open(strFile.c_str());
-    std::cout<<log.is_open()<<std::endl;
+    //std::cout<<log.is_open()<<std::endl;
     if(log.is_open())
     {
         for(int i=0;i<cloud->size();++i)
@@ -71,12 +72,16 @@ b_save_cloud(0)
 }
 Lidar::~Lidar()
 {
-
+    // std::lock_guard<std::mutex> lck(m_mutex);
+    // std::cout<<"exit lidar"<<std::endl;
 }
 void Lidar::publish_cloud()
 {
+    // std::lock_guard<std::mutex> lck(m_mutex);
     sensor_msgs::PointCloud2 cloudglobalMsg;
+    m_mutex.lock();
     pcl::toROSMsg(*m_cloud, cloudglobalMsg);
+    m_mutex.unlock();
     cloudglobalMsg.header.stamp = ros::Time::now();
     cloudglobalMsg.header.frame_id = "/map";
     m_cloud_publisher.publish(cloudglobalMsg);
@@ -86,6 +91,7 @@ void Lidar::cloud_callback(const sensor_msgs::LaserScan::ConstPtr& msg,Lidar* pL
 {
 //    ROS_INFO("cloud callbacked");
     if(pLidar==0) return ;
+    // std::lock_guard<std::mutex> lck(pLidar->m_mutex);
     EleFence::Transform2d T=pLidar->m_lidar_param.transform();
     float minx=pLidar->m_lidar_param.minx();
     float maxx=pLidar->m_lidar_param.maxx();
@@ -98,7 +104,9 @@ void Lidar::cloud_callback(const sensor_msgs::LaserScan::ConstPtr& msg,Lidar* pL
     transform(1,0)=T.m10();
     transform(1,1)=T.m11();
     transform(1,2)=T.m12();
+    pLidar->m_mutex.lock();
     pLidar->m_cloud=laserScan2Cloud(*msg,transform,minx,maxx,miny,maxy);
+    pLidar->m_mutex.unlock();
     pLidar->m_cloud_time = ros::Time::now();
     pLidar->publish_cloud();
 
@@ -113,19 +121,31 @@ void Lidar::cloud_callback(const sensor_msgs::LaserScan::ConstPtr& msg,Lidar* pL
         {
             sprintf(buf, "./cloud_%s.txt", pLidar->m_lidar_param.topic().c_str());
         }
+        pLidar->m_mutex.lock();
         SaveTxtCloud(pLidar->m_cloud, buf);
-        std::cout<<" save cloud   "<<buf<<std::endl;
+        pLidar->m_mutex.unlock();
+        std::cout<<" save cloud "<<buf<<std::endl;
         pLidar->b_save_cloud=true;
     }
 }
 
-bool Lidar::GetCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud, int timeout_milli)
+bool Lidar::GetCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud, int timeout_milli, bool print)
 {
-    cloud=m_cloud;
+    std::lock_guard<std::mutex> lck(m_mutex);
+    cloud->clear();
+    // m_mutex.lock();
+    cloud->operator+=(*m_cloud);
 //    std::cout<<cloud->size()<<std::endl;
 //    return true;
     ros::Duration duration = ros::Time::now() - m_cloud_time;
-    if(duration.toSec()*1000 > timeout_milli)
+    if(print)
+    {
+        // if (m_lidar_param.topic() == "/scan3" || m_lidar_param.topic() == "/scan4" || m_lidar_param.topic() == "/scan5")
+        // {
+        std::cout << m_lidar_param.topic() << " duration: " << duration.toSec() * 1000 << ", cloud size: " << cloud->size() << std::endl;
+        // }
+    }
+    if (duration.toSec() * 1000 > timeout_milli)
         return false;
     else
         return true;

+ 15 - 7
src/findwheel/src/Lidar.h

@@ -5,6 +5,7 @@
 #ifndef LIDAR_H
 #define LIDAR_H
 #include <ros/ros.h>
+#include <mutex>
 #include "tools/EleFence.pb.h"
 #include <string>
 #include <pcl_conversions/pcl_conversions.h>
@@ -22,22 +23,29 @@ class Lidar
 public:
     Lidar(EleFence::lidarParam lidar_param, ros::NodeHandle handle);
     ~Lidar();
-    bool GetCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud, int timeout_milli=100);
+    // 外部调用获取时间间隔内的点云
+    bool GetCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud, int timeout_milli=500, bool print=false);
 
 protected:
+    // ROS发布点云
     void publish_cloud();
+    // 雷达消息回调
     static void cloud_callback(const sensor_msgs::LaserScan::ConstPtr& msg,Lidar* pLidar);
 
 protected:
-    ros::NodeHandle m_handle;
+    ros::NodeHandle                     m_handle;
     pcl::PointCloud<pcl::PointXYZ>::Ptr m_cloud;
-    ros::Time   m_cloud_time;
+    ros::Time                           m_cloud_time;
 
-    ros::Subscriber m_scan_sub;
-    ros::Publisher m_cloud_publisher;
-    EleFence::lidarParam m_lidar_param;
+    ros::Subscriber                     m_scan_sub;
+    ros::Publisher                      m_cloud_publisher;
 
-    bool                b_save_cloud;
+
+    bool                                b_save_cloud;
+    std::mutex                          m_mutex;
+
+public:
+    EleFence::lidarParam                m_lidar_param;
 };
 
 

+ 108 - 49
src/findwheel/src/PlcData.cpp

@@ -5,67 +5,137 @@
 #include "PlcData.h"
 #include <string.h>
 
-PlcData* PlcData::g_instance=0;
+PlcData* PlcData::g_ins=0;
+std::mutex PlcData::g_lock;
 
 PlcData* PlcData::GetInstance(std::string ip)
 {
-    if(g_instance==0)
-        g_instance=new PlcData(ip);
-    return g_instance;
+    if (g_ins == 0)
+    {
+        std::lock_guard<std::mutex> lock(g_lock);
+        if (g_ins == 0)
+        {
+            if (ip != "")
+            {
+                g_ins = new PlcData(ip);
+                LOG(INFO) << "plc data, handle created";
+            }
+            else
+            {
+                return 0;
+            }
+        }
+    }
+    return g_ins;
+}
 
+void PlcData::Release()
+{
+    if (g_ins)
+    {
+        g_ins->m_cond_exit.Notify(true);
+        LOG(INFO) << "plc data, try to exit plc send thread";
+        g_lock.lock();
+        if (g_ins->p_send_thread)
+        {
+            LOG(INFO) << "plc data, try to join plc send thread";
+            // LOG(INFO) << g_ins->p_send_thread->joinable();
+            if (g_ins->p_send_thread->joinable())
+                g_ins->p_send_thread->join();
+            LOG(INFO) << "plc data, try to delete plc send thread";
+            delete g_ins->p_send_thread;
+            g_ins->p_send_thread = 0;
+            LOG(INFO) << "plc data, delete data send thread";
+        }
+        g_lock.unlock();
+
+        LOG(INFO) << "plc data, start to exit plc handle";
+        // if(g_instance->p_plc){
+        //     LOG(INFO)<<"plc data, try to delete plc handle";
+        //     delete g_instance->p_plc;
+        //     g_instance->p_plc = 0;
+        // }
+        // LOG(INFO)<<"plc data, delete plc handle";
+        LOG(INFO) << "plc data, delete instance";
+        // delete g_ins;
+        // g_ins = 0;
+        LOG(INFO) << "plc data, instance deleted";
+    }
+    else
+    {
+        LOG(WARNING) << "plc data, cannot find the instance";
+    }
 }
+
 void PlcData::UpdateData(stateCode code,int id)
 {
     const int length=1;
     int offset=id*length;
-    short* data = (short*)malloc(sizeof(short));
-    memset(data, 0, sizeof(short));
+    short data = 0;
     switch(code){
         case stateCode::eOk:
-            *data = (short)1;
+            data = (short)1;
             break;
         case stateCode::eOutOfPlace:
-            *data = (short)2;
+            data = (short)2;
             break;
         case stateCode::eNoCar:
         default:
-            *data = (short)0;
+            data = (short)0;
             break;
     }
 //    printf("data: %d \n", *data);
-    m_lock.lock();
-    ////判断越界
+    std::lock_guard<std::mutex> lock(g_lock);
+    ////判断越界, 更新数据
     if(offset>=0 && offset+length<=MAX_REGIONS)
-        memcpy(m_data+offset,data,length*sizeof(short));
-    m_lock.unlock();
-    free(data);
+        memcpy(m_data+offset,&data,length*sizeof(short));
 }
 
 void PlcData::plcThread(PlcData* p){
     if(p == 0) return;
-    if(p->p_plc == 0) return;
     while(!p->m_cond_exit.WaitFor(1)){
-        // 显示雷达结果
-        std::cout<<"result: [";
-        for (int i = 0; i < MAX_REGIONS; ++i) {
-            std::cout<<p->m_data[i]<<" ";
-        }
-        std::cout<<"]"<<std::endl;
-        // 写plc
-        if(p->p_plc->getConnection()){
+        
+        if(p == 0) return;
+        // if(p->m_plc == 0) return;
+
+        {
+            // std::lock_guard<std::mutex> lock(g_lock);
+            g_lock.lock();
+            // 显示雷达结果
+            std::cout << "result: [";
+            for (int i = 0; i < MAX_REGIONS; ++i)
+            {
+                std::cout << p->m_data[i] << " ";
+            }
+            std::cout << "]" << std::endl;
+            g_lock.unlock();
+
+            // 写plc
+            if (p->m_plc.getConnection())
+            {
 
-            short temp = 0;
-            for (int i = 0; i < ELE_FENCE_COUNT; ++i) {
-                temp= *(p->m_data+i);
-//                temp =HTON(temp);
-                //printf("%d ---->%d\n",*(p->m_data+i), temp);
-                p->p_plc->WriteShorts(ELE_FENCE_DB_NUM, ELE_FENCE_START_ADDR+i*ELE_FENCE_OFFSET, 1, &temp);
-                usleep(50*1000);
+                short temp = 0;
+                for (int i = 0; i < ELE_FENCE_COUNT; ++i)
+                {
+                    g_lock.lock();
+                    temp = *(p->m_data + i);
+                    //                temp =HTON(temp);
+                    //printf("%d ---->%d\n",*(p->m_data+i), temp);
+                    p->m_plc.WriteShorts(ELE_FENCE_DB_NUM, ELE_FENCE_START_ADDR + i * ELE_FENCE_OFFSET, 1, &temp);
+                    g_lock.unlock();
+                    usleep(50 * 1000);
+                }
             }
-        }else{
-            p->p_plc->disconnect();
-            if(p->m_ip_str != ""){
-                p->p_plc->connect(p->m_ip_str);
+            else
+            {
+                g_lock.lock();
+                p->m_plc.disconnect();
+                if (p->m_ip_str != "")
+                {
+                    p->m_plc.connect(p->m_ip_str);
+                }
+                g_lock.unlock();
+                usleep(p->m_send_interval_milli * 5 * 1000);
             }
         }
         usleep(p->m_send_interval_milli * 1000);
@@ -78,22 +148,11 @@ m_ip_str("")
 {
     m_ip_str = ip;
     memset(m_data, 0, MAX_REGIONS* sizeof(short));
-    p_plc = new S7PLC();
-    if(ip!=""){
-        p_plc->connect(ip);
+    // p_plc = new S7PLC();
+    if(m_ip_str!=""){
+        m_plc.connect(m_ip_str);
     }
     m_cond_exit.Notify(false);
     p_send_thread = new std::thread(plcThread, this);
-}
-
-void PlcData::Release(){
-    if(g_instance) {
-        g_instance->m_cond_exit.Notify(true);
-        if(g_instance->p_plc){
-            g_instance->p_plc->disconnect();
-            delete g_instance->p_plc;
-        }
-        delete g_instance;
-        g_instance = 0;
-    }
+    p_send_thread->detach();
 }

+ 19 - 4
src/findwheel/src/PlcData.h

@@ -12,8 +12,9 @@
 #include "tools/s7_plc.h"
 #include "unistd.h"
 #include "tools/define.h"
+#include "glog/logging.h"
 
-#define MAX_REGIONS 15
+#define MAX_REGIONS 6
 #define ELE_FENCE_START_ADDR 4
 #define ELE_FENCE_DB_NUM  95
 #define ELE_FENCE_OFFSET 7
@@ -29,16 +30,30 @@ public:
     void UpdateData(stateCode code,int id);
     static void plcThread(PlcData* p);
 private:
-    static PlcData*                                 g_instance;
+    static PlcData*                                 g_ins;
+    static std::mutex                               g_lock;
+
     StdCondition                                    m_cond_exit;
     std::thread*                                    p_send_thread;
-    S7PLC*                                          p_plc;
+    S7PLC                                           m_plc;
     const int                                       m_send_interval_milli = 200;
 
     PlcData(std::string ip);
 
+    // class CGarbo
+	// {
+	// public:
+	// 	~CGarbo() {
+	// 		if (g_ins)
+	// 		{
+	// 			delete g_ins;
+	// 			g_ins = 0;
+	// 		}
+	// 	}
+	// };
+	// static CGarbo Garbo;	//--->1
+
 protected:
-    std::mutex m_lock;
     short m_data[MAX_REGIONS];
 public:
     std::string                                     m_ip_str;

+ 10 - 97
src/findwheel/src/find_wheel_node.cpp

@@ -6,111 +6,24 @@ ros::Publisher g_src_publisher;
 
 int main(int argc, char** argv)
 {
-//    EleFence::globalParam param;
-//    if(ReadProtoParam("/home/zx/zzw/catkin_ws/src/FindWheel/scripts/setting.prototxt",param)==false)
-//    {
-//        ROS_ERROR("load proto param failed...");
-//        return -1;
-//    }
-
     ros::init(argc, argv, "find_wheel");
     FenceController fc("/home/youchen/Documents/measure/MainStructure/elecfence_ws/src/findwheel/scripts/setting.prototxt");
     // FenceController fc("/home/zx/zzw/catkin_ws/src/findwheel/scripts/setting.prototxt");
     if(fc.m_initialized) {
-//
-//        ::ros::NodeHandle g_ros_handle;
-//        int LidarCount = param.lidars_size();
-//        std::vector<Lidar *> pLidars;
-//        pLidars.resize(LidarCount);
-//        for (int i = 0; i < param.lidars_size(); ++i) {
-//
-//        }
-//
-//        for (int i = 0; i < LIDAR_COUNT; ++i) {
-//            g_clouds[i] = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
-//
-//        }
-//        for (int i = 0; i < 4; ++i) {
-//            char buf[255] = {0};
-//            sprintf(buf, "/cloud_wheel_%d", i + 1);
-//            g_cluster_publisher[i] = g_ros_handle.advertise<sensor_msgs::PointCloud2>(buf, 1);
-//        }
-//
-//        for (int i = 0; i < LIDAR_COUNT; ++i) {
-//            char topic[255] = {0};
-//            sprintf(topic, "/scan%d", i + 1);
-//            g_cloud_sub[i] =
-//                g_ros_handle.subscribe<sensor_msgs::LaserScan>(topic, 1, boost::bind(cloud_callback, _1, i));
-//
-//        }
-        g_src_publisher = fc.m_handle.advertise<sensor_msgs::PointCloud2>("cloud_in", 1);
-
-/////过滤xy
-
+        // g_src_publisher = fc.m_handle.advertise<sensor_msgs::PointCloud2>("cloud_in", 1);
 
         ros::Rate loop_rate(10);
-        pcl::PointCloud<pcl::PointXYZ>::Ptr merged_cloud(pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>));
+        // pcl::PointCloud<pcl::PointXYZ>::Ptr merged_cloud(pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>));
         while (::ros::ok()) {
             //g_src_publisher.publish(fc.p_merged_cloud);
-            fc.GetCloud(merged_cloud);
-            if (merged_cloud->size() > 0) {
-                sensor_msgs::PointCloud2 cloudglobalMsg;
-                pcl::toROSMsg(*merged_cloud, cloudglobalMsg);
-                cloudglobalMsg.header.stamp = ros::Time::now();
-                cloudglobalMsg.header.frame_id = "/map";
-                g_src_publisher.publish(cloudglobalMsg);
-            }
-
-//            for (int i = 0; i < fc.m_region_results.size(); ++i) {
-//                std::cout<<fc.m_region_results[i]? "True" : "False";
-//            }
-//            std::cout<<std::endl;
-//            pcl::PointCloud<pcl::PointXYZ> cloud;
-//            for (int i = 0; i < LIDAR_COUNT; ++i)
-//                cloud += (*g_clouds[i]);
-//
-//            if (cloud.size() > 0) {
-//                float minx = g_param.regions(0).minx();
-//                float maxx = g_param.regions(0).maxx();
-//                float miny = g_param.regions(0).miny();
-//                float maxy = g_param.regions(0).maxy();
-//
-//                pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZ>);
-//
-//                pcl::PassThrough<pcl::PointXYZ> pass;
-//                pass.setInputCloud(cloud.makeShared());
-//                pass.setFilterFieldName("x");//设置想在哪个坐标轴上操作
-//                pass.setFilterLimits(minx, maxx);//将x轴的0到1范围内
-//                pass.setFilterLimitsNegative(false);//保留(true就是删除,false就是保留而删除此区间外的)
-//                pass.filter(*cloud_filtered);//输出到结果指针
-//
-//                pass.setInputCloud(cloud_filtered);
-//                pass.setFilterFieldName("y");//设置想在哪个坐标轴上操作
-//                pass.setFilterLimits(miny, maxy);//将x轴的0到1范围内
-//                pass.setFilterLimitsNegative(false);//保留(true就是删除,false就是保留而删除此区间外的)
-//                pass.filter(*cloud_filtered);//输出到结果指针
-//
-//                if (wheel.detect(cloud_filtered)) {
-//                    //发布聚类结果图
-//                    for (int i = 0; i < 4; ++i) {
-//                        if (wheel.m_clouds[i]->size() > 0) {
-//                            sensor_msgs::PointCloud2 cloudglobalMsg;
-//                            pcl::toROSMsg(*wheel.m_clouds[i], cloudglobalMsg);
-//                            cloudglobalMsg.header.stamp = ros::Time::now();
-//                            cloudglobalMsg.header.frame_id = "/map";
-//                            g_cluster_publisher[i].publish(cloudglobalMsg);
-//                        }
-//                    }
-//                }
-//                std::cout << " cloud in size : " << cloud_filtered->size() << std::endl;
-//                if (cloud_filtered->size() > 0) {
-//                    sensor_msgs::PointCloud2 cloudglobalMsg;
-//                    pcl::toROSMsg(*cloud_filtered, cloudglobalMsg);
-//                    cloudglobalMsg.header.stamp = ros::Time::now();
-//                    cloudglobalMsg.header.frame_id = "/map";
-//                    g_src_publisher.publish(cloudglobalMsg);
-//                }
-//            }
+            // fc.GetCloud(merged_cloud);
+            // if (merged_cloud->size() > 0) {
+            //     sensor_msgs::PointCloud2 cloudglobalMsg;
+            //     pcl::toROSMsg(*merged_cloud, cloudglobalMsg);
+            //     cloudglobalMsg.header.stamp = ros::Time::now();
+            //     cloudglobalMsg.header.frame_id = "/map";
+            //     g_src_publisher.publish(cloudglobalMsg);
+            // }
             ros::spinOnce();
             loop_rate.sleep();
         }

+ 48 - 23
src/findwheel/src/region_detect.cpp

@@ -93,8 +93,10 @@ bool Region_detector::isRect(std::vector<cv::Point2f>& points, bool print)
         {
             if (print)
             {
-                std::cout << " angle cos >0.13 =" << cosa << "  i=" << max_index;
-                std::cout << "L1:" << l1 << "  L2:" << l2 << "  L3:" << max_l;
+                // std::cout << " angle cos >0.13 =" << cosa << "  i=" << max_index;
+                // std::cout << "L1:" << l1 << "  L2:" << l2 << "  L3:" << max_l;
+                LOG(WARNING) << " angle cos >0.13 =" << cosa << "  i=" << max_index;
+                LOG(WARNING) << "L1:" << l1 << "  L2:" << l2 << "  L3:" << max_l;
             }
             return false;
         }
@@ -106,7 +108,9 @@ bool Region_detector::isRect(std::vector<cv::Point2f>& points, bool print)
         {
             if(print)
             {
-                std::cout << "\t width<1400 || width >2100 || length >3300 ||length < 2100 "
+                // std::cout << "\t width<1400 || width >2100 || length >3300 ||length < 2100 "
+                //           << "  length:" << length << "  width:" << width;
+                LOG(WARNING)<< "\t width<1400 || width >2100 || length >3300 ||length < 2100 "
                           << "  length:" << length << "  width:" << width;
             }
             return false;
@@ -119,13 +123,17 @@ bool Region_detector::isRect(std::vector<cv::Point2f>& points, bool print)
         if (fabs(d - max_l) > max_l * 0.15 || distance(center1, center2) > 0.150) {
             if(print)
             {
-                std::cout << "d:" << d << " maxl:" << max_l << "  center1:" << center1 << "  center2:" << center2
+                // std::cout << "d:" << d << " maxl:" << max_l << "  center1:" << center1 << "  center2:" << center2
+                //           << "  center distance=" << distance(center1, center2);
+                LOG(WARNING)<<"d:" << d << " maxl:" << max_l << "  center1:" << center1 << "  center2:" << center2
                           << "  center distance=" << distance(center1, center2);
             }
             return false;
         }
         if(print){
-            std::cout << " rectangle verify OK  cos angle=" << cosa << "  length off=" << fabs(d - max_l)
+            // std::cout << " rectangle verify OK  cos angle=" << cosa << "  length off=" << fabs(d - max_l)
+            //           << "  center distance=" << distance(center1, center2);
+            LOG(WARNING)<< " rectangle verify OK  cos angle=" << cosa << "  length off=" << fabs(d - max_l)
                       << "  center distance=" << distance(center1, center2);
         }
         return true;
@@ -158,8 +166,10 @@ bool Region_detector::isRect(std::vector<cv::Point2f>& points, bool print)
         {
             if (print)
             {
-                std::cout << "3 wheels angle cos >0.12 =" << cosa << "  i=" << max_index;
-                std::cout << "L1:" << l1 << "  L2:" << l2 << "  L3:" << max_l;
+                // std::cout << "3 wheels angle cos >0.12 =" << cosa << "  i=" << max_index;
+                // std::cout << "L1:" << l1 << "  L2:" << l2 << "  L3:" << max_l;
+                LOG(WARNING)<< "3 wheels angle cos >0.12 =" << cosa << "  i=" << max_index;
+                LOG(WARNING)<< "L1:" << l1 << "  L2:" << l2 << "  L3:" << max_l;
             }
             return false;
         }
@@ -175,7 +185,9 @@ bool Region_detector::isRect(std::vector<cv::Point2f>& points, bool print)
             points.push_back(point4);
             if(print)
             {
-                std::cout << "3 wheels rectangle verify OK  cos angle=" << cosa << "  L=" << l
+                // std::cout << "3 wheels rectangle verify OK  cos angle=" << cosa << "  L=" << l
+                //           << "  w=" << w;
+                LOG(WARNING)<< "3 wheels rectangle verify OK  cos angle=" << cosa << "  L=" << l
                           << "  w=" << w;
             }
             return true;
@@ -184,14 +196,14 @@ bool Region_detector::isRect(std::vector<cv::Point2f>& points, bool print)
         {
             if (print)
             {
-                std::cout << "3 wheels rectangle verify Failed  cos angle=" << cosa << "  L=" << l
+                // std::cout << "3 wheels rectangle verify Failed  cos angle=" << cosa << "  L=" << l
+                //           << "  w=" << w;
+                LOG(WARNING)<< "3 wheels rectangle verify Failed  cos angle=" << cosa << "  L=" << l
                           << "  w=" << w;
             }
             return false;
         }
-
     }
-
 }
 
 bool Region_detector::clustering(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in, std::vector<cv::Point2f>& corner_points, std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> &seg_clouds, bool print) {
@@ -231,7 +243,8 @@ bool Region_detector::clustering(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in, s
     }
 
     if(print){
-        std::cout << " cluster class:" << clusters.size() << std::endl;
+        // std::cout << " cluster class:" << clusters.size() << std::endl;
+        LOG(WARNING)<<" cluster class:" << clusters.size();
     }
 
     // std::vector<cv::Point2f> cvPoints;
@@ -251,7 +264,7 @@ bool Region_detector::clustering(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in, s
         float center_y=sumY/float(seg_clouds[i]->size());
         corner_points.push_back(cv::Point2f(center_x,center_y));
     }
-    return isRect(corner_points);
+    return isRect(corner_points, print);
 }
 
 bool Region_detector::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in)
@@ -294,11 +307,15 @@ bool Region_detector::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloud_in, doub
         for (int j = 0; j < cloud_filtered->size(); ++j) {
             all_points.push_back(cv::Point2f(cloud_filtered->points[j].x, cloud_filtered->points[j].y));
         }
+        // bounding rectangle of all wheel points
         cv::RotatedRect wheel_box = cv::minAreaRect(all_points);
         x=wheel_box.center.x;
         y=wheel_box.center.y;
         cloud_in->points.push_back(pcl::PointXYZ(x, y, 0.0));
-        std::cout<<"--------detector find center ["<<x<<", "<<y<<"] ------"<<std::endl;
+        // std::cout<<"--------detector find center ["<<x<<", "<<y<<"] ------"<<std::endl;
+        LOG(INFO)<<"--------detector find center ["<<x<<", "<<y<<"] ------";
+
+        // 长边向量
         cv::Point2f vec;
         cv::Point2f vertice[4];
         wheel_box.points(vertice);
@@ -318,17 +335,21 @@ bool Region_detector::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloud_in, doub
         float angle_x = 180.0 / M_PI * acos(vec.x / sqrt(vec.x * vec.x + vec.y * vec.y));
         c = angle_x;
 
-        // get line formula
+        // get line formula, normal is (cos(theta), sin(theta)), towards the long side
+        // the line formula is: nx * x + ny * y + (-(nx*cx+ny*cy)) = 0
         Eigen::Vector2f normal, center_point;
         normal<<vec.x / sqrt(vec.x * vec.x + vec.y * vec.y), vec.y / sqrt(vec.x * vec.x + vec.y * vec.y);
         center_point<<x, y;
         float line_param_c = -1 * center_point.transpose() * normal;
-        std::cout << "--------detector find separation line: " << normal[0]<<", "<<normal[1]<<", "<<line_param_c << " -----" << std::endl;
-        // get rotation matrix
+        LOG(INFO)<<"--------detector find horizontal separation line: " << normal[0]<<", "<<normal[1]<<", "<<line_param_c << " -----";
+        // get rotation matrix, get the angle towards normal vector, rather than x axis
+        // R = [ cos -sin]
+        //     [ sin  cos]
         float rotate_angle = M_PI_2 - acos(vec.x / sqrt(vec.x * vec.x + vec.y * vec.y));
         Eigen::Matrix2f rotation_matrix;
         rotation_matrix<< cos(rotate_angle), -sin(rotate_angle), sin(rotate_angle), cos(rotate_angle);
-        std::cout << "--------detector find angle" << rotate_angle << " -----" << std::endl;
+        // std::cout << "--------detector find angle" << rotate_angle << " -----" << std::endl;
+        LOG(INFO)<< "--------detector find angle" << rotate_angle << " -----";
 
         // find min x and max x, separate y values according to the line, calculate difference between mean of y values as wheelbase
         float min_x=20, max_x=0;
@@ -358,13 +379,14 @@ bool Region_detector::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloud_in, doub
                 }
             }
         }
-        if (count0 > 0 || count1 > 0)
+        if (count0 > 0 && count1 > 0)
         {
             y_values0 /= count0;
             y_values1 /= count1;
             wheelbase = fabs(y_values1 - y_values0);
             width = fabs(min_x - max_x);
-            std::cout << "--------detector find x min "<<min_x<<" max "<<max_x<<", y means: [" << y_values0 << ", " << y_values1 << "] -----" << std::endl;
+            // std::cout << "--------detector find x min "<<min_x<<" max "<<max_x<<", y means: [" << y_values0 << ", " << y_values1 << "] -----" << std::endl;
+            LOG(INFO) << "--------detector find x min "<<min_x<<" max "<<max_x<<", y means: [" << y_values0 << ", " << y_values1 << "] -----";
             cloud_in->points.push_back(pcl::PointXYZ(min_x, y, 0.0));
             cloud_in->points.push_back(pcl::PointXYZ(max_x, y, 0.0));
             cloud_in->points.push_back(pcl::PointXYZ(x, y_values0, 0.0));
@@ -375,13 +397,16 @@ bool Region_detector::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloud_in, doub
             // calculate wheelbase according to corner points
             double dist0 = 0, dist1 = 0, dist2 = 0;
             wheelbase = std::max(wheel_box.size.width, wheel_box.size.height);
-            std::cout << "--------detector find border: [" << wheel_box.size.width << ", " << wheel_box.size.height << "] -----" << std::endl;
+            // std::cout << "--------detector find border: [" << wheel_box.size.width << ", " << wheel_box.size.height << "] -----" << std::endl;
+            LOG(INFO)<<"--------detector find border: [" << wheel_box.size.width << ", " << wheel_box.size.height << "] -----";
             cv::RotatedRect wheel_center_box = cv::minAreaRect(corner_points);
             wheelbase = std::max(wheel_center_box.size.width, wheel_center_box.size.height);
-            std::cout << "--------detector find center border: [" << wheel_box.size.width << ", " << wheel_box.size.height << "] -----" << std::endl;
+            // std::cout << "--------detector find center border: [" << wheel_box.size.width << ", " << wheel_box.size.height << "] -----" << std::endl;
+            LOG(INFO)<<"--------detector find center border: [" << wheel_box.size.width << ", " << wheel_box.size.height << "] -----";
             width = std::min(wheel_box.size.width, wheel_box.size.height);
         }
-        std::cout << "--------detector find all------" << std::endl;
+        // std::cout << "--------detector find all------" << std::endl;
+        LOG(INFO)<<"--------detector find all------";
     }
     return result;
 }

+ 2 - 0
src/findwheel/src/region_detect.h

@@ -39,6 +39,8 @@ using google::protobuf::io::ZeroCopyOutputStream;
 using google::protobuf::io::CodedOutputStream;
 using google::protobuf::Message;
 
+#include "glog/logging.h"
+
 #include "tools/EleFence.pb.h"
 #include "tools/StdCondition.h"
 #include "opencv2/opencv.hpp"

+ 27 - 8
src/findwheel/src/region_worker.cpp

@@ -15,42 +15,60 @@ Region_worker::Region_worker(int id, EleFence::Region region){
 Region_worker::~Region_worker()
 {
     m_cond_exit.Notify(true);
+    // m_mutex.lock();
+    std::lock_guard<std::mutex> lck(m_mutex);
     if(m_update_thread){
         if(m_update_thread->joinable())
             m_update_thread->join();
         delete m_update_thread;
+        m_update_thread = 0;
     }
+    // m_mutex.unlock();
+    // std::cout<<"exit region worker thread"<<std::endl;
     if(m_detector){
         delete m_detector;
+        m_detector = 0;
     }
 }
 
 int Region_worker::get_id(){
+    int id = -1;
+    // m_mutex.lock();
+    std::lock_guard<std::mutex> lck(m_mutex);
     if(m_detector){
-        return m_detector->m_region_id;
+        id = m_detector->m_region_id;
     }else{
-        return -1;
+        id = -1;
     }
+    // m_mutex.unlock();
+    return id;
 }
 
 bool Region_worker::get_wheel_result(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloud_in, double &x, double &y, double &c, double &wheelbase, double &width){
+    bool result=false;
+    // m_mutex.lock();
+    std::lock_guard<std::mutex> lck(m_mutex);
     if(m_detector){
         // std::cout<<"worker getting result"<<std::endl;
-        return m_detector->detect(cloud_in, x, y, c, wheelbase, width);
+        LOG(INFO)<<"worker getting result";
+        result = m_detector->detect(cloud_in, x, y, c, wheelbase, width);
     }else{
-        return false;
+        result = false;
     }
+    // m_mutex.unlock();
+    return result;
 }
 
 void Region_worker::update_cloud(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloud_in)
 {
-    m_mutex.lock();
+    // m_mutex.lock();
+    std::lock_guard<std::mutex> lck(m_mutex);
     m_cloud->clear();
     for (int i = 0; i < cloud_in->size(); ++i) {
         m_cloud->push_back(cloud_in->points[i]);
     }
     b_cloud_updated = true;
-    m_mutex.unlock();
+    // m_mutex.unlock();
 }
 
 void Region_worker::detect_loop(Region_worker *worker)
@@ -59,7 +77,8 @@ void Region_worker::detect_loop(Region_worker *worker)
     if(worker->m_detector == 0) return;
     while(!worker->m_cond_exit.WaitFor(1)){
         stateCode code = stateCode::eNoCar;
-        worker->m_mutex.lock();
+        // worker->m_mutex.lock();
+        std::lock_guard<std::mutex> lck(worker->m_mutex);
         if(worker->b_cloud_updated){
             bool result = worker->m_detector->detect(worker->m_cloud);
             worker->b_cloud_updated = false;
@@ -73,6 +92,6 @@ void Region_worker::detect_loop(Region_worker *worker)
         if(p) {
             p->UpdateData(code, worker->m_detector->m_region_id);
         }
-        worker->m_mutex.unlock();
+        // worker->m_mutex.unlock();
     }
 }

+ 87 - 18
src/findwheel/src/tools/EleFence.pb.cc

@@ -189,15 +189,17 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::EleFence::globalParam, lidar_params_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::EleFence::globalParam, regions_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::EleFence::globalParam, data_path_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::EleFence::globalParam, fence_log_path_),
   ~0u,
   ~0u,
   0,
+  1,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 9, sizeof(::EleFence::Region)},
   { 13, 24, sizeof(::EleFence::Transform2d)},
   { 30, 42, sizeof(::EleFence::lidarParam)},
-  { 49, 57, sizeof(::EleFence::globalParam)},
+  { 49, 58, sizeof(::EleFence::globalParam)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -238,13 +240,13 @@ void AddDescriptorsImpl() {
       "nsform\030\002 \001(\0132\025.EleFence.Transform2d\022\025\n\nd"
       "ist_limit\030\003 \001(\002:\0018\022\020\n\004minx\030\004 \001(\002:\002-6\022\022\n\004"
       "maxx\030\005 \001(\002:\004-0.2\022\022\n\004miny\030\006 \001(\002:\004-3.5\022\021\n\004"
-      "maxy\030\007 \001(\002:\0033.5\"q\n\013globalParam\022*\n\014lidar_"
-      "params\030\001 \003(\0132\024.EleFence.lidarParam\022!\n\007re"
-      "gions\030\002 \003(\0132\020.EleFence.Region\022\023\n\tdata_pa"
-      "th\030\003 \001(\t:\000"
+      "maxy\030\007 \001(\002:\0033.5\"\213\001\n\013globalParam\022*\n\014lidar"
+      "_params\030\001 \003(\0132\024.EleFence.lidarParam\022!\n\007r"
+      "egions\030\002 \003(\0132\020.EleFence.Region\022\023\n\tdata_p"
+      "ath\030\003 \001(\t:\000\022\030\n\016fence_log_path\030\004 \001(\t:\000"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 490);
+      descriptor, 517);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "EleFence.proto", &protobuf_RegisterTypes);
 }
@@ -1585,6 +1587,7 @@ void globalParam::InitAsDefaultInstance() {
 const int globalParam::kLidarParamsFieldNumber;
 const int globalParam::kRegionsFieldNumber;
 const int globalParam::kDataPathFieldNumber;
+const int globalParam::kFenceLogPathFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 globalParam::globalParam()
@@ -1607,12 +1610,17 @@ globalParam::globalParam(const globalParam& from)
   if (from.has_data_path()) {
     data_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_path_);
   }
+  fence_log_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.has_fence_log_path()) {
+    fence_log_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.fence_log_path_);
+  }
   // @@protoc_insertion_point(copy_constructor:EleFence.globalParam)
 }
 
 void globalParam::SharedCtor() {
   _cached_size_ = 0;
   data_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  fence_log_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
 
 globalParam::~globalParam() {
@@ -1622,6 +1630,7 @@ globalParam::~globalParam() {
 
 void globalParam::SharedDtor() {
   data_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  fence_log_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
 
 void globalParam::SetCachedSize(int size) const {
@@ -1656,9 +1665,15 @@ void globalParam::Clear() {
   lidar_params_.Clear();
   regions_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!data_path_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*data_path_.UnsafeRawStringPointer())->clear();
+  if (cached_has_bits & 3u) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(!data_path_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+      (*data_path_.UnsafeRawStringPointer())->clear();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(!fence_log_path_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+      (*fence_log_path_.UnsafeRawStringPointer())->clear();
+    }
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -1712,6 +1727,22 @@ bool globalParam::MergePartialFromCodedStream(
         break;
       }
 
+      // optional string fence_log_path = 4 [default = ""];
+      case 4: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_fence_log_path()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+            this->fence_log_path().data(), static_cast<int>(this->fence_log_path().length()),
+            ::google::protobuf::internal::WireFormat::PARSE,
+            "EleFence.globalParam.fence_log_path");
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -1763,6 +1794,16 @@ void globalParam::SerializeWithCachedSizes(
       3, this->data_path(), output);
   }
 
+  // optional string fence_log_path = 4 [default = ""];
+  if (cached_has_bits & 0x00000002u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->fence_log_path().data(), static_cast<int>(this->fence_log_path().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "EleFence.globalParam.fence_log_path");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      4, this->fence_log_path(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -1805,6 +1846,17 @@ void globalParam::SerializeWithCachedSizes(
         3, this->data_path(), target);
   }
 
+  // optional string fence_log_path = 4 [default = ""];
+  if (cached_has_bits & 0x00000002u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->fence_log_path().data(), static_cast<int>(this->fence_log_path().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "EleFence.globalParam.fence_log_path");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        4, this->fence_log_path(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -1844,13 +1896,22 @@ size_t globalParam::ByteSizeLong() const {
     }
   }
 
-  // optional string data_path = 3 [default = ""];
-  if (has_data_path()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->data_path());
-  }
+  if (_has_bits_[0 / 32] & 3u) {
+    // optional string data_path = 3 [default = ""];
+    if (has_data_path()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::StringSize(
+          this->data_path());
+    }
 
+    // optional string fence_log_path = 4 [default = ""];
+    if (has_fence_log_path()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::StringSize(
+          this->fence_log_path());
+    }
+
+  }
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -1882,9 +1943,16 @@ void globalParam::MergeFrom(const globalParam& from) {
 
   lidar_params_.MergeFrom(from.lidar_params_);
   regions_.MergeFrom(from.regions_);
-  if (from.has_data_path()) {
-    set_has_data_path();
-    data_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_path_);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 3u) {
+    if (cached_has_bits & 0x00000001u) {
+      set_has_data_path();
+      data_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_path_);
+    }
+    if (cached_has_bits & 0x00000002u) {
+      set_has_fence_log_path();
+      fence_log_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.fence_log_path_);
+    }
   }
 }
 
@@ -1916,6 +1984,7 @@ void globalParam::InternalSwap(globalParam* other) {
   lidar_params_.InternalSwap(&other->lidar_params_);
   regions_.InternalSwap(&other->regions_);
   data_path_.Swap(&other->data_path_);
+  fence_log_path_.Swap(&other->fence_log_path_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 81 - 0
src/findwheel/src/tools/EleFence.pb.h

@@ -686,10 +686,27 @@ class globalParam : public ::google::protobuf::Message /* @@protoc_insertion_poi
   ::std::string* release_data_path();
   void set_allocated_data_path(::std::string* data_path);
 
+  // optional string fence_log_path = 4 [default = ""];
+  bool has_fence_log_path() const;
+  void clear_fence_log_path();
+  static const int kFenceLogPathFieldNumber = 4;
+  const ::std::string& fence_log_path() const;
+  void set_fence_log_path(const ::std::string& value);
+  #if LANG_CXX11
+  void set_fence_log_path(::std::string&& value);
+  #endif
+  void set_fence_log_path(const char* value);
+  void set_fence_log_path(const char* value, size_t size);
+  ::std::string* mutable_fence_log_path();
+  ::std::string* release_fence_log_path();
+  void set_allocated_fence_log_path(::std::string* fence_log_path);
+
   // @@protoc_insertion_point(class_scope:EleFence.globalParam)
  private:
   void set_has_data_path();
   void clear_has_data_path();
+  void set_has_fence_log_path();
+  void clear_has_fence_log_path();
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
@@ -697,6 +714,7 @@ class globalParam : public ::google::protobuf::Message /* @@protoc_insertion_poi
   ::google::protobuf::RepeatedPtrField< ::EleFence::lidarParam > lidar_params_;
   ::google::protobuf::RepeatedPtrField< ::EleFence::Region > regions_;
   ::google::protobuf::internal::ArenaStringPtr data_path_;
+  ::google::protobuf::internal::ArenaStringPtr fence_log_path_;
   friend struct ::protobuf_EleFence_2eproto::TableStruct;
   friend void ::protobuf_EleFence_2eproto::InitDefaultsglobalParamImpl();
 };
@@ -1323,6 +1341,69 @@ inline void globalParam::set_allocated_data_path(::std::string* data_path) {
   // @@protoc_insertion_point(field_set_allocated:EleFence.globalParam.data_path)
 }
 
+// optional string fence_log_path = 4 [default = ""];
+inline bool globalParam::has_fence_log_path() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void globalParam::set_has_fence_log_path() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void globalParam::clear_has_fence_log_path() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void globalParam::clear_fence_log_path() {
+  fence_log_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  clear_has_fence_log_path();
+}
+inline const ::std::string& globalParam::fence_log_path() const {
+  // @@protoc_insertion_point(field_get:EleFence.globalParam.fence_log_path)
+  return fence_log_path_.GetNoArena();
+}
+inline void globalParam::set_fence_log_path(const ::std::string& value) {
+  set_has_fence_log_path();
+  fence_log_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:EleFence.globalParam.fence_log_path)
+}
+#if LANG_CXX11
+inline void globalParam::set_fence_log_path(::std::string&& value) {
+  set_has_fence_log_path();
+  fence_log_path_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:EleFence.globalParam.fence_log_path)
+}
+#endif
+inline void globalParam::set_fence_log_path(const char* value) {
+  GOOGLE_DCHECK(value != NULL);
+  set_has_fence_log_path();
+  fence_log_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:EleFence.globalParam.fence_log_path)
+}
+inline void globalParam::set_fence_log_path(const char* value, size_t size) {
+  set_has_fence_log_path();
+  fence_log_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:EleFence.globalParam.fence_log_path)
+}
+inline ::std::string* globalParam::mutable_fence_log_path() {
+  set_has_fence_log_path();
+  // @@protoc_insertion_point(field_mutable:EleFence.globalParam.fence_log_path)
+  return fence_log_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* globalParam::release_fence_log_path() {
+  // @@protoc_insertion_point(field_release:EleFence.globalParam.fence_log_path)
+  clear_has_fence_log_path();
+  return fence_log_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void globalParam::set_allocated_fence_log_path(::std::string* fence_log_path) {
+  if (fence_log_path != NULL) {
+    set_has_fence_log_path();
+  } else {
+    clear_has_fence_log_path();
+  }
+  fence_log_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), fence_log_path);
+  // @@protoc_insertion_point(field_set_allocated:EleFence.globalParam.fence_log_path)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__

+ 94 - 0
src/findwheel/src/tools/pathcreator.cpp

@@ -0,0 +1,94 @@
+#include "pathcreator.h"
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <stdint.h>
+#include <stdio.h>
+
+PathCreator::PathCreator()
+{
+
+}
+
+PathCreator::~PathCreator()
+{
+
+}
+
+std::string PathCreator::GetCurPath()
+{
+    return m_current_path;
+}
+bool PathCreator::Mkdir(std::string dirName)
+{
+    uint32_t beginCmpPath = 0;
+    uint32_t endCmpPath = 0;
+    std::string fullPath = "";
+
+        if('/' != dirName[0])
+        {
+            fullPath = getcwd(nullptr, 0);
+            beginCmpPath = fullPath.size();
+            fullPath = fullPath + "/" + dirName;
+        }
+        else
+        {
+            //Absolute path
+            fullPath = dirName;
+            beginCmpPath = 1;
+        }
+        if (fullPath[fullPath.size() - 1] != '/')
+        {
+            fullPath += "/";
+        }
+        endCmpPath = fullPath.size();
+
+        //create dirs;
+        for(uint32_t i = beginCmpPath; i < endCmpPath ; i++ )
+        {
+            if('/' == fullPath[i])
+            {
+                std::string curPath = fullPath.substr(0, i);
+                if(access(curPath.c_str(), F_OK) != 0)
+                {
+                    if(mkdir(curPath.c_str(), /*S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH*/0777) == -1)
+                    {
+                        printf("mkdir(%s) failed\n", curPath.c_str());
+                        return false;
+                    }
+                }
+            }
+        }
+        m_current_path=fullPath;
+        return true;
+
+}
+
+bool PathCreator::CreateDatePath(std::string root, bool add_time)
+{
+    time_t tt;
+    time( &tt );
+    tt = tt + 8*3600;  // transform the time zone
+    tm* t= gmtime( &tt );
+    char buf[255]={0};
+    if (add_time)
+    {
+        sprintf(buf, "%s/%d%02d%02d-%02d%02d%02d", root.c_str(),
+                t->tm_year + 1900,
+                t->tm_mon + 1,
+                t->tm_mday,
+                t->tm_hour,
+                t->tm_min,
+                t->tm_sec);
+    }
+    else
+    {
+        sprintf(buf, "%s/%d%02d%02d", root.c_str(),
+                t->tm_year + 1900,
+                t->tm_mon + 1,
+                t->tm_mday);
+    }
+    return Mkdir(buf);
+}

+ 17 - 0
src/findwheel/src/tools/pathcreator.h

@@ -0,0 +1,17 @@
+#ifndef PATHCREATOR_H
+#define PATHCREATOR_H
+#include <string>
+
+class PathCreator
+{
+public:
+    PathCreator();
+    ~PathCreator();
+    std::string GetCurPath();
+    bool Mkdir(std::string dir);
+    bool CreateDatePath(std::string root, bool add_time = true);
+protected:
+    std::string m_current_path;
+};
+
+#endif // PATHCREATOR_H

+ 2 - 1
src/findwheel/src/tools/s7_plc.cpp

@@ -2,11 +2,12 @@
 
 S7PLC::S7PLC():bConnected_(false)
 {
-    
 }
 S7PLC::~S7PLC()
 {
+    std::cout<<"plc start delete"<<std::endl;
     disconnect();
+    std::cout<<"plc finish delete"<<std::endl;
 }
 
 bool S7PLC::getConnection(){

+ 1 - 0
src/findwheel/src/tools/s7_plc.h

@@ -3,6 +3,7 @@
 
 #include <s7_client.h>
 #include <mutex>
+#include <iostream>
 
 class S7PLC
 {