main.java 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. package com.fdkk.sxz;
  2. import cn.hutool.http.HttpUtil;
  3. import java.net.URISyntaxException;
  4. import java.util.concurrent.ExecutionException;
  5. public class main {
  6. //public static void main(String[] args) {
  7. // String json = "{\n" +
  8. // " \"sweepLocations\": [\n" +
  9. // " {\n" +
  10. // " \"subgroup\": 0,\n" +
  11. // " \"pose\": {\n" +
  12. // " \"rotation\": {\n" +
  13. // " \"w\": 0.95928264,\n" +
  14. // " \"x\": -0.0017092235,\n" +
  15. // " \"y\": -0.0016763769,\n" +
  16. // " \"z\": -0.28243768\n" +
  17. // " },\n" +
  18. // " \"translation\": {\n" +
  19. // " \"x\": 3.6112025,\n" +
  20. // " \"y\": 0.12166519,\n" +
  21. // " \"z\": 0.07516695\n" +
  22. // " }\n" +
  23. // " },\n" +
  24. // " \"visibles3\": [\n" +
  25. // " 1,\n" +
  26. // " 2,\n" +
  27. // " 3\n" +
  28. // " ],\n" +
  29. // " \"visibles2\": [\n" +
  30. // " 1,\n" +
  31. // " 2,\n" +
  32. // " 3\n" +
  33. // " ],\n" +
  34. // " \"puck\": {\n" +
  35. // " \"x\": 3.6112025,\n" +
  36. // " \"y\": 0.12166519,\n" +
  37. // " \"z\": -1.39718955\n" +
  38. // " },\n" +
  39. // " \"uuid\": \"0\",\n" +
  40. // " \"visibles\": [\n" +
  41. // " 1,\n" +
  42. // " 2,\n" +
  43. // " 3\n" +
  44. // " ],\n" +
  45. // " \"group\": 1\n" +
  46. // " },\n" +
  47. // " {\n" +
  48. // " \"subgroup\": 0,\n" +
  49. // " \"pose\": {\n" +
  50. // " \"rotation\": {\n" +
  51. // " \"w\": 0.97998166,\n" +
  52. // " \"x\": -0.00051350286,\n" +
  53. // " \"y\": -0.00007887775,\n" +
  54. // " \"z\": -0.19908713\n" +
  55. // " },\n" +
  56. // " \"translation\": {\n" +
  57. // " \"x\": 1.6813623,\n" +
  58. // " \"y\": 0.20879818,\n" +
  59. // " \"z\": 0.07516695\n" +
  60. // " }\n" +
  61. // " },\n" +
  62. // " \"visibles3\": [\n" +
  63. // " 0,\n" +
  64. // " 2,\n" +
  65. // " 3\n" +
  66. // " ],\n" +
  67. // " \"visibles2\": [\n" +
  68. // " 0,\n" +
  69. // " 2,\n" +
  70. // " 3\n" +
  71. // " ],\n" +
  72. // " \"puck\": {\n" +
  73. // " \"x\": 1.6813623,\n" +
  74. // " \"y\": 0.20879818,\n" +
  75. // " \"z\": -1.39718955\n" +
  76. // " },\n" +
  77. // " \"uuid\": \"2\",\n" +
  78. // " \"visibles\": [\n" +
  79. // " 0,\n" +
  80. // " 2,\n" +
  81. // " 3\n" +
  82. // " ],\n" +
  83. // " \"group\": 1\n" +
  84. // " },\n" +
  85. // " {\n" +
  86. // " \"subgroup\": 0,\n" +
  87. // " \"pose\": {\n" +
  88. // " \"rotation\": {\n" +
  89. // " \"w\": 0.7688388,\n" +
  90. // " \"x\": -0.0022818057,\n" +
  91. // " \"y\": 0.0016657045,\n" +
  92. // " \"z\": -0.6394364\n" +
  93. // " },\n" +
  94. // " \"translation\": {\n" +
  95. // " \"x\": -1.0941758,\n" +
  96. // " \"y\": -0.15828772,\n" +
  97. // " \"z\": 0.07516695\n" +
  98. // " }\n" +
  99. // " },\n" +
  100. // " \"visibles3\": [\n" +
  101. // " 0,\n" +
  102. // " 1,\n" +
  103. // " 3\n" +
  104. // " ],\n" +
  105. // " \"visibles2\": [\n" +
  106. // " 0,\n" +
  107. // " 1,\n" +
  108. // " 3\n" +
  109. // " ],\n" +
  110. // " \"puck\": {\n" +
  111. // " \"x\": -1.0941758,\n" +
  112. // " \"y\": -0.15828772,\n" +
  113. // " \"z\": -1.39718955\n" +
  114. // " },\n" +
  115. // " \"uuid\": \"4\",\n" +
  116. // " \"visibles\": [\n" +
  117. // " 0,\n" +
  118. // " 1,\n" +
  119. // " 3\n" +
  120. // " ],\n" +
  121. // " \"group\": 1\n" +
  122. // " },\n" +
  123. // " {\n" +
  124. // " \"subgroup\": 1,\n" +
  125. // " \"pose\": {\n" +
  126. // " \"rotation\": {\n" +
  127. // " \"w\": 0.75378096,\n" +
  128. // " \"x\": -0.00085483055,\n" +
  129. // " \"y\": 0.0011985971,\n" +
  130. // " \"z\": -0.6571241\n" +
  131. // " },\n" +
  132. // " \"translation\": {\n" +
  133. // " \"x\": -4.213454,\n" +
  134. // " \"y\": -0.17369196,\n" +
  135. // " \"z\": 0.07516695\n" +
  136. // " }\n" +
  137. // " },\n" +
  138. // " \"visibles3\": [\n" +
  139. // " 0,\n" +
  140. // " 1,\n" +
  141. // " 2\n" +
  142. // " ],\n" +
  143. // " \"visibles2\": [\n" +
  144. // " 0,\n" +
  145. // " 1,\n" +
  146. // " 2\n" +
  147. // " ],\n" +
  148. // " \"puck\": {\n" +
  149. // " \"x\": -4.213454,\n" +
  150. // " \"y\": -0.17369196,\n" +
  151. // " \"z\": -1.39718955\n" +
  152. // " },\n" +
  153. // " \"uuid\": \"6\",\n" +
  154. // " \"visibles\": [\n" +
  155. // " 0,\n" +
  156. // " 1,\n" +
  157. // " 2\n" +
  158. // " ],\n" +
  159. // " \"group\": 1\n" +
  160. // " }\n" +
  161. // " ]\n" +
  162. // "}";
  163. // JSONObject visionJson = JSON.parseObject(json);
  164. // JSONArray sweepArray = visionJson.getJSONArray("sweepLocations");
  165. // List<JSONObject> roamingPoint = new ArrayList();
  166. // for (int i = 0; i < sweepArray.size(); i++) {
  167. // JSONObject objectJson = sweepArray.getJSONObject(i);
  168. // JSONObject newJson = new JSONObject();
  169. // newJson.put("uuid", objectJson.getString("uuid"));
  170. // JSONObject puck = objectJson.getJSONObject("puck");
  171. // puck.put("y", puck.getDoubleValue("y") * -1);
  172. // puck.remove("z");
  173. // newJson.put("puck", puck);
  174. // newJson.put("subgroup", objectJson.getInteger("subgroup"));
  175. // roamingPoint.add(newJson);
  176. // }
  177. // Map<String, List<JSONObject>> subgroup = roamingPoint.stream().collect(
  178. // Collectors.groupingBy(x -> x.getString("subgroup"))).entrySet().stream()
  179. // .collect(Collectors.toMap(e -> "floor" + e.getKey(), Map.Entry::getValue));
  180. //
  181. // System.out.println(JSON.toJSONString(subgroup));
  182. //}
  183. public static void main(String[] args) throws URISyntaxException, ExecutionException, InterruptedException {
  184. String result = HttpUtil.get("http://192.168.0.26:8081/" + "change/fbxToObj/dataPush/asdasdasdasd");
  185. }
  186. }