{"id":599,"date":"2023-04-25T13:58:25","date_gmt":"2023-04-25T05:58:25","guid":{"rendered":"https:\/\/doc.orionstar.com\/en\/?post_type=lsvr_kba&#038;p=599"},"modified":"2023-04-25T14:01:09","modified_gmt":"2023-04-25T06:01:09","slug":"multi-robots-info","status":"publish","type":"lsvr_kba","link":"https:\/\/doc.orionstar.com\/en\/knowledge-base\/multi-robots-info\/","title":{"rendered":"Multi Robots Info"},"content":{"rendered":"\n<h2 id=\"api-reference-multi-robots-info-get-multi-robots-info\">Get multi robots info<a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development#api-reference-multi-robots-info-get-multi-robots-info\"><\/a><\/h2>\n\n\n\n<p>If the robot have ESP32 multi-robot hardware, use this code get receive multi-robot info.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">JRobotApi.getInstance().registerStatusListener(Definition.STATUS_MULTIPLE_ROBOT_WORKING, mStatusListener);\nprivate StatusListener mStatusListener = new StatusListener() {\n    @Override\n    public void onStatusUpdate(String type, String data) {\n        try {\n            Type dataType = new TypeToken&lt;List&lt;MultiRobotStatus>>(){}.getType();\n            List&lt;MultiRobotStatus> curRobotStatus = mGson.fromJson(data, dataType);\n        }catch(Exception ex){\n        }\n    }\n}<\/pre>\n\n\n\n<p>If the robot does not have ESP32 multi-robot hardware, this will not work. And about the structure of MultiRobotStatus, just like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class MultiRobotStatus {\n    private BasePoseBean pose;\n    private BasePoseBean goal;\n    private int id;\n    private int priority;\n    private boolean mapMatch;\n    private long time;\n    private int status;\n    private boolean curRobot = false;\n    private int errorStatus = 0;\n}<\/pre>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><thead><tr><th>Greetbot<\/th><th>Mini<\/th><th>Lucki<\/th><th>Baoxiaodi MAX<\/th><th>Baodaping<\/th><\/tr><\/thead><tbody><tr><td>No<\/td><td>No<\/td><td>Yes<\/td><td>No<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Get multi robots info If the robot have ESP32 multi-robot hardware, use this code get receive multi-robot info. If the robot does not have ESP32 multi-robot hardware, this will not work. And about the structure of MultiRobotStatus, just like this: Greetbot Mini Lucki Baoxiaodi MAX Baodaping No No Yes No No<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"lsvr_kba_cat":[6],"lsvr_kba_tag":[],"_links":{"self":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/599"}],"collection":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/comments?post=599"}],"version-history":[{"count":2,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/599\/revisions"}],"predecessor-version":[{"id":602,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/599\/revisions\/602"}],"wp:attachment":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/media?parent=599"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_cat?post=599"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_tag?post=599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}