{"id":543,"date":"2023-03-30T17:41:34","date_gmt":"2023-03-30T09:41:34","guid":{"rendered":"https:\/\/doc.orionstar.com\/en\/?post_type=lsvr_kba&#038;p=543"},"modified":"2023-03-30T17:41:34","modified_gmt":"2023-03-30T09:41:34","slug":"basic-motion","status":"publish","type":"lsvr_kba","link":"https:\/\/doc.orionstar.com\/en\/knowledge-base\/basic-motion\/","title":{"rendered":"Basic Motion"},"content":{"rendered":"\n<h3 id=\"api-reference-basic-motion-linear-motion\"><strong>Linear motion<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-linear-motion\"><\/a><\/h3>\n\n\n\n<p>Method name: goForward \/ goBackward<\/p>\n\n\n\n<p>Calling method:<\/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=\"\">CommandListener motionListener = new CommandListener() {    \n    @Override    \n    public void onResult(int result, String message) {        \n        if (\"succeed\".equals(message)) {            \n            \/\/success        \n        } else {            \n            \/\/failed        \n        }    \n    }\n};\nRobotApi.getInstance().goForward(reqId, speed, motionListener);\nRobotApi.getInstance().goForward(reqId, speed, distance, motionListener);\nRobotApi.getInstance().goForward(reqId, speed, distance, avoid, motionListener);\nRobotApi.getInstance().goBackward(reqId, speed, motionListener);\nRobotApi.getInstance().goBackward(reqId, speed, distance, motionListener);<\/pre>\n\n\n\n<p>Parameter Description:<\/p>\n\n\n\n<ul>\n<li>speed: movement speed, unit m\/s, range is 0 ~ 1.0, speed greater than 1.0 will move at 1.0<\/li>\n\n\n\n<li>distance: Movement distance, in m, the value must be greater than 0.<\/li>\n\n\n\n<li>avoid: Whether to avoid stopping when walking, only moving forward can avoid stopping.<\/li>\n<\/ul>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 id=\"api-reference-basic-motion-rotational-movement\"><strong>Rotational movement<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-rotational-movement\"><\/a><\/h3>\n\n\n\n<p>Method name: turnLeft \/ turnRight<\/p>\n\n\n\n<p>Calling method:<\/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=\"\">CommandListener rotateListener = new CommandListener() {    \n    @Override    \n    public void onResult(int result, String message) {        \n        if (\"succeed\".equals(message)) {            \n            \/\/success        \n        } else {            \n            \/\/failed        \n        }    \n    }\n    };\nRobotApi.getInstance().turnLeft(reqId, speed, rotateListener);\nRobotApi.getInstance().turnLeft(reqId, speed, angle, rotateListener);\nRobotApi.getInstance().turnRight(reqId, speed, rotateListener);\nRobotApi.getInstance().turnRight(reqId, speed, angle, rotateListener);<\/pre>\n\n\n\n<p>Parameter Description:<\/p>\n\n\n\n<ul>\n<li>speed : rotation speed, unit: degree\/s, range is 0 ~ 50 degree\/s<\/li>\n\n\n\n<li>angle : rotation angle, unit: degree, the value must be greater than 0<\/li>\n<\/ul>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 id=\"api-reference-basic-motion-arc-motion\"><strong>Arc Motion<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-arc-motion\"><\/a><\/h3>\n\n\n\n<p>Method name: motionArcWithObstacles<\/p>\n\n\n\n<p>Calling method:<\/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=\"\">RobotApi.getInstance().motionArcWithObstacles(reqID,0.5,0,new CommandListener(){    \n    @Override    \n    public void onResult(int result, String message, String extraData) {    \n    }    \n    @Override    \n    public void onStatusUpdate(int status, String data, String extraData) {    \n    }\n});<\/pre>\n\n\n\n<ul>\n<li>lineSpeed : line speed, range is -1.2 ~ 1.2<\/li>\n\n\n\n<li>angularSpeed : angular speed, range is -2 ~ 2<\/li>\n<\/ul>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 id=\"api-reference-basic-motion-stop\"><strong>Stop<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-stop\"><\/a><\/h3>\n\n\n\n<p>Method name: stopMove<\/p>\n\n\n\n<p>Calling method:<\/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=\"\">RobotApi.getInstance().stopMove(reqId, new CommandListener() {    \n    @Override    \n    public void onResult(int result, String message) {        \n        if (\"succeed\".equals(message)) {            \n            \/\/success        \n        } else {            \n            \/\/failed        \n        }    \n    }\n});<\/pre>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><em>Note: This interface can only be used to stop forward, backward and rotation, and cannot be used to stop navigation and head movement<\/em><\/p>\n\n\n\n<h3 id=\"api-reference-basic-motion-head-movement\"><strong>Head movement<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-head-movement\"><\/a><\/h3>\n\n\n\n<p>Method name: moveHead<\/p>\n\n\n\n<p>Calling method:<\/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=\"\">RobotApi.getInstance().moveHead(reqId, hMode, vMode, hAngle, vAngle, new CommandListener() {    \n    @Override    \n    public void onResult(int result, String message) {        \n        try {            \n            JSONObject json = new JSONObject(message);            \n            String status = json.getString(\"status\");            \n            if (Definition.CMD_STATUS_OK.equals(status)) {                \n                \/\/success            \n            }        \n        } catch (JSONException | NullPointerException e) {            \n            e.printStackTrace();        \n        }    \n    }\n});<\/pre>\n\n\n\n<p>Parameter Description:<\/p>\n\n\n\n<ul>\n<li>hMode : the mode of turning left and right, absolute movement: absolute, relative movement: relative<\/li>\n\n\n\n<li>vMode : the mode of up and down movement, absolute movement: absolute, relative movement: relative<\/li>\n\n\n\n<li>hAngle : left and right rotation angle, range: -120 ~ 120<\/li>\n\n\n\n<li>vAngle : the angle of up and down movement, range: 0 ~ 90<\/li>\n<\/ul>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Note: Please pay attention to the physical limitations of the machine type, the left and right rotation mode of the Mini model is invalid<\/p>\n\n\n\n<h3 id=\"api-reference-basic-motion-restore-the-initial-angle-of-the-gimbal\"><strong>Restore the initial angle of the gimbal<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-restore-the-initial-angle-of-the-gimbal\"><\/a><\/h3>\n\n\n\n<p>Method name: resetHead<\/p>\n\n\n\n<p>Method of calling:<\/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=\"\">RobotApi.getInstance().resetHead(reqId, new CommandListener() {    \n    @Override    \n    public void onResult(int result, String message) {        \n        try {            \n            JSONObject json = new JSONObject(message);            \n            String status = json.getString(\"status\");            \n            if (Definition.CMD_STATUS_OK.equals(status)) {                \n                \/\/success            \n            }        \n        } catch (JSONException | NullPointerException e) {            \n            e.printStackTrace();        \n        }    \n    }\n});<\/pre>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>Yes<\/td><td>No<\/td><td>No<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 id=\"api-reference-basic-motion-switch-camera\"><strong>Switch camera<\/strong><a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development\/#api-reference-basic-motion-switch-camera\"><\/a><\/h3>\n\n\n\n<p>Method name: switchCamera<\/p>\n\n\n\n<p>Calling method:<\/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=\"\">RobotApi.getInstance().switchCamera(reqId, camera, new CommandListener() {    \n    @Override    \n    public void onResult(int result, String message) {        \n        try {            \n            JSONObject json = new JSONObject(message);            \n            if (Definition.RESPONSE_OK.equals(json.getString(\"status\"))) {                \n                \/\/success            \n            }        \n        } catch (JSONException | NullPointerException e) {            \n            e.printStackTrace();        \n        }    \n    }\n});<\/pre>\n\n\n\n<p>Parameter Description:<\/p>\n\n\n\n<ul>\n<li>camera : camera, String type Definition.JSON_HEAD_FORWARD front camera Definition.JSON_HEAD_BACKWARD rear camera<\/li>\n<\/ul>\n\n\n\n<p>Applicable Platform:<\/p>\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>DeliverBot<\/th><th>BigScreenBot<\/th><\/tr><\/thead><tbody><tr><td>Yes<\/td><td>No<\/td><td>No<\/td><td>No<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><em>Note: Please check if the Robot you are using has a rear camera<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linear motion Method name: goForward \/ goBackward Calling method: Parameter Description: Applicable Platform: GreetBot Mini Lucki DeliverBot BigScreenBot Yes Yes Yes Yes No Rotational movement Method name: turnLeft \/ turnRight Calling method: Parameter Description: Applicable Platform: GreetBot Mini Lucki DeliverBot BigScreenBot Yes Yes Yes Yes No Arc Motion Method name: motionArcWithObstacles Calling method: Applicable Platform: [&hellip;]<\/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\/543"}],"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=543"}],"version-history":[{"count":1,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/543\/revisions"}],"predecessor-version":[{"id":544,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/543\/revisions\/544"}],"wp:attachment":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/media?parent=543"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_cat?post=543"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_tag?post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}