You can send commands from the javascript console to perform actions on the dog. If you need to know how to enable the console, please refer to the Enable the hand walk and front flip section in this tutorial.
To enter the advanced mode and EDU layout, copy-paste and run this command:
window.ZHBridge.Core.callJsHandler({name: "appSendRoute",args: {
url: "operation",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu", language: "en", topLeft: 59,
sportmode: "advanced",
length: 7},
argsCount: 7})
window.appSendRoute({
url: "operation",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu",language: "en",topLeft: 59,
sportmode: "advanced"
,length: 7}
)
To enter the basic mode and EDU layout, copy-paste and run this command:
window.ZHBridge.Core.callJsHandler({name: "appSendRoute",args: {
url: "operation",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu", language: "en", topLeft: 59,
sportmode: "normal",
length: 7},
argsCount: 7})
window.appSendRoute({
url: "operation",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu",language: "en",topLeft: 59,
sportmode: "normal"
,length: 7}
)
To enter the Block-programming, copy-paste and run this command:
window.ZHBridge.Core.callJsHandler({name: "appSendRoute",args: {
url: "programming",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu", language: "en", topLeft: 59,
sportmode: "normal",
length: 7},
argsCount: 7})
window.appSendRoute({
url: "programming",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu",language: "en",topLeft: 59,
sportmode: "normal"
,length: 7}
)
To enter the Slam layout, copy-paste and run this command:
window.ZHBridge.Core.callJsHandler({name: "appSendRoute",args: {
url: "slam",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu", language: "en", topLeft: 59,
sportmode: "normal",
length: 7},
argsCount: 7})
window.appSendRoute({
url: "slam",
sn: "B42D2000XXXXXXXX",userid: "2000",
mode: "edu",language: "en",topLeft: 59,
sportmode: "normal"
,length: 7}
)
To execute a backflip on 1.1.1 firmware:
window.ZHBridge.Core.callJsHandler({name: "appSendCmdToGo2",args: {
topic: "rt/api/sport/request"
api_id: 1044,
data: {data: true}, id: 436472, priority: 0, length: 7
},argsCount: 7})
window.appSendCmdToGo2({
topic: "rt/api/sport/request",
api_id: 1044,
data: {data: true}, id: 436472, priority: 0, length: 7
})
To send commands to GO2 to perform different action, you copy-past and run this command:
window.ZHBridge.Core.callJsHandler({name: "appSendCmdToGo2",args: {
topic: "rt/api/sport/request"
api_id: 1030,
data: "", id: 436472, priority: 0, length: 7
},argsCount: 7})
window.appSendCmdToGo2({
topic: "rt/api/sport/request",
api_id: 1030,
data: "", id: 436472, priority: 0, length: 7
})
Notice the app_id, which you can change to specify the action to be performed as per the table below:
Action | App ID Code | Notes |
Damp | 1001 | |
BalanceStand | 1002 | |
StopMove | 1003 | |
StandUp | 1004 | |
StandDown | 1005 | |
RecoveryStand | 1006 | |
Euler | 1007 | |
Move | 1008 | |
Sit | 1009 | |
RiseSit | 1010 | |
SwitchGait | 1011 | |
Trigger | 1012 | |
BodyHeight | 1013 | |
FootRaiseHeight | 1014 | |
SpeedLevel | 1015 | |
Hello | 1016 | |
Stretch | 1017 | |
TrajectoryFollow | 1018 | |
ContinuousGait | 1019 | |
Content | 1020 | API not implemented on the server |
Wallow | 1021 | |
Dance1 | 1022 | |
Dance2 | 1023 | |
GetBodyHeight | 1024 | API not implemented on the server |
GetFootRaiseHeight | 1025 | API not implemented on the server |
GetSpeedLevel | 1026 | API not implemented on the server |
SwitchJoystick | 1027 | NOT WORKING use bash_runner_client instead!!! |
Pose | 1028 | |
Scrape | 1029 | |
FrontFlip | 1030 | |
Left flip | 1042 | |
Right flip | 1043 | |
Backflip | 1044 | |
FrontJump | 1031 | |
FrontPounce | 1032 | |
WiggleHips | 1033 | |
GetState | 1034 | |
EconomicGait | 1035 | |
FingerHeart | 1036 | |
Handstand | 1301 | |
CrossStep | 1302 | |
OnesidedStep | 1303 | |
Bound | 1304 | |
LeadFollow | 1045 |