wsc_robotic.utils package

Submodules

wsc_robotic.utils.app_manager module

wsc_robotic.utils.app_manager.get_cmd()

获取args

参数:

None

返回:

命令

返回类型:

str

wsc_robotic.utils.app_manager.get_pid(name='')

获取进程名pid

参数:

name (str) -- 进程名

返回:

进程pid

返回类型:

str

wsc_robotic.utils.app_manager.load_config() dict

获取yaml配置参数

参数:

None

返回:

返回配置参数

返回类型:

dict

wsc_robotic.utils.app_manager.run_apps(config=None)

运行程序

参数:

config (dict) -- 配置参数

返回:

None

wsc_robotic.utils.app_manager.stop()

关闭进程

参数:

None

返回:

None

wsc_robotic.utils.app_manager.wait_exit(name='', timeout_s=10)

等待进程退出

参数:
  • name (str) -- 进程名

  • timeout_s (int) -- 超时时间

返回:

True:退出成功 False:退出失败

返回类型:

bool

wsc_robotic.utils.app_manager.wait_start(name='', timeout_s=10)

等待进程启动

参数:
  • name (str) -- 进程名

  • timeout_s (int) -- 超时时间

返回:

True:启动成功 False:启动失败

返回类型:

bool

wsc_robotic.utils.license_client module

class wsc_robotic.utils.license_client.LicenseClient(robotics)

基类:object

授权客户端

call_license_srv()

调用授权服务

参数:

None

返回:

授权信息

#授权状态 uint8 IICENSE_SUCCESS = 0x00 #许可证验证成功 uint8 LICENSE_INVALID = 0x01 #许可证无效 uint8 LODA_PUBLIC_KEY_FILE_ERR = 0x02 #加载公钥文件错误 uint8 INVALID_PUBLIC_KEY_ERR = 0x03 #公钥无效 uint8 LODA_SIGNATURE_FILE_ERR = 0x04 #加载签名文件错误 uint8 GET_SERIAL_NUMBER_ERR = 0x05 #获取序列号错误 uint8 LODA_PUBLIC_KEY_MEM_ERR = 0x06 #加载公钥内存错误

#授权信息 bool is_authorize #是否授权 uint8 license_status #授权状态 string info #信息 string serial_number #当前序列号 string signature_path #签名文件路径 string public_key #当前公钥 string describe #公钥描述

返回类型:

dict

get_license_status(print_log=True)

获取授权状态

参数:

print_log (bool, optional) -- 是否打印授权信息. Defaults to True.

返回:

授权信息

返回类型:

dict

wsc_robotic.utils.trapezoidal_planner module

class wsc_robotic.utils.trapezoidal_planner.TrapezoidalPlanner

基类:object

梯形规划器

init_plan(max_vel, max_acc, max_decel, init_distance, distance)

初始化规划参数

参数:
  • max_vel (float) -- 最大速度

  • max_acc (float) -- 最大加速度

  • max_decel (float) -- 最大减速度

  • init_distance (float) -- 初始位置

  • distance (float) -- 目标位置

返回:

规划信息 [距离, 速度, 加速度, 加速距离, 匀速距离, 加速时间, 匀速时间, 总时间]

返回类型:

dict

plan()

执行规划

参数:

None

返回:

当前时间s, 规划位置, 规划速度, 规划加速度, 停止标志

返回类型:

dict

plan_with_time(t=0.0)

执行规划 外部时钟

参数:

t (float) -- 时间s

返回:

当前时间s, 规划位置, 规划速度, 规划加速度, 停止标志

返回类型:

dict

wsc_robotic.utils.utils module

class wsc_robotic.utils.utils.FileManager(host='192.168.123.3', port=22, user='vmx', password='password')

基类:object

文件管理类

close()

关闭机器人连接

参数:

None

返回:

None

connect()

连接机器人

参数:

None

返回:

连接成功 False: 连接失败

返回类型:

True

download_folder(remote_path, local_path)

递归下载远程SFTP文件夹到本地

参数:
  • remote_path (str) -- 远端文件夹路径

  • local_path (str) -- 本地文件夹路径

返回:

None

remove_folder(remote_path)

删除机器人文件夹

参数:

remote_path (str) -- 远端文件夹路径

返回:

删除成功 False: 删除失败

返回类型:

True

upload_file(local_path, remote_path)

上传文件

参数:
  • local_path (str) -- 本地文件路径

  • remote_path (str) -- 远端文件路径

返回:

上传成功 False: 上传失败

返回类型:

True

upload_folder(local_path, remote_path)

递归上传本地文件夹到远程SFTP服务器

参数:
  • local_path (str) -- 本地文件夹路径

  • remote_path (str) -- 远端文件夹路径

返回:

None

wsc_robotic.utils.utils.file_get(ip='', local_path='', remote_path='')

文件下载

参数:
  • ip (str) -- 机器人ip

  • local_path (str) -- 本地文件路径

  • remote_path (str) -- 远端文件路径

返回:

下载成功 False: 下载失败

返回类型:

True

wsc_robotic.utils.utils.file_put(ip, local_path, remote_path)

文件上传

参数:
  • ip (str) -- 机器人ip

  • local_path (str) -- 本地文件路径

  • remote_path (str) -- 远端文件路径

返回:

上传成功 False: 上传失败

返回类型:

True

wsc_robotic.utils.utils.system_command(ip='', cmd='')

执行系统命令

参数:
  • ip (str) -- 机器人ip

  • cmd (str) -- 命令

返回:

执行成功 False: 执行失败

返回类型:

True

wsc_robotic.utils.vmxpi module

class wsc_robotic.utils.vmxpi.VmxPi(robotics)

基类:object

VMXPI接口

destory()

销毁

参数:

None

返回:

None

read_vmxpi_datas()

获取VMXPI数据

参数:

None

返回:

The return value.

返回类型:

VmxPiDatas

set_digital_output(port=0, state=False)

设置数字输出

参数:
  • port (int)

  • state (bool)

返回:

The return value. True or False

返回类型:

bool

wait()

等待机器人连接

参数:

None

返回:

None

write_pwm(dutys=[0.0, 0.0, 0.0, 0.0, 0.0])

发布PWM

参数:

dutys (list)

返回:

None

Module contents