0.2.28 • Published 7 months ago

gros-client v0.2.28

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

傅利叶通用机器人系统-客户端SDK(Javascript/Typescript)

概述

本例(GROS Client SDK)适用于您已经拥有傅利叶(Fourier)所提供的机器人设备,通过本例可实现对机器人的控制。它提供了一组简单的API,让你可以轻松地与机器人进行交互。

历程

版本号作者日期描述快速预览
0.1傅利叶软件部2023.81. 立项2. 确认基础架构0.1说明
0.2傅利叶软件部2023.91. 控制模块、系统模块2. 具体coding0.2说明

快速上手

安装

npm install gros-client

使用方法

导入sdk

首先你需要在你的代码中导入这个SDK

import {Human} from 'gros-client';   

创建机器人对象

然后,你需要创建一个机器人对象,以便使用这个SDK

import {Human} from 'gros-client';  // 按需导入Human、同理还有Car、Dog等

let human = new Human({host: '192.168.9.17'});

控制机器人

你可以使用以下方法来控制机器人:

  • start(): 回零/开启控制
  • stop(): 急停(会掉电停止)
  • exit(): 退出机器人控制
  • stand(): 原地站立
  • walk(angle, speed): 控制机器人移动、走路
    • angle(float): 角度 控制方向,取值范围为正负45度。向左为正,向右为负!(浮点数8位)
    • speed(float): 速度 控制前后,取值范围为正负0.8。向前为正,向后为负!(浮点数8位)
  • head(roll, pitch, yaw): 控制GR-01人形头部运动
    • roll(float): roll(翻滚角):描述围绕x轴旋转的角度,左转头为负,向右转为正,范围(-17.1887-17.1887)
    • pitch(float): pitch(俯仰角):描述围绕y轴旋转的角度。前点头为正,后点头为负,范围(-17.1887-17.1887)
    • yaw(float): yaw(偏航角):描述围绕z轴旋转的角度。左扭头为负,右扭头为正,范围(-17.1887-17.1887)

示例代码

下面是一个完整的示例代码,演示如何使用这个SDK来控制机器人:

import {Human} from 'gros-client';  

let human = new Human({host: '192.168.9.17'});      // 请将host替换为您所拥有设备的ip

human.start(); // 启动远程控制

setTimeout(() => {
    human.stand() // 站立
    human.walk(0, 0.1) // 以0.1的速度向正前方移动
    
    //  控制系统内置状态机。为了保证机器人的校准和启动正常,在start()指令之后建议10s再执行后续指令
}, 10 * 1000)
0.2.27

7 months ago

0.2.28

7 months ago

0.2.26

8 months ago

0.2.25

8 months ago

0.2.24

8 months ago

0.2.23

8 months ago

0.2.22

8 months ago

0.2.21

8 months ago

0.2.20

8 months ago

0.2.19

8 months ago

0.2.18

8 months ago

0.2.17

8 months ago

0.2.16

8 months ago

0.2.15

8 months ago

0.2.14

8 months ago

0.2.13

8 months ago

0.2.12

9 months ago

0.2.11

9 months ago

0.2.10

9 months ago

0.2.9

9 months ago

0.2.8

9 months ago

0.2.7

9 months ago

0.2.6

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.1.53

9 months ago

0.1.52

9 months ago

0.1.51

9 months ago

0.1.50

9 months ago

0.1.49

9 months ago

0.1.48

9 months ago

0.1.47

9 months ago

0.1.46

9 months ago

0.1.45

9 months ago

0.1.44

9 months ago

0.1.43

9 months ago

0.1.42

9 months ago

0.1.41

9 months ago

0.1.40

9 months ago

0.1.39

9 months ago

0.1.38

9 months ago

0.1.37

9 months ago

0.1.36

9 months ago

0.1.35

9 months ago

0.1.34

9 months ago

0.1.33

9 months ago

0.2.0

9 months ago

0.1.32

9 months ago

0.1.31

9 months ago

0.1.30

9 months ago

0.1.29

9 months ago

0.1.28

9 months ago

0.1.27

9 months ago

0.1.26

9 months ago

0.1.24

9 months ago

0.1.23

9 months ago

0.1.22

9 months ago

0.1.21

9 months ago

0.1.20

9 months ago

0.1.19

9 months ago

0.1.18

9 months ago

0.1.14

9 months ago

0.1.13

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago