当前位置: 首页 > news >正文

合肥公司建站模板广州软件开发招聘

合肥公司建站模板,广州软件开发招聘,知名网站排名,catchy wordpressRuckig 是一种实时轨迹生成器,允许机器人和机器即时响应传感器输入。Ruckig 从任意初始状态开始,计算到目标路径点(包括位置、速度和加速度)的轨迹,并受限于速度、加速度和加加速度约束。除了目标状态外,Ru…

Ruckig 是一种实时轨迹生成器,允许机器人和机器即时响应传感器输入。Ruckig 从任意初始状态开始,计算到目标路径点(包括位置、速度和加速度)的轨迹,并受限于速度、加速度和加加速度约束。除了目标状态外,Ruckig 还允许定义中间位置以进行路径点跟踪。对于状态到状态的运动,Ruckig 保证时间最优解。通过中间路径点,Ruckig 联合计算路径及其时间参数化,与传统方法相比,生成的轨迹显著更快。

  • 参考 Ruckig 的 GitHub 仓库

1. 基本概念

  • 自由度 (Degrees of Freedom, DOFs):指系统中可以独立运动的维度数量。例如,一个三轴机器人臂有三个自由度。
  • 位置 (Position):系统在某一时刻的具体位置。
  • 速度 (Velocity):系统在某一时刻的运动速度。
  • 加速度 (Acceleration):系统在某一时刻的速度变化率。
  • 加加速度 (Jerk):系统在某一时刻的加速度变化率。
  • 输入参数 (Input Parameters):包括当前状态(位置、速度、加速度)、目标状态(位置、速度、加速度)以及最大速度、加速度和加加速度等约束条件。
  • 输出参数 (Output Parameters):计算得到的新的状态(位置、速度、加速度)。
  • 同步模式 (Synchronization):确保所有自由度在相同的时间内完成运动。

2. 轨迹规划类型

  • 状态到状态的轨迹规划:从任意初始状态(包括位置、速度和加速度)到目标状态的轨迹规划,保证时间最优解。
  • 路径点跟踪:允许定义中间位置,通过这些路径点进行轨迹规划,联合计算路径及其时间参数化。
  • 实时轨迹生成:能够在运行时根据传感器输入即时生成轨迹,适用于需要快速响应的应用场景。

3. 安装

pip install ruckig

4. 使用示例

一自由度的运动规划

import ruckig
import numpy as np
import matplotlib.pyplot as plt# 维度
DOFs = 1  # 1自由度示例# 创建 Ruckig 实例
otg = ruckig.Ruckig(DOFs, 0.01)  # 时间步长为 0.01 秒# 输入和输出参数
input = ruckig.InputParameter(DOFs)
output = ruckig.OutputParameter(DOFs)# 设置初始状态
input.current_position = [0.0]
input.current_velocity = [0.0]
input.current_acceleration = [0.0]# 设置目标状态
input.target_position = [1.0]
input.target_velocity = [0.0]
input.target_acceleration = [0.0]# 设置最大速度、加速度和加加速度
input.max_velocity = [1.0]
input.max_acceleration = [1.0]
input.max_jerk = [1.0]# 用于存储轨迹数据
positions = []
velocities = []
accelerations = []
jerks = []# 计算轨迹
while True:result = otg.update(input, output)if result == ruckig.Result.Finished:break# 存储当前状态positions.append(output.new_position.copy())velocities.append(output.new_velocity.copy())accelerations.append(output.new_acceleration.copy())# 计算并存储加加速度(jerk)if len(accelerations) > 1:jerk = (accelerations[-1][0] - accelerations[-2][0]) / 0.01else:jerk = 0.0jerks.append(jerk)# 更新输入参数input.current_position = output.new_positioninput.current_velocity = output.new_velocityinput.current_acceleration = output.new_acceleration# 转换为 NumPy 数组
positions = np.array(positions)
velocities = np.array(velocities)
accelerations = np.array(accelerations)
jerks = np.array(jerks)# 绘制轨迹图
time_steps = np.arange(positions.shape[0]) * 0.01fig, axs = plt.subplots(4, 1, figsize=(10, 10))axs[0].plot(time_steps, positions, label='Position')
axs[1].plot(time_steps, velocities, label='Velocity')
axs[2].plot(time_steps, accelerations, label='Acceleration')
axs[3].plot(time_steps, jerks, label='Jerk')axs[0].set_title('Position')
axs[1].set_title('Velocity')
axs[2].set_title('Acceleration')
axs[3].set_title('Jerk')for ax in axs:ax.set_xlabel('Time [s]')ax.legend()ax.grid()plt.tight_layout()
plt.show()

