CN114986524A - Robotic arm trajectory planning method, device and electronic device based on brain-computer interface - Google Patents
Robotic arm trajectory planning method, device and electronic device based on brain-computer interface Download PDFInfo
- Publication number
- CN114986524A CN114986524A CN202210941922.7A CN202210941922A CN114986524A CN 114986524 A CN114986524 A CN 114986524A CN 202210941922 A CN202210941922 A CN 202210941922A CN 114986524 A CN114986524 A CN 114986524A
- Authority
- CN
- China
- Prior art keywords
- mechanical arm
- dimensional
- configuration list
- acquiring
- dimensional point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000002513 implantation Methods 0.000 claims abstract description 42
- 238000001514 detection method Methods 0.000 claims abstract description 33
- 238000004590 computer program Methods 0.000 claims description 10
- 238000003860 storage Methods 0.000 claims description 7
- 238000013486 operation strategy Methods 0.000 claims description 6
- 238000012216 screening Methods 0.000 claims description 3
- 239000007943 implant Substances 0.000 abstract description 14
- 238000010586 diagram Methods 0.000 description 18
- 238000004422 calculation algorithm Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 5
- 238000010276 construction Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 210000004556 brain Anatomy 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000003321 amplification Effects 0.000 description 1
- 210000003710 cerebral cortex Anatomy 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1656—Programme controls characterised by programming, planning systems for manipulators
- B25J9/1664—Programme controls characterised by programming, planning systems for manipulators characterised by motion, path, trajectory planning
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1602—Programme controls characterised by the control system, structure, architecture
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1602—Programme controls characterised by the control system, structure, architecture
- B25J9/161—Hardware, e.g. neural networks, fuzzy logic, interfaces, processor
Landscapes
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Robotics (AREA)
- Mechanical Engineering (AREA)
- Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
Abstract
本发明提供一种基于脑机接口的机械臂轨迹规划方法、装置以及电子设备,涉及机器人技术领域,所述方法包括:获取第一配置列表;基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据;将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对第二配置列表中的所有三维点的目标访问顺序;基于第二配置列表和目标访问顺序,获取机械臂在三维头部区域中运动形成的模拟植入轨迹,模拟植入轨迹用于将脑机接口植入至三维头部区域,解决了无法快速安全地获取机械臂在高度杂乱的三维头部区域中运动所形成的模拟植入轨迹。
The invention provides a method, device and electronic device for trajectory planning of a robotic arm based on a brain-computer interface, and relates to the field of robotics. The method includes: acquiring a first configuration list; performing collision detection based on a three-dimensional head area and the first configuration list , and delete the 3D point in the first configuration list where the robot collides with the 3D head area and the robot arm joint angle data corresponding to the 3D point based on the collision detection result; take the deleted first configuration list as the second configuration list, and obtain the target access sequence of the robotic arm to all 3D points in the second configuration list; based on the second configuration list and the target access sequence, obtain the simulated implantation trajectory formed by the movement of the robotic arm in the 3D head area, and simulate the implantation trajectory It is used to implant the brain-computer interface into the three-dimensional head area, which solves the problem that the simulated implantation trajectory formed by the movement of the robotic arm in the highly cluttered three-dimensional head area cannot be quickly and safely obtained.
Description
技术领域technical field
本发明涉及机器人技术领域,尤其涉及一种基于脑机接口的机械臂轨迹规划方法、装置以及电子设备。The invention relates to the field of robotics technology, and in particular, to a method, device and electronic device for trajectory planning of a robotic arm based on a brain-computer interface.
背景技术Background technique
脑机接口(brain-computer interface,BCI)指在人或动物大脑与外部设备之间创建的直接连接,实现脑与设备的信息交换。脑机接口通过信号采集设备从大脑皮层采集脑电信号,并将脑电信号经过放大、滤波、A/D转换等操作转换为可以被计算机识别的目标信号,然后对目标信号进行预处理,并从预处理后的目标信号中提取特征信号,再利用特征信号进行模式识别,实现脑与设备之间的信息交互。Brain-computer interface (BCI) refers to the direct connection created between the human or animal brain and external devices to realize the exchange of information between the brain and the device. The brain-computer interface collects EEG signals from the cerebral cortex through signal acquisition equipment, and converts the EEG signals into target signals that can be recognized by the computer through operations such as amplification, filtering, and A/D conversion, and then preprocesses the target signals. The feature signal is extracted from the preprocessed target signal, and then the feature signal is used for pattern recognition to realize the information interaction between the brain and the device.
在现有技术中,由于头部区域为高度杂乱的三维环境,因此机械臂在将脑机接口植入到三维头部区域的过程中,容易与三维头部区域发生碰撞,这不仅会增加植入的作业时间,还会造成诸多的生产安全问题,从而使得无法快速安全地获取机械臂在高度杂乱的三维头部区域中运动所形成的模拟植入轨迹,进而基于模拟植入轨迹将脑机接口植入到三维头部区域。In the prior art, because the head area is a highly cluttered three-dimensional environment, the robotic arm is prone to collide with the three-dimensional head area during the process of implanting the brain-computer interface into the three-dimensional head area, which not only increases the number of implants It will also cause many production safety problems, making it impossible to quickly and safely obtain the simulated implantation trajectory formed by the movement of the robotic arm in the highly cluttered three-dimensional head area, and then based on the simulated implantation trajectory The interface is implanted into the three-dimensional head region.
因此,现有技术中无法快速安全地获取机械臂在高度杂乱的三维头部区域中运动所形成的模拟植入轨迹,进而基于模拟植入轨迹将脑机接口植入到三维头部区域的技术问题,相关领域技术人员尚无有效解决方法。Therefore, in the prior art, the simulated implantation trajectory formed by the movement of the robotic arm in the highly cluttered 3D head region cannot be quickly and safely obtained, and then the technology of implanting the brain-computer interface into the 3D head region based on the simulated implantation trajectory There is no effective solution to the problem for those skilled in the related art.
发明内容SUMMARY OF THE INVENTION
本发明提供一种基于脑机接口的机械臂轨迹规划方法、装置以及电子设备,用以解决现有技术中无法快速安全地获取机械臂在高度杂乱的三维头部区域中运动所形成的模拟植入轨迹,进而基于模拟植入轨迹将脑机接口植入到三维头部区域的技术问题,提高脑机接口的植入效率以及安全性,避免造成诸多的生产安全问题。The present invention provides a method, device and electronic device for trajectory planning of a robotic arm based on a brain-computer interface, which are used to solve the problem of the inability to quickly and safely obtain the simulated implant formed by the movement of a robotic arm in a highly cluttered three-dimensional head region in the prior art. Then, based on the technical problem of implanting the brain-computer interface into the three-dimensional head area based on the simulated implantation trajectory, the implantation efficiency and safety of the brain-computer interface are improved, and many production safety problems are avoided.
本发明提供一种基于脑机接口的机械臂轨迹规划方法,包括:获取第一配置列表,所述第一配置列表包括三维头部区域中的每一个三维点以及机械臂在所述三维头部区域中的每一个三维点处的机械臂关节转角数据;基于所述三维头部区域和所述第一配置列表进行碰撞检测,并基于碰撞检测结果删除所述第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据;将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对所述第二配置列表中的所有三维点的目标访问顺序;基于所述第二配置列表和所述目标访问顺序,获取机械臂在所述三维头部区域中运动形成的模拟植入轨迹,所述模拟植入轨迹用于将脑机接口植入至三维头部区域。The present invention provides a method for planning a trajectory of a robotic arm based on a brain-computer interface, comprising: acquiring a first configuration list, where the first configuration list includes each three-dimensional point in a three-dimensional head area and the position of the robotic arm in the three-dimensional head area. The joint angle data of the manipulator at each three-dimensional point in the area; perform collision detection based on the three-dimensional head area and the first configuration list, and delete the manipulator and the three-dimensional manipulator in the first configuration list based on the collision detection result The 3D points that collide in the head area and the joint angle data of the robot arm corresponding to the 3D points; take the deleted first configuration list as the second configuration list, and obtain all the 3D points of the robot arm in the second configuration list The target access sequence of Implanted into the 3D head region.
根据本发明提供的一种基于脑机接口的机械臂轨迹规划方法,所述获取第一配置列表包括:获取机械臂在三维头部区域中的每一个三维点处的机械臂位姿数据,所述机械臂位姿数据包括机械臂的三维坐标值以及坐标轴旋转角;基于运动学逆解运算策略将所述机械臂位姿数据转换为所述机械臂关节转角数据,所述机械臂关节转角数据包括多个机械臂关节以及每一个机械臂关节的转角;基于三维头部区域中的每一个三维点以及每一个三维点对应的机械臂关节转角数据,得到所述第一配置列表。According to a method for planning a trajectory of a manipulator based on a brain-computer interface provided by the present invention, the acquiring the first configuration list includes: acquiring pose data of the manipulator at each three-dimensional point in the three-dimensional head region of the manipulator, so The manipulator pose data includes the three-dimensional coordinate value of the manipulator and the rotation angle of the coordinate axis; the manipulator pose data is converted into the manipulator joint angle data based on the kinematic inverse solution operation strategy, and the manipulator joint angle The data includes a plurality of manipulator joints and the rotation angle of each manipulator joint; the first configuration list is obtained based on each three-dimensional point in the three-dimensional head region and the manipulator joint angle data corresponding to each three-dimensional point.
根据本发明提供的一种基于脑机接口的机械臂轨迹规划方法,所述基于所述三维头部区域和所述第一配置列表进行碰撞检测,并基于碰撞检测结果删除所述第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据,包括:获取机械臂在所述第一配置列表中的每一个三维点处对应的第一包围盒以及所述三维头部区域对应的第二包围盒;针对每一所述第一包围盒,判断所述第一包围盒是否与所述第二包围盒相交;在所述第一包围盒与所述第二包围盒相交的情况下,判断机械臂在所述第一包围盒对应的三维点处是否与所述三维头部区域相交;在机械臂在所述第一包围盒对应的三维点处与所述三维头部区域相交的情况下,在所述第一配置列表中删除所述三维点及其对应的机械臂关节转角数据。According to a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention, the collision detection is performed based on the three-dimensional head region and the first configuration list, and the first configuration list is deleted based on the collision detection result. The 3D points where the robot arm collides with the 3D head area and the joint angle data of the robot arm corresponding to the 3D points include: obtaining the first bounding box of the robot arm corresponding to each 3D point in the first configuration list, and a second bounding box corresponding to the three-dimensional head area; for each of the first bounding boxes, determine whether the first bounding box intersects the second bounding box; When the second bounding box intersects, determine whether the robotic arm intersects the three-dimensional head area at the three-dimensional point corresponding to the first bounding box; When the three-dimensional head regions intersect, the three-dimensional point and its corresponding mechanical arm joint rotation angle data are deleted from the first configuration list.
根据本发明提供的一种基于脑机接口的机械臂轨迹规划方法,所述获取机械臂在所述第一配置列表中的每一个三维点处对应的第一包围盒以及所述三维头部区域对应的第二包围盒,包括:获取机械臂在所述第一配置列表中的每一个三维点处的机械臂坐标极值数据,所述机械臂坐标极值数据包括机械臂的多个机械臂关节以及每一个机械臂关节的坐标极值数据;基于所述机械臂坐标极值数据获取机械臂中的每一个机械臂关节在所述第一配置列表中的每一个三维点处对应的第一包围盒;获取所述三维头部区域的区域坐标极值数据,并基于所述区域坐标极值数据获取所述三维头部区域对应的第二包围盒。According to a method for trajectory planning of a robotic arm based on a brain-computer interface provided by the present invention, the acquisition of the first bounding box corresponding to each three-dimensional point of the robotic arm at each three-dimensional point in the first configuration list and the three-dimensional head region The corresponding second bounding box includes: obtaining the coordinate extreme value data of the manipulator at each three-dimensional point in the first configuration list, where the coordinate extreme value data of the manipulator includes a plurality of manipulator arms of the manipulator. The coordinate extreme value data of the joint and each manipulator joint; the first coordinate corresponding to each manipulator joint in the manipulator at each three-dimensional point in the first configuration list is obtained based on the coordinate extreme value data of the manipulator A bounding box; obtaining the regional coordinate extreme value data of the three-dimensional head region, and obtaining a second bounding box corresponding to the three-dimensional head region based on the regional coordinate extreme value data.
根据本发明提供的一种基于脑机接口的机械臂轨迹规划方法,所述获取机械臂对所述第二配置列表中的所有三维点的目标访问顺序,包括:获取当前迭代计数以及机械臂对所述第二配置列表中的所有三维点的当前访问顺序;基于所述当前访问顺序和所述第二配置列表中每一个三维点的三维坐标,获取所述当前访问顺序对应的当前访问路径;获取所述当前访问顺序中任意两个不相邻的三维点之间的局部访问顺序,并对所述当前访问顺序中的局部访问顺序进行翻转处理得到第一访问顺序;基于所示第一访问顺序和所述第二配置列表中每一个三维点的三维坐标,获取所述第一访问顺序对应的第一访问路径;基于所述当前访问路径和所述第一访问路径,更新所述当前访问顺序和所述当前迭代计数;将更新后的当前访问顺序作为新的当前访问顺序,将更新后的当前迭代计数作为新的当前迭代计数;重复执行上述步骤,直至所述当前迭代计数达到最大迭代次数,将最终得到的当前访问顺序作为所述目标访问顺序。According to a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention, the acquiring the target access sequence of the robotic arm to all the three-dimensional points in the second configuration list includes: acquiring the current iteration count and the the current access order of all three-dimensional points in the second configuration list; based on the current access order and the three-dimensional coordinates of each three-dimensional point in the second configuration list, obtain the current access path corresponding to the current access order; Obtain the local access sequence between any two non-adjacent three-dimensional points in the current access sequence, and perform inversion processing on the local access sequence in the current access sequence to obtain a first access sequence; order and the three-dimensional coordinates of each three-dimensional point in the second configuration list, obtain the first access path corresponding to the first access sequence; update the current access path based on the current access path and the first access path sequence and the current iteration count; take the updated current access sequence as the new current access sequence, and use the updated current iteration count as the new current iteration count; repeat the above steps until the current iteration count reaches the maximum iteration count number of times, and the final current access sequence is taken as the target access sequence.
根据本发明提供的一种基于脑机接口的机械臂轨迹规划方法,所述基于所述第二配置列表和所述目标访问顺序,获取机械臂在所述三维头部区域中运动形成的模拟植入轨迹,包括:基于所述目标访问顺序和所述第二配置列表构建三维点级联图;所述三维点级联图包括多个级联的三维点层以及每一个三维点层对应的多个顶点,其中,每一个三维点层对应一个三维点,多个顶点表示三维点对应的多组机械臂关节转角数据;遍历所述三维点级联图中的每一个三维点层,在相邻两个三维点层中各选取一个顶点,并基于选取的两个顶点获取机械臂在所述相邻两个三维点层之间移动的移动路径以及移动成本;重复执行上一个步骤,直至遍历所述三维点级联图中的所有顶点,获取最终得到所有移动路径和所述移动成本;遍历所述三维点级联图中的每一个三维点层,基于所述移动成本从相邻两个三维点层对应的多个移动路径中筛选出目标移动路径,得到多个目标移动路径;基于多个目标移动路径和所述第二配置列表获取目标配置列表,并基于所述目标配置列表获取机械臂在三维头部区域中形成的模拟植入轨迹。According to a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention, the simulated implant formed by the movement of the robotic arm in the three-dimensional head region is obtained based on the second configuration list and the target access sequence. entering the trajectory, including: constructing a 3D point cascade diagram based on the target access sequence and the second configuration list; the 3D point cascade diagram includes a plurality of cascaded 3D point layers and multiple 3D point layers corresponding to each 3D point layer. vertices, where each 3D point layer corresponds to a 3D point, and multiple vertices represent multiple sets of mechanical arm joint angle data corresponding to the 3D point; traverse each 3D point layer in the 3D point cascade diagram, in the adjacent One vertex is selected from each of the two 3D point layers, and based on the selected two vertices, the movement path and movement cost of the robotic arm moving between the two adjacent 3D point layers are obtained; All vertices in the three-dimensional point cascade graph, and finally obtain all the moving paths and the moving cost; traverse each three-dimensional point layer in the three-dimensional point cascade graph, based on the moving cost from two adjacent three-dimensional points Screening out target movement paths from the multiple movement paths corresponding to the point layer to obtain multiple target movement paths; obtaining a target configuration list based on the multiple target movement paths and the second configuration list, and obtaining a robotic arm based on the target configuration list A simulated implant trajectory formed in the 3D head region.
根据本发明提供的一种基于脑机接口的机械臂轨迹规划方法,所述基于选取的两个顶点获取机械臂在所述相邻两个三维点层之间移动的移动路径以及移动成本,包括:获取选取的两个顶点所对应的机械臂关节转角数据以及机械臂关节的最大转角角速度;基于两个顶点所对应的机械臂关节转角数据获取机械臂关节转角差值,并基于所述机械臂关节转角差值和所述最大转角角速度获取最大关节转角时间;基于两个顶点所对应的机械臂关节转角数据获取机械臂关节的转角符号切换成本;基于所述转角符号切换成本和预设额外成本系数,获取机械臂在所述相邻两个三维点层之间移动的额外成本;基于所述最大关节转角时间和所述额外成本,获取机械臂在所述相邻两个三维点层之间移动的移动成本。According to a method for planning the trajectory of a robotic arm based on a brain-computer interface provided by the present invention, the moving path and the moving cost of the robotic arm moving between the two adjacent three-dimensional point layers are obtained based on the two selected vertices, including: : Obtain the manipulator joint angle data corresponding to the two selected vertices and the maximum angle angular velocity of the manipulator joint; obtain the manipulator joint angle difference based on the manipulator joint angle data corresponding to the two vertices, and based on the manipulator arm Obtain the maximum joint corner time based on the joint corner difference and the maximum corner angular velocity; obtain the corner symbol switching cost of the manipulator joint based on the manipulator joint corner data corresponding to the two vertices; based on the corner symbol switching cost and the preset additional cost coefficient, to obtain the extra cost of the manipulator moving between the two adjacent three-dimensional point layers; based on the maximum joint rotation time and the extra cost, to obtain the manipulator arm to move between the two adjacent three-dimensional point layers Mobile cost of moving.
本发明还提供一种基于脑机接口的机械臂轨迹规划装置,包括:配置获取模块,用于获取第一配置列表,所述第一配置列表包括三维头部区域中的每一个三维点以及机械臂在所述三维头部区域中的每一个三维点处的机械臂关节转角数据;碰撞检测模块,用于基于所述三维头部区域和所述第一配置列表进行碰撞检测,并基于碰撞检测结果删除所述第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据;顺序确定模块,用于将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对所述第二配置列表中的所有三维点的目标访问顺序;轨迹生成模块,用于基于所述第二配置列表和所述目标访问顺序,获取机械臂在所述三维头部区域中运动形成的模拟植入轨迹,所述模拟植入轨迹用于将脑机接口植入至三维头部区域。The present invention also provides a robotic arm trajectory planning device based on a brain-computer interface, comprising: a configuration acquisition module for acquiring a first configuration list, where the first configuration list includes each three-dimensional point in the three-dimensional head region and the mechanical Robotic arm joint angle data at each 3D point of the arm in the 3D head area; a collision detection module for performing collision detection based on the 3D head area and the first configuration list, and based on the collision detection As a result, delete the 3D point in the first configuration list where the robot arm collides with the 3D head area and the robot arm joint rotation angle data corresponding to the 3D point; the sequence determination module is used to use the deleted first configuration list as the second configuration list. a configuration list, and obtain the target access order of the robotic arm to all the three-dimensional points in the second configuration list; the trajectory generation module is configured to obtain the robot arm in the second configuration list and the target access order based on the second configuration list. A simulated implant trajectory formed by motion in a three-dimensional head region, the simulated implant trajectory being used to implant a brain-computer interface into the three-dimensional head region.
本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述基于脑机接口的机械臂轨迹规划方法。The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, when the processor executes the program, the brain-computer-based computer program described in any of the above-mentioned processes is implemented by the processor. Interface for manipulator trajectory planning method.
本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述基于脑机接口的机械臂轨迹规划方法。The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements any of the above-mentioned brain-computer interface-based robotic arm trajectory planning methods.
本发明提供的基于脑机接口的机械臂轨迹规划方法、装置以及电子设备,通过基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据,以避免机械臂在将脑机接口植入到三维头部区域的过程中与三维头部区域发生碰撞,提高脑机接口的植入效率以及安全性,避免造成诸多的生产安全问题;通过基于第二配置列表设置更加合理的目标访问顺序,可以提高机械臂对三维头部区域中的多个三维点的访问效率,进而可以提高机械臂将脑机接口植入至三维头部区域中的多个三维点的植入效率,解决了现有技术中无法快速安全地获取机械臂在高度杂乱的三维头部区域中运动所形成的模拟植入轨迹,进而基于模拟植入轨迹将脑机接口植入到三维头部区域的技术问题。The brain-computer interface-based robotic arm trajectory planning method, device, and electronic device provided by the present invention perform collision detection based on the three-dimensional head area and the first configuration list, and delete the robotic arm and the three-dimensional robotic arm in the first configuration list based on the collision detection result. There are collision 3D points in the head area and the joint angle data of the robot arm corresponding to the 3D points, so as to avoid the collision between the robot arm and the 3D head area during the process of implanting the brain-computer interface into the 3D head area, and improve the brain-computer interface. It can improve the implantation efficiency and safety of the robot, and avoid many production safety problems; by setting a more reasonable target access order based on the second configuration list, the access efficiency of the robot arm to multiple 3D points in the 3D head area can be improved, and then It can improve the implantation efficiency of the robot arm to implant the brain-computer interface into multiple 3D points in the 3D head area, and solve the problem that the movement of the robot arm in the highly cluttered 3D head area cannot be quickly and safely obtained in the existing technology. The simulated implantation trajectory formed, and then the technical problem of implanting the brain-computer interface into the three-dimensional head region based on the simulated implantation trajectory.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之一;1 is one of the schematic flow charts of the method for planning the trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图2是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之二;2 is the second schematic flowchart of the method for planning the trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图3是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之三;3 is a third schematic flowchart of a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图4是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之四;4 is a fourth schematic flowchart of a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图5是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之五;5 is a fifth schematic flowchart of a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图6是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之六;6 is a sixth schematic flowchart of a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图7是本发明具体实施例中三维点级联图的结构示意图;7 is a schematic structural diagram of a three-dimensional point cascade diagram in a specific embodiment of the present invention;
图8是本发明提供的基于脑机接口的机械臂轨迹规划方法的流程示意图之七;8 is a seventh schematic flowchart of a method for planning a trajectory of a robotic arm based on a brain-computer interface provided by the present invention;
图9是本发明提供的脑机接口的机械臂轨迹规划装置的结构示意图;9 is a schematic structural diagram of a robotic arm trajectory planning device of a brain-computer interface provided by the present invention;
图10是本发明提供的电子设备的结构示意图。FIG. 10 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
下面结合图1-图7描述本发明的基于脑机接口的机械臂轨迹规划方法。如图1所示,本发明提供一种基于脑机接口的机械臂轨迹规划方法,包括:The following describes the method for planning a trajectory of a robotic arm based on a brain-computer interface of the present invention with reference to FIGS. 1 to 7 . As shown in FIG. 1 , the present invention provides a method for planning a trajectory of a robotic arm based on a brain-computer interface, including:
步骤S1,获取第一配置列表,第一配置列表包括三维头部区域中的每一个三维点以及机械臂在三维头部区域中的每一个三维点处的机械臂关节转角数据。Step S1: Obtain a first configuration list, where the first configuration list includes each 3D point in the 3D head area and the manipulator arm joint angle data at each 3D point in the 3D head area.
步骤S2,基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据。Step S2: Perform collision detection based on the 3D head area and the first configuration list, and delete the 3D points where the robot collides with the 3D head area and the robot arm joint angle data corresponding to the 3D points in the first configuration list based on the collision detection result .
步骤S3,将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对第二配置列表中的所有三维点的目标访问顺序。In step S3, the deleted first configuration list is used as the second configuration list, and the target access sequence of the robotic arm to all the three-dimensional points in the second configuration list is acquired.
步骤S4,基于第二配置列表和目标访问顺序,获取机械臂在三维头部区域中运动形成的模拟植入轨迹,模拟植入轨迹用于将脑机接口植入至三维头部区域。Step S4, based on the second configuration list and the target access sequence, obtain a simulated implantation trajectory formed by the movement of the robotic arm in the 3D head area, and the simulated implantation trajectory is used to implant the brain-computer interface into the 3D head area.
其中,模拟植入轨迹表示基于第二配置列表和目标访问顺序模拟出的机械臂在三维头部区域中运动所形成的运动轨迹。The simulated implantation trajectory represents a motion trajectory formed by the simulated robotic arm moving in the three-dimensional head region based on the second configuration list and the target access sequence.
进一步地,基于模拟植入轨迹控制机械臂依次将脑机接口植入至模拟植入轨迹中机械臂与三维头部区域无碰撞的每一个三维点,以实现将脑机接口植入至三维头部区域中的指定头部位置。Further, based on the simulated implantation trajectory, the robotic arm is controlled to implant the brain-computer interface into each 3D point in the simulated implantation trajectory where the robotic arm does not collide with the three-dimensional head area, so as to realize the implantation of the brain-computer interface into the three-dimensional head. The specified head position in the head area.
上述步骤S1至步骤S4,通过基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据,以避免机械臂在将脑机接口植入到三维头部区域的过程中与三维头部区域发生碰撞,提高脑机接口的植入效率以及安全性,避免造成诸多的生产安全问题;通过基于第二配置列表设置更加合理的目标访问顺序,可以提高机械臂对三维头部区域中的多个三维点的访问效率,进而可以提高机械臂将脑机接口植入至三维头部区域中的多个三维点的植入效率,解决了现有技术中无法快速安全地获取机械臂在高度杂乱的三维头部区域中运动所形成的模拟植入轨迹,进而基于模拟植入轨迹将脑机接口植入到三维头部区域的技术问题。From the above steps S1 to S4, the collision detection is performed based on the three-dimensional head area and the first configuration list, and based on the collision detection result, the three-dimensional points where the robotic arm collides with the three-dimensional head area and the corresponding three-dimensional points in the first configuration list are deleted. The joint angle data of the robotic arm can avoid the collision between the robotic arm and the three-dimensional head area during the process of implanting the brain-computer interface into the three-dimensional head area, improve the implantation efficiency and safety of the brain-computer interface, and avoid causing a lot of production. Security issue; by setting a more reasonable target access order based on the second configuration list, the access efficiency of the robotic arm to multiple 3D points in the 3D head area can be improved, and the implantation of the brain-computer interface into the 3D head area by the robotic arm can be improved. The implantation efficiency of multiple 3D points in the head area solves the problem that the simulated implantation trajectory formed by the movement of the robotic arm in the highly cluttered 3D head area cannot be quickly and safely obtained in the prior art. Technical issues of implanting a brain-computer interface into the three-dimensional head region.
在一个实施例中,如图2所示,上述步骤S1包括步骤S11至步骤S13,其中:In one embodiment, as shown in FIG. 2 , the above step S1 includes steps S11 to S13, wherein:
步骤S11,获取机械臂在三维头部区域中的每一个三维点处的机械臂位姿数据,机械臂位姿数据包括机械臂的三维坐标值以及坐标轴旋转角。Step S11 , acquiring the robot arm pose data at each three-dimensional point in the three-dimensional head region of the robot arm, where the robot arm pose data includes the three-dimensional coordinate value of the robot arm and the rotation angle of the coordinate axis.
其中,三维坐标值包括x坐标、y坐标和z坐标。坐标轴旋转角包括x轴旋转角、y轴旋转角和z轴旋转角。其中,x轴旋转角表示围绕x轴进行旋转的旋转角。y轴旋转角表示围绕y轴进行旋转的旋转角。z轴旋转角表示围绕z轴进行旋转的旋转角。Wherein, the three-dimensional coordinate value includes x coordinate, y coordinate and z coordinate. The coordinate axis rotation angle includes an x-axis rotation angle, a y-axis rotation angle, and a z-axis rotation angle. The x-axis rotation angle represents the rotation angle around the x-axis. The y-axis rotation angle represents the rotation angle of the rotation around the y-axis. The z-axis rotation angle represents the rotation angle of the rotation around the z-axis.
步骤S12,基于运动学逆解运算策略将机械臂位姿数据转换为机械臂关节转角数据,机械臂关节转角数据包括多个机械臂关节以及每一个机械臂关节的转角。Step S12 , based on the kinematic inverse solution operation strategy, the robot arm pose data is converted into the robot arm joint rotation angle data, and the robot arm joint rotation angle data includes a plurality of robot arm joints and the rotation angle of each robot arm joint.
可选地,机械臂关节转角数据包括六个机械臂关节以及每一个机械臂关节的转角。Optionally, the manipulator joint rotation angle data includes six manipulator joints and the rotation angle of each manipulator joint.
需要说明的是,将机械臂位姿数据转换为机械臂关节转角数据的过程可以称为求解机械臂的逆运动学。运动学逆解运算策略(即机械臂的逆运动学的求解方法)包括但不仅限于解析法、几何投影法以及解析法与几何投影法的结合。其中,解析法包括采用预先构建的运动学逆解计算模型将机械臂位姿数据转换为机械臂关节转角数据的方法。It should be noted that the process of converting the pose data of the manipulator into the joint angle data of the manipulator can be called solving the inverse kinematics of the manipulator. The kinematic inverse solution operation strategy (that is, the solution method of the inverse kinematics of the manipulator) includes but is not limited to the analytical method, the geometric projection method, and the combination of the analytical method and the geometric projection method. Among them, the analytical method includes a method of converting the pose data of the manipulator into the data of the joint angle of the manipulator by using a pre-built kinematic inverse solution calculation model.
步骤S13,基于三维头部区域中的每一个三维点以及每一个三维点对应的机械臂关节转角数据,得到第一配置列表。Step S13, obtaining a first configuration list based on each 3D point in the 3D head area and the manipulator joint rotation angle data corresponding to each 3D point.
在一个实施例中,三个坐标轴旋转角中有一个坐标轴旋转角为变量,其取值范围不受限制。将该坐标轴旋转角赋值为一个预设值集,其中,预设值集为具有离散化步长的一组数值。In one embodiment, one of the three coordinate axis rotation angles is a variable whose value range is not limited. The coordinate axis rotation angle is assigned as a preset value set, wherein the preset value set is a set of values with a discretization step size.
需要说明的是,由于三个坐标轴旋转角中有一个坐标轴旋转角为变量,而在输入的机械臂位姿数据中存在变量时无法输出一个确定的机械臂关节转角数据,因此通过将上述坐标轴旋转角这一变量赋值为一个预设值集,既可以保证该坐标轴旋转角的数值在一定的范围内可以变化,也可以确保基于输入的机械臂位姿数据输出一个确定的机械臂关节转角数据。It should be noted that, since one of the three coordinate axis rotation angles is a variable, and there is a variable in the input manipulator pose data, a definite manipulator joint angle data cannot be output. The variable coordinate axis rotation angle is assigned as a preset value set, which can not only ensure that the value of the coordinate axis rotation angle can change within a certain range, but also ensure that a certain robot arm is output based on the input robot arm pose data Joint angle data.
在一个实施例中,由于其中一个坐标轴旋转角的取值在预设值集的范围内,即其取值为多个,每一个三维点对应的机械臂位姿数据为多组,由机械臂位姿数据转换得到的机械臂关节转角数据也为多组,此时,每一个三维点对应的多组机械臂关节转角数据可以由以下公式(1)表示:In one embodiment, since the value of the rotation angle of one of the coordinate axes is within the range of the preset value set, that is, it has multiple values, the pose data of the robotic arm corresponding to each three-dimensional point is multiple sets, which are determined by the mechanical The joint angle data of the manipulator obtained by the conversion of the arm pose data are also multiple sets. At this time, the multiple sets of manipulator joint angle data corresponding to each three-dimensional point can be expressed by the following formula (1):
其中,表示多组机械臂关节转角数据,表示第1组机械臂关节转角数据, 表示第2组机械臂关节转角数据,表示第j组机械臂关节转角数据,表示第m组机械臂 关节转角数据,m表示机械臂关节转角数据的个数。 in, Represents multiple sets of joint angle data of the manipulator, Indicates the joint angle data of the first group of manipulators, Indicates the joint angle data of the second group of manipulators, represents the joint angle data of the jth group of manipulators, Indicates the mth group of joint angle data of the manipulator, and m represents the number of manipulator joint angle data.
在机械臂关节转角数据包括六个机械臂关节以及每一个机械臂关节的转角的情况下,每一组机械臂关节转角数据可以由如下公式(2)表示:In the case that the joint angle data of the manipulator includes six manipulator joints and the angle of each manipulator joint, each group of manipulator joint angle data can be represented by the following formula (2):
其中,表示第j组机械臂关节转角数据,表示第1个机械臂关节的转角,表 示第2个机械臂关节的转角,表示第3个机械臂关节的转角,表示第4个机械臂关节的 转角,表示第5个机械臂关节的转角,表示第6个机械臂关节的转角。 in, represents the joint angle data of the jth group of manipulators, Indicates the rotation angle of the first robotic arm joint, Indicates the rotation angle of the second robotic arm joint, Indicates the rotation angle of the third robotic arm joint, Indicates the rotation angle of the fourth robotic arm joint, Indicates the rotation angle of the fifth robotic arm joint, Indicates the rotation angle of the sixth robotic arm joint.
优选地,基于2-Opt算法实现步骤S2中的碰撞检测过程,其中,2-opt为2-optimization的缩写。Preferably, the collision detection process in step S2 is implemented based on a 2-Opt algorithm, where 2-opt is an abbreviation for 2-optimization.
在一个实施例中,如图3所示,上述步骤S2包括步骤S21至步骤S24,其中:In one embodiment, as shown in FIG. 3 , the above step S2 includes steps S21 to S24, wherein:
步骤S21,获取机械臂在第一配置列表中的每一个三维点处对应的第一包围盒以及三维头部区域对应的第二包围盒。Step S21 , acquiring a first bounding box corresponding to each three-dimensional point of the manipulator in the first configuration list and a second bounding box corresponding to the three-dimensional head region.
其中,包围盒是一种求解离散点集最优包围空间的算法,基本思想是用体积稍大且特性简单的几何体(称为包围盒)来近似地代替复杂的几何对象。本实施例中的对象为机械臂和三维头部区域。Among them, the bounding box is an algorithm for solving the optimal bounding space of discrete point sets. The objects in this embodiment are the robotic arm and the three-dimensional head area.
步骤S22,针对每一第一包围盒,判断第一包围盒是否与第二包围盒相交。Step S22, for each first bounding box, determine whether the first bounding box intersects with the second bounding box.
步骤S23,在第一包围盒与第二包围盒相交的情况下,判断机械臂在第一包围盒对应的三维点处是否与三维头部区域相交。Step S23 , when the first bounding box intersects with the second bounding box, determine whether the robotic arm intersects the three-dimensional head region at the three-dimensional point corresponding to the first bounding box.
步骤S24,在机械臂在第一包围盒对应的三维点处与三维头部区域相交的情况下,在第一配置列表中删除三维点及其对应的机械臂关节转角数据。Step S24 , in the case that the manipulator intersects the three-dimensional head region at the three-dimensional point corresponding to the first bounding box, delete the three-dimensional point and its corresponding manipulator joint angle data in the first configuration list.
上述步骤S21至步骤S24,通过判断第一包围盒是否与第二包围盒相交,并在第一包围盒与第二包围盒相交的情况下,判断机械臂在第一包围盒对应的三维点处是否与三维头部区域相交,由于第一包围盒和第二包围盒的求交算法比三维点处的机械臂对象与三维头部区域对象的求交算法简单,因此采用这种方法可以快速排除不相交的对象,从而简化碰撞检测步骤以及加快了碰撞检测效率。In the above steps S21 to S24, by judging whether the first bounding box intersects with the second bounding box, and when the first bounding box intersects with the second bounding box, it is judged that the robotic arm is at the three-dimensional point corresponding to the first bounding box Whether it intersects with the 3D head area, because the intersection algorithm of the first bounding box and the second bounding box is simpler than the intersection algorithm of the manipulator object at the 3D point and the 3D head area object, this method can quickly rule out Disjoint objects, thereby simplifying the collision detection step and speeding up the collision detection efficiency.
在一个实施例中,如图4所示,上述步骤S21包括步骤S211至步骤S213,其中:In one embodiment, as shown in FIG. 4 , the above step S21 includes steps S211 to S213, wherein:
步骤S211,获取机械臂在第一配置列表中的每一个三维点处的机械臂坐标极值数据,机械臂坐标极值数据包括机械臂的多个机械臂关节以及每一个机械臂关节的坐标极值数据。Step S211, obtaining the coordinate extreme value data of the manipulator at each three-dimensional point of the manipulator in the first configuration list, where the coordinate extreme value data of the manipulator includes a plurality of manipulator joints of the manipulator and the coordinate pole of each manipulator joint. value data.
其中,坐标极值数据包括机械臂关节的x坐标极值、y坐标极值和z坐标极值。x坐标极值包括最大x坐标和最小x坐标。y坐标极值包括最大y坐标和最小y坐标。z坐标极值包括最大z坐标和最小z坐标。The coordinate extreme value data includes the x coordinate extreme value, the y coordinate extreme value, and the z coordinate extreme value of the manipulator joint. The x-coordinate extrema include the largest x-coordinate and the smallest x-coordinate. The y-coordinate extrema include the largest y-coordinate and the smallest y-coordinate. The z-coordinate extrema include the maximum z-coordinate and the minimum z-coordinate.
步骤S212,基于机械臂坐标极值数据获取机械臂中的每一个机械臂关节在第一配置列表中的每一个三维点处对应的第一包围盒。Step S212 , obtaining a first bounding box corresponding to each manipulator joint in the manipulator at each three-dimensional point in the first configuration list based on the coordinate extreme value data of the manipulator.
具体地,针对第一配置列表中的每一个三维点,在机械臂位于所述三维点处的情况下,基于机械臂中每一个机械臂关节的坐标极值数据获取每一个机械臂关节在所述三维点处对应的第一包围盒。Specifically, for each three-dimensional point in the first configuration list, in the case where the manipulator is located at the three-dimensional point, obtain the location where each manipulator joint is located based on the coordinate extreme value data of each manipulator joint in the manipulator. The first bounding box corresponding to the three-dimensional point.
步骤S213,获取三维头部区域的区域坐标极值数据,并基于区域坐标极值数据获取三维头部区域对应的第二包围盒。Step S213: Obtain the regional coordinate extreme value data of the three-dimensional head region, and obtain the second bounding box corresponding to the three-dimensional head region based on the regional coordinate extreme value data.
其中,区域坐标极值数据包括三维头部区域中点的x坐标极值、y坐标极值和z坐标极值。The area coordinate extreme value data includes the x coordinate extreme value, the y coordinate extreme value and the z coordinate extreme value of the midpoint of the three-dimensional head area.
在一个实施例中,第一包围盒和第二包围盒为轴对齐的包围盒(AABB),轴对齐的包围盒为包含对象的最小六面体,其边平行于轴。第一包围盒为包含机械臂关节的最小六面体。第二包围盒为包含三维头部区域的最小六面体。In one embodiment, the first bounding box and the second bounding box are axis-aligned bounding boxes (AABBs), which are the smallest hexahedron containing the object, with edges parallel to the axis. The first bounding box is the smallest hexahedron containing the joints of the manipulator. The second bounding box is the smallest hexahedron containing the three-dimensional head region.
通过上述实施例,采用轴对齐的包围盒构建第一包围盒和第二包围盒,由于轴对齐的包围盒只需要对象的六个基本几何元素即可完成包围盒构建,因此,一方面采用这种方法可以减少包围盒构建过程的计算量以及提高包围盒构建过程的计算效率,另一方面,也可以减少后续步骤中第一包围盒与第二包围盒的求交运算的计算量,提高包围盒求交运算的计算效率。Through the above embodiment, the first bounding box and the second bounding box are constructed by using the axis-aligned bounding box. Since the axis-aligned bounding box only needs six basic geometric elements of the object to complete the construction of the bounding box, on the one hand, this method is adopted. This method can reduce the calculation amount of the bounding box construction process and improve the calculation efficiency of the bounding box construction process. Computational efficiency of the box intersection operation.
在一个实施例中,上述步骤S22至步骤S24还包括:针对第一配置列表中的每一个三维点,在机械臂位于所述三维点处的情况下,判断机械臂中每一个机械臂关节在所述三维点处对应的第一包围盒是否与第二包围盒相交,在机械臂中任意一个机械臂关节在所述三维点处对应的第一包围盒与第二包围盒相交的情况下,判断在机械臂在所述三维点处是否与三维头部区域相交,在机械臂在所述三维点处与三维头部区域相交的情况下,在第一配置列表中删除所述三维点及其对应的机械臂关节转角数据。In one embodiment, the above-mentioned steps S22 to S24 further include: for each three-dimensional point in the first configuration list, when the manipulator is located at the three-dimensional point, judging that each manipulator joint in the manipulator is located at the three-dimensional point. Whether the first bounding box corresponding to the three-dimensional point intersects the second bounding box, in the case that the first bounding box corresponding to the three-dimensional point intersects with the second bounding box of any one of the manipulator joints in the robotic arm, Determine whether the robotic arm intersects the three-dimensional head area at the three-dimensional point, and in the case where the robotic arm intersects the three-dimensional head area at the three-dimensional point, delete the three-dimensional point and its Corresponding manipulator joint angle data.
在一个实施例中,如图5所示,上述步骤S3包括步骤S31至步骤S37,其中:In one embodiment, as shown in FIG. 5 , the above step S3 includes steps S31 to S37, wherein:
步骤S31,获取当前迭代计数以及机械臂对第二配置列表中的所有三维点的当前访问顺序。Step S31, obtaining the current iteration count and the current access sequence of the robotic arm to all the three-dimensional points in the second configuration list.
步骤S32,基于当前访问顺序和第二配置列表中每一个三维点的三维坐标,获取当前访问顺序对应的当前访问路径。Step S32, based on the current access sequence and the three-dimensional coordinates of each three-dimensional point in the second configuration list, obtain a current access path corresponding to the current access sequence.
步骤S33,获取当前访问顺序中任意两个不相邻的三维点之间的局部访问顺序,并对当前访问顺序中的局部访问顺序进行翻转处理得到第一访问顺序。Step S33: Acquire a local access sequence between any two non-adjacent three-dimensional points in the current access sequence, and perform inversion processing on the local access sequence in the current access sequence to obtain a first access sequence.
例如,当前访问顺序为(A,B,C,D,E,F,G),选取当前访问顺序中任意两个不相邻的三维点B和三维点E之间的局部访问顺序(B,C,D,E),对当前访问顺序中的局部访问顺序进行翻转处理,翻转处理后的当前访问顺序即为第一访问顺序(A,E,D,C,B,F,G)。For example, the current access sequence is (A, B, C, D, E, F, G), select the local access sequence between any two non-adjacent 3D points B and 3D points E in the current access sequence (B, C, D, E), invert the local access sequence in the current access sequence, and the current access sequence after inversion processing is the first access sequence (A, E, D, C, B, F, G).
步骤S34,基于所示第一访问顺序和第二配置列表中每一个三维点的三维坐标,获取第一访问顺序对应的第一访问路径。其中,三维坐标包括x坐标、y坐标和z坐标。Step S34, based on the first access sequence shown and the three-dimensional coordinates of each three-dimensional point in the second configuration list, obtain a first access path corresponding to the first access sequence. The three-dimensional coordinates include x-coordinates, y-coordinates and z-coordinates.
步骤S35,基于当前访问路径和第一访问路径,更新当前访问顺序和当前迭代计数。Step S35, based on the current access path and the first access path, update the current access sequence and the current iteration count.
在一个实施例中,获取当前访问路径和第一访问路径的路径长度并比较,在第一访问路径的路径长度小于当前访问路径的路径长度的情况下,将第一访问顺序作为更新后的当前访问顺序,并将当前迭代计数赋值为零。在第一访问路径的路径长度大于或者等于当前访问路径的路径长度的情况下,不更新当前访问顺序,对在当前迭代计数的基础上加数值1得到更新后的当前迭代计数。In one embodiment, the path lengths of the current access path and the first access path are obtained and compared, and in the case that the path length of the first access path is smaller than the path length of the current access path, the first access order is used as the updated current access path. access order, and assigns the current iteration count to zero. When the path length of the first access path is greater than or equal to the path length of the current access path, the current access sequence is not updated, and a value of 1 is added to the current iteration count to obtain the updated current iteration count.
进一步地,采用欧几里得距离计算当前访问路径和第一访问路径的路径长度,访问路径的路径长度如公式(3)所示:Further, the Euclidean distance is used to calculate the path length of the current access path and the first access path, and the path length of the access path is shown in formula (3):
其中,表示路径长度,表示访问路径的起点三维坐标,且。表 示访问路径的终点三维坐标,且。 in, represents the path length, represents the three-dimensional coordinates of the starting point of the access path, and . represents the three-dimensional coordinates of the end point of the access path, and .
步骤S36,将更新后的当前访问顺序作为新的当前访问顺序,将更新后的当前迭代计数作为新的当前迭代计数。Step S36, the updated current access sequence is regarded as the new current access sequence, and the updated current iteration count is regarded as the new current iteration count.
步骤S37,重复执行上述步骤,直至当前迭代计数达到最大迭代次数,将最终得到的当前访问顺序作为目标访问顺序。In step S37, the above steps are repeatedly performed until the current iteration count reaches the maximum number of iterations, and the finally obtained current access sequence is used as the target access sequence.
上述步骤S31至步骤S37,通过多次迭代对当前访问顺序中的局部访问顺序进行翻转处理得到第一访问顺序,并比较当前访问路径和第一访问路径的路径长度,在第一访问路径的路径长度小于当前访问路径的路径长度的情况下,将第一访问顺序作为更新后的当前访问顺序,以使最终得到的当前访问顺序所对应的当前访问路径达到最短,并将最终得到的当前访问顺序作为目标访问顺序,从而可以提高机械臂对三维头部区域中的多个三维点的访问效率,进而可以提高机械臂将脑机接口植入至三维头部区域中的多个三维点的植入效率。From the above steps S31 to S37, the first access sequence is obtained by inverting the partial access sequence in the current access sequence through multiple iterations, and the path lengths of the current access path and the first access path are compared. When the length is less than the path length of the current access path, the first access order is used as the updated current access order, so that the current access path corresponding to the final current access order is the shortest, and the final current access order is obtained. As the target access sequence, the access efficiency of the robotic arm to multiple three-dimensional points in the three-dimensional head region can be improved, and the implantation of the brain-computer interface by the robotic arm to multiple three-dimensional points in the three-dimensional head region can be improved. efficiency.
优选地,基于迪杰斯特拉算法(即Dijkstra算法)实现步骤S4中第二配置列表的优化过程,从而得到目标配置列表。Preferably, the optimization process of the second configuration list in step S4 is implemented based on the Dijkstra algorithm (ie, the Dijkstra algorithm), so as to obtain the target configuration list.
在一个实施例中,如图6所示,上述步骤S4包括步骤S41至步骤S45,其中:In one embodiment, as shown in FIG. 6 , the above step S4 includes steps S41 to S45, wherein:
步骤S41,基于目标访问顺序和第二配置列表构建三维点级联图;三维点级联图包括多个级联的三维点层以及每一个三维点层对应的多个顶点,其中,每一个三维点层对应一个三维点,多个顶点表示三维点对应的多组机械臂关节转角数据。Step S41, constructing a three-dimensional point cascade diagram based on the target access sequence and the second configuration list; the three-dimensional point cascade diagram includes a plurality of cascaded three-dimensional point layers and a plurality of vertices corresponding to each three-dimensional point layer, wherein each three-dimensional point cascade The point layer corresponds to a 3D point, and multiple vertices represent multiple sets of joint angle data of the manipulator corresponding to the 3D point.
需要说明的是,每一个三维点层对应的多个顶点表示机械臂在每一个三维点处对应的多组机械臂关节转角数据。It should be noted that the multiple vertices corresponding to each three-dimensional point layer represent multiple sets of joint rotation angle data of the manipulator corresponding to each three-dimensional point of the manipulator.
步骤S42,遍历三维点级联图中的每一个三维点层,在相邻两个三维点层中各选取一个顶点,并基于选取的两个顶点获取机械臂在相邻两个三维点层之间移动的移动路径以及移动成本。Step S42, traverse each three-dimensional point layer in the three-dimensional point cascade diagram, select a vertex in each of the two adjacent three-dimensional point layers, and obtain the position between the two adjacent three-dimensional point layers of the robotic arm based on the selected two vertexes. moving paths and moving costs.
步骤S43,重复执行上一个步骤,直至遍历三维点级联图中的所有顶点,获取最终得到所有移动路径和移动成本。In step S43, the previous step is repeated until all vertices in the three-dimensional point cascade graph are traversed, and all moving paths and moving costs are finally obtained.
步骤S44,遍历三维点级联图中的每一个三维点层,基于移动成本从相邻两个三维点层对应的多个移动路径中筛选出目标移动路径,得到多个目标移动路径。Step S44 , traverse each 3D point layer in the 3D point cascade diagram, screen out target movement paths from multiple movement paths corresponding to two adjacent 3D point layers based on the movement cost, and obtain multiple target movement paths.
优选地,从相邻两个三维点层对应的多个移动路径中筛选出移动成本最小的移动路径作为目标移动路径,从而可以降低机械臂在三维头部区域中移动进行脑机接口植入的植入成本。Preferably, the moving path with the smallest moving cost is selected from the multiple moving paths corresponding to the two adjacent three-dimensional point layers as the target moving path, thereby reducing the need for the robotic arm to move in the three-dimensional head region for implantation of the brain-computer interface. input cost.
步骤S45,基于多个目标移动路径和第二配置列表获取目标配置列表,并基于目标配置列表获取机械臂在三维头部区域中形成的模拟植入轨迹。Step S45 , obtaining a target configuration list based on the multiple target movement paths and the second configuration list, and obtaining a simulated implantation trajectory formed by the robotic arm in the three-dimensional head region based on the target configuration list.
其中,目标配置列表包括按照目标访问顺序排列的多个三维点以及每一个三维点对应的机械臂关节转角数据。Wherein, the target configuration list includes a plurality of three-dimensional points arranged in the order of access to the target and the data of the joint rotation angle of the manipulator corresponding to each three-dimensional point.
进一步地,机械臂在三维头部区域中形成的模拟植入轨迹可以由如下公式(4)表示:Further, the simulated implantation trajectory formed by the robotic arm in the three-dimensional head region can be expressed by the following formula (4):
其中,表示模拟植入轨迹,表示起始三维点,表示终点三维 点,表示起始三维点与终点三维点之间的其他三维点的速度数据,该速度数据包括其他 三维点的加速度和速度。K表示其他三维点的数量。 in, represents the simulated implantation trajectory, represents the starting 3D point, represents the three-dimensional point of the end point, Indicates the velocity data of other 3D points between the start 3D point and the end 3D point, and the velocity data includes the acceleration and velocity of the other 3D points. K represents the number of other three-dimensional points.
优选地,采用开源机器人运动规划算法和目标配置列表生成机械臂在三维头部区域中形成的模拟植入轨迹。其中,开源机器人运动规划算法为OMPL算法(The Open MotionPlanning Library,OMPL)。Preferably, an open-source robot motion planning algorithm and a target configuration list are used to generate a simulated implantation trajectory formed by the robotic arm in the three-dimensional head region. Among them, the open source robot motion planning algorithm is the OMPL algorithm (The Open MotionPlanning Library, OMPL).
在一个实施例中,图7是本发明具体实施例中三维点级联图的结构示意图,如图7所示,三维点级联图包括多个级联的三维点层以及每一个三维点层对应的多个顶点。三维点层由纵向排列的多个顶点构成,三维点层的编号即为[1,n],图7中的每一个圆圈表示一个顶点,图7中左侧的黑色实心圆圈表示起始顶点,右侧的黑色实心圆圈表示终点顶点。相邻两个顶点之间的线条表示顶点对应的相邻两个三维点层之间的移动路径。例如,三维点层1和三维点层2为相邻的两个三维点层。In one embodiment, FIG. 7 is a schematic structural diagram of a three-dimensional point cascade diagram in a specific embodiment of the present invention. As shown in FIG. 7 , the three-dimensional point cascade diagram includes multiple cascaded three-dimensional point layers and each three-dimensional point layer. corresponding multiple vertices. The 3D point layer is composed of multiple vertices arranged vertically. The number of the 3D point layer is [1,n]. Each circle in Figure 7 represents a vertex, and the black solid circle on the left in Figure 7 represents the starting vertex. The black solid circle on the right represents the end vertex. The line between two adjacent vertices represents the movement path between the two adjacent three-dimensional point layers corresponding to the vertices. For example, the 3D point layer 1 and the
在一个实施例中,如图8所示,上述步骤S42包括步骤S421至步骤S424,其中:In one embodiment, as shown in FIG. 8 , the above step S42 includes steps S421 to S424, wherein:
步骤S421,获取选取的两个顶点所对应的机械臂关节转角数据以及机械臂关节的最大转角角速度。Step S421 , acquiring the manipulator joint rotation angle data corresponding to the two selected vertices and the maximum rotation angle speed of the manipulator joint.
步骤S422,基于两个顶点所对应的机械臂关节转角数据获取机械臂关节转角差值,并基于机械臂关节转角差值和最大转角角速度获取最大关节转角时间。Step S422 , obtaining the manipulator joint angle difference based on the manipulator joint angle data corresponding to the two vertices, and obtaining the maximum joint angle time based on the manipulator joint angle difference and the maximum angle speed.
其中,机械臂关节转角数据包括多个机械臂关节以及每一机械臂关节对应的关节 转角。多个机械臂关节通过关节编号进行区分。例如,若机械臂关节的数量为六个,则 取值为[1,6]。 Wherein, the manipulator joint angle data includes a plurality of manipulator joints and a joint angle corresponding to each manipulator joint. Multiple robotic arm joints are numbered by joint differentiate. For example, if the number of manipulator joints is six, then The value is [1,6].
步骤S423,基于两个顶点所对应的机械臂关节转角数据获取机械臂关节的转角符号切换成本;基于转角符号切换成本和预设额外成本系数,获取机械臂在相邻两个三维点层之间移动的额外成本。Step S423: Obtain the corner symbol switching cost of the robotic arm joint based on the robotic arm joint corner data corresponding to the two vertices; based on the corner symbol switching cost and a preset extra cost coefficient, obtain the robotic arm between two adjacent three-dimensional point layers. Additional cost of moving.
步骤S424,基于最大关节转角时间和额外成本,获取机械臂在相邻两个三维点层之间移动的移动成本。Step S424, based on the maximum joint rotation time and the extra cost, obtain the moving cost of the robotic arm moving between two adjacent three-dimensional point layers.
在一个实施例中,针对两个顶点所对应的机械臂关节,基于机械臂关节的关节 转角计算其对应的机械臂关节转角差值。基于机械臂关节的最大转角角速度及其对应的 机械臂关节转角差值计算得到其对应的最大关节转角时间。基于机械臂关节的关节转角 计算其对应的转角符号切换成本,并基于机械臂关节对应的转角符号切换成本以及预设 额外成本系数,获取机械臂关节在相邻两个三维点层中的两个顶点之间移动的额外成 本。基于机械臂关节对应的最大关节转角时间和额外成本,计算得到机械臂关节在相 邻两个三维点层中的两个顶点之间移动的移动成本。其中,机械臂关节表示机械臂中任 意一个机械臂关节。 In one embodiment, for the robotic arm joints corresponding to the two vertices , based on the robotic arm joint The joint angle of the corresponding robot arm joint angle difference is calculated. Based on robotic arm joints The maximum corner angular velocity of , and its corresponding joint corner difference of the manipulator are calculated to obtain its corresponding maximum joint corner time. Based on robotic arm joints The joint angle of Corresponding corner symbol switching cost and preset additional cost factor to obtain the joints of the robotic arm The additional cost of moving between two vertices in two adjacent 3D point layers. Based on robotic arm joints The corresponding maximum joint angle time and extra cost are calculated to obtain the robot arm joints The movement cost of moving between two vertices in two adjacent 3D point layers. Among them, the mechanical arm joint Indicates any robotic arm joint in the robotic arm.
进一步地,机械臂在相邻两个三维点层之间移动的移动成本的计算方式如下公式(5)所示:Further, the calculation method of the moving cost of the robotic arm moving between two adjacent three-dimensional point layers is shown in the following formula (5):
其中,C表示预设额外成本系数,其为一个常量。表示机械臂关节的关节编号。表示前一个三维点层中顶点对应的机械臂关节的第一关节转角,表示后一个三维 点层中顶点对应的机械臂关节的第二关节转角。表示相邻两个三维点层中顶 点对应机械臂关节的机械臂关节转角差值。表示机械臂关节的最大转角角速度,表示机械臂关节的最大关节转角时间。表示符号函数,表示机械臂中机械臂关节在相邻两个三维点层之间移动的转角符 号切换成本。 Among them, C represents the preset extra cost coefficient, which is a constant. Indicates the joint number of the robot arm joint. Indicates the robot arm joint corresponding to the vertex in the previous 3D point layer The first joint angle of , Indicates the robot arm joint corresponding to the vertex in the latter 3D point layer of the second joint angle. Indicates that the vertices in the adjacent two 3D point layers correspond to the manipulator joints The difference value of the manipulator joint rotation angle. Represents a robotic arm joint The maximum corner angular velocity of , Represents a robotic arm joint The maximum joint rotation time. represents a symbolic function, Represents the robotic arm joints in the robotic arm Corner symbol switching cost for moving between two adjacent 3D point layers.
需要说明的是,在机械臂关节的关节转角从负角度转到正角度或者从负角度转 到正角度的情况下,转角符号切换成本为1。在机械臂关节的关节转角从负角度转到负角 度或者从正角度转到正角度的情况下,转角符号切换成本为0。即相邻两个三维点层中顶点 所对应的机械臂关节具有不同的转角符号的情况下,机械臂从相邻两个三维点层之间移 动的移动成本更高。 It should be noted that in the robotic arm joint When the joint angle of , changes from a negative angle to a positive angle or from a negative angle to a positive angle, the corner sign switching cost is 1. Joints in the robotic arm When the joint angle of , changes from a negative angle to a negative angle or from a positive angle to a positive angle, the cost of switching the sign of the angle is 0. That is, the robot arm joints corresponding to the vertices in the adjacent two 3D point layers With different sign of the corners, the moving cost of the manipulator from between two adjacent 3D point layers is higher.
下面提供一个具体实施例,以对本发明提供的基于脑机接口的机械臂轨迹规划方法作进一步说明,具体包括以下步骤:A specific embodiment is provided below to further illustrate the brain-computer interface-based robotic arm trajectory planning method provided by the present invention, which specifically includes the following steps:
步骤1:获取机械臂在三维头部区域中的每一个三维点处的机械臂位姿数据,机械臂位姿数据包括机械臂的三维坐标值以及坐标轴旋转角;基于运动学逆解运算策略将机械臂位姿数据转换为机械臂关节转角数据,机械臂关节转角数据包括多个机械臂关节以及每一个机械臂关节的转角;基于三维头部区域中的每一个三维点以及每一个三维点对应的机械臂关节转角数据,得到第一配置列表。Step 1: Obtain the robot arm pose data at each 3D point in the 3D head area of the robot arm. The robot arm pose data includes the 3D coordinate value of the robot arm and the rotation angle of the coordinate axis; based on the kinematic inverse solution operation strategy Convert the robot arm pose data to the robot arm joint angle data. The robot arm joint angle data includes multiple robot arm joints and the rotation angle of each robot arm joint; based on each 3D point and each 3D point in the 3D head area Corresponding joint angle data of the manipulator is obtained to obtain the first configuration list.
步骤2:获取机械臂在第一配置列表中的每一个三维点处对应的第一包围盒以及三维头部区域对应的第二包围盒;针对每一第一包围盒,判断第一包围盒是否与第二包围盒相交;在第一包围盒与第二包围盒相交的情况下,判断机械臂在第一包围盒对应的三维点处是否与三维头部区域相交;在机械臂在第一包围盒对应的三维点处与三维头部区域相交的情况下,在第一配置列表中删除三维点及其对应的机械臂关节转角数据。将删除处理后的第一配置列表作为第二配置列表。Step 2: Obtain the first bounding box corresponding to each 3D point of the robotic arm in the first configuration list and the second bounding box corresponding to the 3D head area; for each first bounding box, determine whether the first bounding box is Intersect with the second bounding box; when the first bounding box intersects with the second bounding box, determine whether the robotic arm intersects the three-dimensional head area at the three-dimensional point corresponding to the first bounding box; when the robotic arm is in the first bounding box In the case where the 3D point corresponding to the box intersects with the 3D head area, the 3D point and its corresponding robot arm joint rotation angle data are deleted from the first configuration list. Use the deleted first configuration list as the second configuration list.
步骤3:获取当前迭代计数以及机械臂对第二配置列表中的所有三维点的当前访问顺序;基于当前访问顺序和第二配置列表中每一个三维点的三维坐标,获取当前访问顺序对应的当前访问路径;获取当前访问顺序中任意两个不相邻的三维点之间的局部访问顺序,并对当前访问顺序中的局部访问顺序进行翻转处理得到第一访问顺序;基于所示第一访问顺序和第二配置列表中每一个三维点的三维坐标,获取第一访问顺序对应的第一访问路径;基于当前访问路径和第一访问路径,更新当前访问顺序和当前迭代计数;将更新后的当前访问顺序作为新的当前访问顺序,将更新后的当前迭代计数作为新的当前迭代计数;重复执行上述步骤,直至当前迭代计数达到最大迭代次数,将最终得到的当前访问顺序作为目标访问顺序。Step 3: Obtain the current iteration count and the current access order of the robotic arm to all the three-dimensional points in the second configuration list; based on the current access order and the three-dimensional coordinates of each three-dimensional point in the second configuration list, obtain the current access order corresponding to the current access order. Access path; obtain the local access sequence between any two non-adjacent three-dimensional points in the current access sequence, and reverse the local access sequence in the current access sequence to obtain the first access sequence; based on the first access sequence shown and the three-dimensional coordinates of each three-dimensional point in the second configuration list, obtain the first access path corresponding to the first access sequence; based on the current access path and the first access path, update the current access sequence and the current iteration count; The access order is taken as the new current access order, and the updated current iteration count is taken as the new current iteration count; the above steps are repeated until the current iteration count reaches the maximum number of iterations, and the final current access order is taken as the target access order.
步骤4:基于目标访问顺序和第二配置列表构建三维点级联图;三维点级联图包括多个级联的三维点层以及每一个三维点层对应的多个顶点,其中,每一个三维点层对应一个三维点,多个顶点表示三维点对应的多组机械臂关节转角数据;遍历三维点级联图中的每一个三维点层,在相邻两个三维点层中各选取一个顶点,并基于选取的两个顶点获取机械臂在相邻两个三维点层之间移动的移动路径以及移动成本;重复执行上一个步骤,直至遍历三维点级联图中的所有顶点,获取最终得到所有移动路径和移动成本;遍历三维点级联图中的每一个三维点层,基于移动成本从相邻两个三维点层对应的多个移动路径中筛选出目标移动路径,得到多个目标移动路径;基于多个目标移动路径和第二配置列表获取目标配置列表,并基于目标配置列表获取机械臂在三维头部区域中形成的模拟植入轨迹。Step 4: Build a 3D point cascade graph based on the target access order and the second configuration list; the 3D point cascade graph includes multiple cascaded 3D point layers and multiple vertices corresponding to each 3D point layer, wherein each 3D point cascade The point layer corresponds to a 3D point, and multiple vertices represent multiple sets of manipulator joint angle data corresponding to the 3D point; traverse each 3D point layer in the 3D point cascade diagram, and select a vertex in each of the two adjacent 3D point layers , and based on the selected two vertices, the moving path and moving cost of the robotic arm moving between two adjacent three-dimensional point layers are obtained; the previous step is repeated until all vertices in the three-dimensional point cascade graph are traversed, and the final result is obtained. All movement paths and movement costs; traverse each 3D point layer in the 3D point cascade diagram, screen out the target movement paths from the multiple movement paths corresponding to two adjacent 3D point layers based on the movement cost, and obtain multiple target movements path; obtaining a target configuration list based on the multiple target movement paths and the second configuration list, and obtaining a simulated implantation trajectory formed by the robotic arm in the three-dimensional head region based on the target configuration list.
步骤5:获取选取的两个顶点所对应的机械臂关节转角数据以及机械臂关节的最大转角角速度;基于两个顶点所对应的机械臂关节转角数据获取机械臂关节转角差值,并基于机械臂关节转角差值和最大转角角速度获取最大关节转角时间;基于两个顶点所对应的机械臂关节转角数据获取机械臂关节的转角符号切换成本;基于转角符号切换成本和预设额外成本系数,获取机械臂在相邻两个三维点层之间移动的额外成本;基于最大关节转角时间和额外成本,获取机械臂在相邻两个三维点层之间移动的移动成本。Step 5: Obtain the manipulator joint angle data corresponding to the two selected vertices and the maximum angle angular velocity of the manipulator joint; obtain the manipulator joint angle difference based on the manipulator joint angle data corresponding to the two vertices, and based on the manipulator arm joint angle difference Obtain the maximum joint corner time based on the joint corner difference and the maximum corner angular velocity; obtain the corner symbol switching cost of the manipulator joint based on the manipulator joint corner data corresponding to the two vertices; obtain the mechanical arm joint based on the corner symbol switching cost and the preset extra cost factor. The additional cost of the arm moving between two adjacent 3D point layers; based on the maximum joint rotation time and the additional cost, obtain the movement cost of the robot arm moving between two adjacent 3D point layers.
下面对本发明提供的基于脑机接口的机械臂轨迹规划装置进行描述,下文描述的基于脑机接口的机械臂轨迹规划装置与上文描述的基于脑机接口的机械臂轨迹规划方法可相互对应参照。The following describes the robot trajectory planning device based on the brain-computer interface provided by the present invention. The robot trajectory planning device based on the brain-computer interface described below and the robot trajectory planning method based on the brain-computer interface described above may refer to each other correspondingly. .
如图9所示,本发明提供一种基于脑机接口的机械臂轨迹规划装置,基于脑机接口的机械臂轨迹规划装置100包括:配置获取模块10,用于获取第一配置列表,第一配置列表包括三维头部区域中的每一个三维点以及机械臂在三维头部区域中的每一个三维点处的机械臂关节转角数据。碰撞检测模块20,用于基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据。顺序确定模块30,用于将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对第二配置列表中的所有三维点的目标访问顺序。轨迹生成模块40,用于基于第二配置列表和目标访问顺序,获取机械臂在三维头部区域中运动形成的模拟植入轨迹,模拟植入轨迹用于将脑机接口植入至三维头部区域。As shown in FIG. 9 , the present invention provides a robotic arm trajectory planning device based on a brain-computer interface. The brain-computer interface-based robotic arm
在一个实施例中,配置获取模块10包括:位姿数据获取单元,用于获取机械臂在三维头部区域中的每一个三维点处的机械臂位姿数据,机械臂位姿数据包括机械臂的三维坐标值以及坐标轴旋转角。转角数据获取单元,用于基于运动学逆解运算策略将机械臂位姿数据转换为机械臂关节转角数据,机械臂关节转角数据包括多个机械臂关节以及每一个机械臂关节的转角。配置列表获取单元,用于基于三维头部区域中的每一个三维点以及每一个三维点对应的机械臂关节转角数据,得到第一配置列表。In one embodiment, the
在一个实施例中,碰撞检测模块20包括:包围盒获取单元,用于获取机械臂在第一配置列表中的每一个三维点处对应的第一包围盒以及三维头部区域对应的第二包围盒。第一相交判断单元,用于针对每一第一包围盒,判断第一包围盒是否与第二包围盒相交。第二相交判断单元,用于在第一包围盒与第二包围盒相交的情况下,判断机械臂在第一包围盒对应的三维点处是否与三维头部区域相交。三维点删除单元,用于在机械臂在第一包围盒对应的三维点处与三维头部区域相交的情况下,在第一配置列表中删除三维点及其对应的机械臂关节转角数据。In one embodiment, the
在一个实施例中,包围盒获取单元包括:坐标极值获取子单元,用于获取机械臂在第一配置列表中的每一个三维点处的机械臂坐标极值数据,机械臂坐标极值数据包括机械臂的多个机械臂关节以及每一个机械臂关节的坐标极值数据;第一包围盒获取子单元,用于基于机械臂坐标极值数据获取机械臂中的每一个机械臂关节在第一配置列表中的每一个三维点处对应的第一包围盒。第二包围盒获取子单元,用于获取三维头部区域的区域坐标极值数据,并基于区域坐标极值数据获取三维头部区域对应的第二包围盒。In one embodiment, the bounding box obtaining unit includes: a coordinate extreme value obtaining subunit, configured to obtain coordinate extreme value data of the manipulator at each three-dimensional point of the manipulator in the first configuration list, coordinate extreme value data of the manipulator Including multiple manipulator joints of the manipulator and the coordinate extreme value data of each manipulator joint; the first bounding box acquisition subunit is used to obtain each manipulator joint in the manipulator based on the coordinate extreme value data of the manipulator. A first bounding box corresponding to each 3D point in the configuration list. The second bounding box obtaining subunit is used to obtain the regional coordinate extreme value data of the three-dimensional head region, and obtain the second bounding box corresponding to the three-dimensional head region based on the regional coordinate extreme value data.
在一个实施例中,顺序确定模块30包括:迭代数据获取单元,用于获取当前迭代计数以及机械臂对第二配置列表中的所有三维点的当前访问顺序。第一路径获取单元,用于基于当前访问顺序和第二配置列表中每一个三维点的三维坐标,获取当前访问顺序对应的当前访问路径。局部顺序翻转单元,用于获取当前访问顺序中任意两个不相邻的三维点之间的局部访问顺序,并对当前访问顺序中的局部访问顺序进行翻转处理得到第一访问顺序。第二路径获取单元,用于基于所示第一访问顺序和第二配置列表中每一个三维点的三维坐标,获取第一访问顺序对应的第一访问路径。迭代数据更新单元,用于基于当前访问路径和第一访问路径,更新当前访问顺序和当前迭代计数。迭代数据确定单元,用于将更新后的当前访问顺序作为新的当前访问顺序,将更新后的当前迭代计数作为新的当前迭代计数。目标顺序确定单元,用于重复执行上述步骤,直至当前迭代计数达到最大迭代次数,将最终得到的当前访问顺序作为目标访问顺序。In one embodiment, the
在一个实施例中,轨迹生成模块包括:级联图构建单元,用于基于目标访问顺序和第二配置列表构建三维点级联图;三维点级联图包括多个级联的三维点层以及每一个三维点层对应的多个顶点,其中,每一个三维点层对应一个三维点,多个顶点表示三维点对应的多组机械臂关节转角数据。第一移动计算单元,用于遍历三维点级联图中的每一个三维点层,在相邻两个三维点层中各选取一个顶点,并基于选取的两个顶点获取机械臂在相邻两个三维点层之间移动的移动路径以及移动成本。第二移动计算单元,用于重复执行上一个步骤,直至遍历三维点级联图中的所有顶点,获取最终得到所有移动路径和移动成本。移动路径筛选单元,用于遍历三维点级联图中的每一个三维点层,基于移动成本从相邻两个三维点层对应的多个移动路径中筛选出目标移动路径,得到多个目标移动路径。模拟轨迹生成单元,用于基于多个目标移动路径和第二配置列表获取目标配置列表,并基于目标配置列表获取机械臂在三维头部区域中形成的模拟植入轨迹。In one embodiment, the trajectory generation module includes: a cascade graph construction unit, configured to construct a 3D point cascade graph based on the target access order and the second configuration list; the 3D point cascade graph includes a plurality of cascaded 3D point layers and Each 3D point layer corresponds to multiple vertices, wherein each 3D point layer corresponds to a 3D point, and the multiple vertices represent multiple sets of mechanical arm joint rotation angle data corresponding to the 3D point. The first mobile computing unit is used to traverse each 3D point layer in the 3D point cascade graph, select a vertex in each of the two adjacent 3D point layers, and obtain the position of the robot arm in the adjacent two vertices based on the selected two vertices. The movement path and movement cost of moving between three 3D point layers. The second movement calculation unit is used to repeatedly execute the previous step until all vertices in the three-dimensional point cascade graph are traversed, and finally all movement paths and movement costs are obtained. The movement path screening unit is used to traverse each 3D point layer in the 3D point cascade diagram, and based on the movement cost, select the target movement path from the multiple movement paths corresponding to the two adjacent 3D point layers, and obtain multiple target movement paths. path. The simulated trajectory generation unit is configured to obtain a target configuration list based on the multiple target moving paths and the second configuration list, and obtain a simulated implantation trajectory formed by the robotic arm in the three-dimensional head region based on the target configuration list.
在一个实施例中,第一移动计算单元包括:关节数据获取子单元,用于获取选取的两个顶点所对应的机械臂关节转角数据以及机械臂关节的最大转角角速度。转角时间获取子单元,用于基于两个顶点所对应的机械臂关节转角数据获取机械臂关节转角差值,并基于机械臂关节转角差值和最大转角角速度获取最大关节转角时间。额外成本获取子单元,用于基于两个顶点所对应的机械臂关节转角数据获取机械臂关节的转角符号切换成本;基于转角符号切换成本和预设额外成本系数,获取机械臂在相邻两个三维点层之间移动的额外成本。移动成本获取子单元,用于基于最大关节转角时间和额外成本,获取机械臂在相邻两个三维点层之间移动的移动成本。In one embodiment, the first movement computing unit includes: a joint data acquisition subunit, configured to acquire the manipulator joint rotation angle data corresponding to the two selected vertices and the maximum rotation angle speed of the manipulator joint. The corner time acquisition subunit is used to obtain the difference of the joint corners of the robot arm based on the joint corner data of the robot arm corresponding to the two vertices, and to obtain the maximum joint corner time based on the difference of the joint corners of the robot arm and the maximum corner angular velocity. The additional cost acquisition subunit is used to obtain the corner sign switching cost of the manipulator joint based on the manipulator joint angle data corresponding to the two vertices; Additional cost of moving between 3D point layers. The movement cost acquisition sub-unit is used to obtain the movement cost of the robot arm moving between two adjacent 3D point layers based on the maximum joint rotation time and additional cost.
图10示例了一种电子设备的实体结构示意图,如图10所示,该电子设备可以包括:处理器(processor)1010、通信接口(Communications Interface)1020、存储器(memory)1030和通信总线1040,其中,处理器1010,通信接口1020,存储器1030通过通信总线1040完成相互间的通信。处理器1010可以调用存储器1030中的逻辑指令,以执行基于脑机接口的机械臂轨迹规划方法,该方法包括:获取第一配置列表,第一配置列表包括三维头部区域中的每一个三维点以及机械臂在三维头部区域中的每一个三维点处的机械臂关节转角数据;基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据;将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对第二配置列表中的所有三维点的目标访问顺序;基于第二配置列表和目标访问顺序,获取机械臂在三维头部区域中运动形成的模拟植入轨迹,模拟植入轨迹用于将脑机接口植入至三维头部区域。FIG. 10 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 10 , the electronic device may include: a processor (processor) 1010, a communication interface (Communications Interface) 1020, a memory (memory) 1030, and a
此外,上述的存储器1030中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的基于脑机接口的机械臂轨迹规划方法,该方法包括:获取第一配置列表,第一配置列表包括三维头部区域中的每一个三维点以及机械臂在三维头部区域中的每一个三维点处的机械臂关节转角数据;基于三维头部区域和第一配置列表进行碰撞检测,并基于碰撞检测结果删除第一配置列表中机械臂与三维头部区域存在碰撞的三维点以及三维点对应的机械臂关节转角数据;将删除处理后的第一配置列表作为第二配置列表,并获取机械臂对第二配置列表中的所有三维点的目标访问顺序;基于第二配置列表和目标访问顺序,获取机械臂在三维头部区域中运动形成的模拟植入轨迹,模拟植入轨迹用于将脑机接口植入至三维头部区域。In another aspect, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and the computer program is implemented by a processor to execute the brain-computer interface-based robotic arm trajectory provided by the above methods when the computer program is executed. a planning method, the method comprising: acquiring a first configuration list, where the first configuration list includes each three-dimensional point in the three-dimensional head area and the manipulator joint rotation angle data of the manipulator at each three-dimensional point in the three-dimensional head area; Perform collision detection based on the 3D head area and the first configuration list, and delete the 3D points where the robot collides with the 3D head area and the joint angle data of the robot arm corresponding to the 3D points in the first configuration list based on the result of the collision detection; The processed first configuration list is used as the second configuration list, and the target access order of the robotic arm to all 3D points in the second configuration list is obtained; based on the second configuration list and the target access order, the robot arm in the 3D head area is obtained The simulated implantation trajectory formed by the middle movement is used to implant the brain-computer interface into the three-dimensional head region.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210941922.7A CN114986524B (en) | 2022-08-08 | 2022-08-08 | Mechanical arm track planning method and device based on brain-computer interface and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210941922.7A CN114986524B (en) | 2022-08-08 | 2022-08-08 | Mechanical arm track planning method and device based on brain-computer interface and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114986524A true CN114986524A (en) | 2022-09-02 |
CN114986524B CN114986524B (en) | 2022-10-28 |
Family
ID=83023070
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210941922.7A Active CN114986524B (en) | 2022-08-08 | 2022-08-08 | Mechanical arm track planning method and device based on brain-computer interface and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114986524B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116901074A (en) * | 2023-08-03 | 2023-10-20 | 南京云创大数据科技股份有限公司 | Mechanical arm track planning method and device, storage medium and electronic equipment |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106166750A (en) * | 2016-09-27 | 2016-11-30 | 北京邮电大学 | A kind of modified model D* mechanical arm dynamic obstacle avoidance paths planning method |
CN107803831A (en) * | 2017-09-27 | 2018-03-16 | 杭州新松机器人自动化有限公司 | A kind of AOAAE bounding volume hierarchy (BVH)s collision checking method |
CN110488810A (en) * | 2019-07-22 | 2019-11-22 | 华南理工大学 | Welding robot optimum path planning method based on improved Particle Swarm Algorithm |
CN110509279A (en) * | 2019-09-06 | 2019-11-29 | 北京工业大学 | A motion path planning method and system for a humanoid robotic arm |
CN113232021A (en) * | 2021-05-19 | 2021-08-10 | 中国科学院自动化研究所苏州研究院 | Mechanical arm grabbing path collision detection method |
CN113246143A (en) * | 2021-06-25 | 2021-08-13 | 视比特(长沙)机器人科技有限公司 | Mechanical arm dynamic obstacle avoidance trajectory planning method and device |
US20210278857A1 (en) * | 2020-03-06 | 2021-09-09 | Edda Technology, Inc. | Method and system for obstacle avoidance in robot path planning using depth sensors |
CN113693725A (en) * | 2021-10-22 | 2021-11-26 | 杭州维纳安可医疗科技有限责任公司 | Needle insertion path planning method, device, equipment and storage medium |
CN114376726A (en) * | 2022-02-08 | 2022-04-22 | 西安科悦医疗股份有限公司 | Path planning method and related device for transcranial magnetic stimulation navigation process |
CN114564008A (en) * | 2022-01-19 | 2022-05-31 | 南京邮电大学 | Mobile robot path planning method based on improved A-Star algorithm |
CN114633258A (en) * | 2022-04-24 | 2022-06-17 | 中国铁建重工集团股份有限公司 | Method for planning mechanical arm movement track in tunnel environment and related device |
-
2022
- 2022-08-08 CN CN202210941922.7A patent/CN114986524B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106166750A (en) * | 2016-09-27 | 2016-11-30 | 北京邮电大学 | A kind of modified model D* mechanical arm dynamic obstacle avoidance paths planning method |
CN107803831A (en) * | 2017-09-27 | 2018-03-16 | 杭州新松机器人自动化有限公司 | A kind of AOAAE bounding volume hierarchy (BVH)s collision checking method |
CN110488810A (en) * | 2019-07-22 | 2019-11-22 | 华南理工大学 | Welding robot optimum path planning method based on improved Particle Swarm Algorithm |
CN110509279A (en) * | 2019-09-06 | 2019-11-29 | 北京工业大学 | A motion path planning method and system for a humanoid robotic arm |
US20210278857A1 (en) * | 2020-03-06 | 2021-09-09 | Edda Technology, Inc. | Method and system for obstacle avoidance in robot path planning using depth sensors |
CN113232021A (en) * | 2021-05-19 | 2021-08-10 | 中国科学院自动化研究所苏州研究院 | Mechanical arm grabbing path collision detection method |
CN113246143A (en) * | 2021-06-25 | 2021-08-13 | 视比特(长沙)机器人科技有限公司 | Mechanical arm dynamic obstacle avoidance trajectory planning method and device |
CN113693725A (en) * | 2021-10-22 | 2021-11-26 | 杭州维纳安可医疗科技有限责任公司 | Needle insertion path planning method, device, equipment and storage medium |
CN114564008A (en) * | 2022-01-19 | 2022-05-31 | 南京邮电大学 | Mobile robot path planning method based on improved A-Star algorithm |
CN114376726A (en) * | 2022-02-08 | 2022-04-22 | 西安科悦医疗股份有限公司 | Path planning method and related device for transcranial magnetic stimulation navigation process |
CN114633258A (en) * | 2022-04-24 | 2022-06-17 | 中国铁建重工集团股份有限公司 | Method for planning mechanical arm movement track in tunnel environment and related device |
Non-Patent Citations (1)
Title |
---|
黎宇晨等: "狭小空间机械臂自适应轨迹规划研究", 《电子元器件与信息技术》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116901074A (en) * | 2023-08-03 | 2023-10-20 | 南京云创大数据科技股份有限公司 | Mechanical arm track planning method and device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN114986524B (en) | 2022-10-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113352319B (en) | Redundant mechanical arm obstacle avoidance trajectory planning method based on improved fast expansion random tree | |
CN108983978B (en) | Virtual hand control method and device | |
CN108645411A (en) | Robot path planning method, device based on particle cluster algorithm and terminal device | |
CN112440281A (en) | Robot trajectory planning method based on digital twins | |
CN114603564A (en) | Robotic arm navigation and obstacle avoidance method, system, computer equipment and storage medium | |
CN110703768A (en) | An Improved Dynamic RRT* Motion Planning Method for Mobile Robots | |
CN113203420B (en) | A Dynamic Path Planning Method for Industrial Robots Based on Variable Density Search Space | |
CN113253744B (en) | Multi-robot cooperative trajectory planning method, device, electronic device and storage medium | |
CN114460965B (en) | Unmanned aerial vehicle three-dimensional obstacle avoidance method based on improved artificial potential field method | |
CN113211495A (en) | Mechanical arm collision detection method and system, storage medium and mechanical arm | |
CN109746916A (en) | A method and system for robot writing calligraphy | |
CN113119104B (en) | Mechanical arm control method, mechanical arm control device, computing equipment and system | |
JP4942924B2 (en) | A method of moving a virtual articulated object in a virtual environment by continuous motion | |
CN114986524B (en) | Mechanical arm track planning method and device based on brain-computer interface and electronic equipment | |
Marchese | A directional diffusion algorithm on cellular automata for robot path-planning | |
CN116265204A (en) | Neural network for generating robot task presentations | |
CN111531542B (en) | A Collision-Free Path Planning Method for Robot Arm Based on Improved A* Algorithm | |
WO2019218159A1 (en) | Particle swarm algorithm-based robot path planning method and apparatus, and terminal device | |
CN118809597A (en) | Trajectory planning method, device, robot and medium for dual-arm mobile robot | |
CN118106970A (en) | Mechanical arm autonomous grabbing method and system based on neural network | |
CN118528248A (en) | Method, device, equipment and storage medium for planning operation path lattice | |
CN115690267B (en) | Animation processing method, device, equipment, storage medium and product | |
CN117047751A (en) | Method and system for planning path of bi-directional expansion mechanical arm under pose constraint | |
CN114820802A (en) | High-degree-of-freedom dexterous hand grasping planning method, device and computer equipment | |
CN110948489B (en) | Method and system for limiting safe working space of live working robot |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |