Skip to main content

Fourier General Robotics OS - Client Library (python)

Project description

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

概述

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

历程

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

快速上手

安装

pip install gros_client 

# 如遇网络延迟,可选择清华源安装 
# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gros_client

使用方法

导入sdk

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

import gros_client   # 导入root

创建机器人对象

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

from gros_client import Human  # 按需导入Human、同理还有Car、Dog等

human = Human(host='192.168.12.1')

控制机器人

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

  • 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)
  • move_joint(*motor): 移动关节(长度可变参数,可以同时控制多个关节,延迟预估2ms)
    • motor(Motor): 关节对象, 可以通过human.motor_limits 获取对应关节的映射关系和参数编号
  • upper_body(arm_action, hand_action): 上肢预设指令
    • arm_action(ArmAction): 胳膊预设指令枚举
    • hand_action(HandAction): 手部预设指令枚举

示例代码

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

import time
from gros_client import Human
from gros_client.robot.human import ArmAction, HandAction, Motor

human = Human(host='192.168.9.17') # 请将host替换为您所拥有设备的ip
human.start() # 启动远程控制
time.sleep(10) # 控制系统内置状态机。为了保证机器人的校准和启动正常,在start()指令之后建议10s再执行后续指令

human.stand() # 站立
human.walk(0, 0.1) # 以0.1的速度向正前方移动

human.upper_body(arm=ArmAction.LEFT_ARM_WAVE)       # 左挥手
human.upper_body(arm=ArmAction.TWO_ARMS_WAVE)       # 挥手
human.upper_body(hand=HandAction.TREMBLE)           # 抖动手指

human.move_joint(Motor(no='1', angle=10, orientation='left'), 
                 Motor(no='1', angle=10, orientation='right')) # 移动一号电机 右侧右侧各10度

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gros_client-1.1.2.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gros_client-1.1.2-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file gros_client-1.1.2.tar.gz.

File metadata

  • Download URL: gros_client-1.1.2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for gros_client-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d29c6dbb4419da6708a27ae1c329e16dcb63d9eb5fd264ac50a77355e1a3eb98
MD5 ebc6a2ad78f287eff88ab6d7f5df761b
BLAKE2b-256 c66e9cc3fc146a68014cf01433071e1999d7cb302c0df77655575494e7c6fd5d

See more details on using hashes here.

File details

Details for the file gros_client-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: gros_client-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for gros_client-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fca06b5005d3f1ee9df6ef8300a2c26c661257d89e6aa134de300e72e3b6a4da
MD5 ae181266d72050b2ec6e3dc26e06de12
BLAKE2b-256 c27d8453b2513554eae38fa112efe273d5f387636eeb26c205022b269f737863

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page