在这里插入图片描述

七自由度的运动规划

import ruckig
import numpy as np
import matplotlib.pyplot as plt# 维度
DOFs = 7  # 7自由度机械臂# 创建 Ruckig 实例
otg = ruckig.Ruckig(DOFs, 0.01)  # 时间步长为 0.01 秒# 输入和输出参数
input = ruckig.InputParameter(DOFs)
output = ruckig.OutputParameter(DOFs)# 设置初始状态
input.current_position = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
input.current_velocity = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
input.current_acceleration = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]# 设置目标状态(假设已通过逆运动学计算得到)
input.target_position = [1.0, 0.5, 0.25, 0.0, -1.0, -0.5, -0.25]
input.target_velocity = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
input.target_acceleration = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]# 设置最大速度、加速度和加加速度
input.max_velocity = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
input.max_acceleration = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
input.max_jerk = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]# 用于存储轨迹数据
positions = []
velocities = []
accelerations = []# 计算轨迹
while True:result = otg.update(input, output)if result == ruckig.Result.Finished:break# 存储当前状态positions.append(output.new_position.copy())velocities.append(output.new_velocity.copy())accelerations.append(output.new_acceleration.copy())# 更新输入参数input.current_position = output.new_positioninput.current_velocity = output.new_velocityinput.current_acceleration = output.new_acceleration# 转换为 NumPy 数组
positions = np.array(positions)
velocities = np.array(velocities)
accelerations = np.array(accelerations)# 绘制轨迹图
time_steps = np.arange(positions.shape[0]) * 0.01fig, axs = plt.subplots(3, 1, figsize=(10, 8))for i in range(DOFs):axs[0].plot(time_steps, positions[:, i], label=f'Joint {i+1}')axs[1].plot(time_steps, velocities[:, i], label=f'Joint {i+1}')axs[2].plot(time_steps, accelerations[:, i], label=f'Joint {i+1}')axs[0].set_title('Position')
axs[1].set_title('Velocity')
axs[2].set_title('Acceleration')for ax in axs:ax.set_xlabel('Time [s]')ax.legend()ax.grid()plt.tight_layout()
plt.show()

ruckig

http://www.dtcms.com/a/505879.html

相关文章:

  • 徐州网站设计师在线网站备份
  • 网站的类型有哪些wordpress文章图片不显示
  • 上海大金空调网站建设十大免费视频素材网
  • 织梦模板网萍乡网站seo
  • 广州网站建设找哪里成都网络运营外包
  • 网站建设方法叁金手指下拉丶浙江沉船事故最新消息
  • 泉州建站模板源码个人备案网站可以做电商吗
  • 滨江区建设局网站重庆怎样建设网站
  • 网站开发盈亏平衡分析表做网站去什么公司
  • 全球前10网站开发语言广东手机网站制作电话
  • 做网站网页挣钱不五八同城招聘网找工作
  • 网站做加QQ群链接wordpress 首页文章数量
  • 杭州网站制作方法成都设计公司提成
  • 注册域名以后怎么做网站wordpress 稳定版
  • 郑州做网站费用百度网站权重排名
  • 企业资产管理系统软件合肥网络公司seo建站
  • 中英文网站用同域名网站数据库是干什么的
  • 无锡企业建站程序wordpress 搜索框鼠标点击无效_需要按键盘回车
  • 江西天亿建设有限公司网站儿童编程培训机构
  • 外贸网站 开源长沙百度关键词搜索
  • 携程特牌 的同时做别的网站优化设计答案
  • 网站底部固定代码免费做店招的网站
  • 响应式网站建设服务广告公司名字大全简单
  • 找哪里做网站基本网站怎么做
  • python网站开发学习网站seo设置是什么
  • 怎样建设网站教程上海设计公司电话
  • 网站开发需要什么基础只是做石膏选图形的网站
  • 深圳罗湖住房和建设局网站wordpress时钟插件
  • 西安做网站哪家便宜建设西安网站
  • 手机参数查询网站手机网页版微信登录入口