CN109333534B - Preplanned real-time gait control algorithm - Google Patents
Preplanned real-time gait control algorithm Download PDFInfo
- Publication number
- CN109333534B CN109333534B CN201811239754.7A CN201811239754A CN109333534B CN 109333534 B CN109333534 B CN 109333534B CN 201811239754 A CN201811239754 A CN 201811239754A CN 109333534 B CN109333534 B CN 109333534B
- Authority
- CN
- China
- Prior art keywords
- joint
- robot
- obstacle
- coordinate system
- axis
- 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.)
- Expired - Fee Related
Links
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
-
- 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/1628—Programme controls characterised by the control loop
- B25J9/163—Programme controls characterised by the control loop learning, adaptive, model based, rule based expert control
-
- 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/1679—Programme controls characterised by the tasks executed
-
- 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/1694—Programme controls characterised by use of sensors other than normal servo-feedback from position, speed or acceleration sensors, perception control, multi-sensor controlled systems, sensor fusion
- B25J9/1697—Vision controlled systems
Landscapes
- Engineering & Computer Science (AREA)
- Robotics (AREA)
- Mechanical Engineering (AREA)
- Manipulator (AREA)
Abstract
本发明公开了一种预规划的实时步态控制算法,通过在双足机器人控制器的控制下,先建立双足机器人运动学坐标系模型,然后进行机器人的姿态规划和平稳性判断,最终完成步态行走,实时规划下一步的姿态,以保证机器人行走的稳定性。在算法的复杂度方面,需要的信息量少,方法简单;在算法的时效性方面,因为本发明需要的信息量少,实施的复杂度低,从而降低了算法的处理时间;在实际应用方面,本算法能够其能够结合机器人与地形的实际特点,预先设计出机器人每一步的动作使机器人按照计划完成相应的动作,并且通过实时采集前方图像信息进行避障,保证了行走的成功率。
The invention discloses a pre-planned real-time gait control algorithm. Under the control of a biped robot controller, a biped robot kinematic coordinate system model is first established, and then the robot posture planning and stability judgment are performed, and the final completion is completed. Gait walking, real-time planning of the next posture to ensure the stability of the robot's walking. In terms of the complexity of the algorithm, the amount of information required is small, and the method is simple; in terms of the timeliness of the algorithm, because the amount of information required by the present invention is small, the complexity of implementation is low, thereby reducing the processing time of the algorithm; in terms of practical application , this algorithm can combine the actual characteristics of the robot and the terrain, pre-design the action of each step of the robot so that the robot can complete the corresponding action according to the plan, and collect the front image information in real time to avoid obstacles, which ensures the success rate of walking.
Description
技术领域technical field
本发明涉及步态算法技术领域,具体涉及一种预规划的实时步态控制算法。The invention relates to the technical field of gait algorithms, in particular to a pre-planned real-time gait control algorithm.
背景技术Background technique
机器人集中了多种学科的最新研究成果,代表机电一体化的最高技术水平,为人工智能领域提供实践的机会。并且双足机器人作为灵活性、适应性最高的机器人之一,具有能够代替人类在恶劣环境下工作的潜力,成为国内外研究的热点。步态规划有利于提升机器人的稳定步行能力,因此对此方面的研究具有十分重要的意义。目前常见的步态算法有:圆规步态算法、三维线性倒立摆模型、捕获点理论等,总结目前已有技术可分为两类。第一类模型简单,易于计算,但其稳定性较差;第二类稳定性强,能量消耗少,但其计算繁杂,计算量巨大。The robot concentrates the latest research results of various disciplines, represents the highest technical level of mechatronics, and provides opportunities for practice in the field of artificial intelligence. Moreover, as one of the most flexible and adaptable robots, bipedal robots have the potential to replace humans in harsh environments, and have become a research hotspot at home and abroad. Gait planning is beneficial to improve the stable walking ability of robots, so the research in this area is of great significance. At present, common gait algorithms include: compass gait algorithm, three-dimensional linear inverted pendulum model, capture point theory, etc. The existing technologies can be divided into two categories. The first type of model is simple and easy to calculate, but its stability is poor; the second type of model has strong stability and low energy consumption, but its calculation is complicated and the amount of calculation is huge.
因此,如何提供一种计算简便而又稳定性较强的步态算法成为本领域技术人员目前需要解决的问题。Therefore, how to provide a gait algorithm with simple calculation and strong stability has become a problem that those skilled in the art need to solve at present.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提出一种预规划的实时步态控制算法,在保证稳定性前提下,尽可能地简化算法。The purpose of the present invention is to propose a pre-planned real-time gait control algorithm, which simplifies the algorithm as much as possible under the premise of ensuring stability.
为了实现上述任务,本发明采用以下技术方案:In order to realize the above-mentioned tasks, the present invention adopts the following technical solutions:
一种预规划的实时步态控制算法,包括以下步骤:A pre-planned real-time gait control algorithm includes the following steps:
步骤1,建立双足机器人运动学坐标系模型Step 1, establish the kinematic coordinate system model of the biped robot
所述的双足机器人身上的关节处安装有驱动关节旋转的舵机,其中在机器人腿部的裸关节具有前向关节和侧向关节,膝关节具有前向关节,髋关节具有前向关节、侧向关节及水平旋转关节;The joints on the biped robot are equipped with steering gears that drive the rotation of the joints, wherein the bare joints of the robot legs have forward joints and lateral joints, the knee joints have forward joints, and the hip joints have forward joints, Lateral joints and horizontal rotation joints;
步骤1.1,对机器人的各个关节进行编号,对于关节i,确定该关节的原点,原点确定的原则为:Step 1.1, number each joint of the robot. For joint i, determine the origin of the joint. The principle of origin determination is:
当关节i的轴线与关节i+1的轴线相交时,取交点作为关节i的原点,当关节i的轴线与关节i+1的轴线异面时,取两条轴线公垂线与关节i+1轴线的交点作为关节i的原点;当关节i的轴线与关节i+1的轴线平行时,取关节i+1轴线与关节i+2轴线的公垂线与关节i+1轴线交点作为关节i的原点,记为Oi;When the axis of joint i intersects with the axis of joint i+1, take the intersection point as the origin of joint i; when the axis of joint i and the axis of joint i+1 are out of plane, take the common perpendiculars of the two axes and joint i+ The intersection of the 1 axis is used as the origin of the joint i; when the axis of the joint i is parallel to the axis of the joint i+1, take the intersection of the axis of the joint i+1 and the axis of the joint i+2 and the axis of the joint i+1 as the joint The origin of i is denoted as O i ;
步骤1.2,确立关节i处坐标系的各个坐标轴Xi、Yi、Zi,以在各个关节处建立坐标系,确定原则为:Step 1.2, establish each coordinate axis X i , Y i , Z i of the coordinate system at joint i to establish a coordinate system at each joint, and the determination principle is:
Zi坐标轴与关节i+1的轴线重合,Xi坐标轴沿i关节轴线、i+1关节轴线的公垂线并指向i+1关节,Yi坐标轴按右手法则确定;The Z i coordinate axis coincides with the axis of the joint i+1, the X i coordinate axis is along the i joint axis, the common perpendicular of the i+1 joint axis and points to the i+1 joint, and the Y i coordinate axis is determined according to the right-hand rule;
步骤1.3,根据在各个关节处建立的坐标系,相邻的两个坐标系Oi与Oi-1相比,获得相邻两个坐标系的差距,即变换矩阵;Step 1.3, according to the coordinate system established at each joint, compare the two adjacent coordinate systems O i with O i-1 to obtain the difference between the two adjacent coordinate systems, that is, the transformation matrix;
通过上面的变换矩阵得到相邻的两个坐标系之间的运动学关系,记双足机器人的左脚膝关节的坐标系为参考坐标系,可得到其他关节坐标系与参考坐标系之间的运动学关系;将每个关节处的坐标系与参考坐标系之间的变换矩阵作为该关节与参考坐标系所在关节之间的数学模型,所有数学模型构成双足机器人运动学坐标系模型;The kinematic relationship between the two adjacent coordinate systems is obtained through the above transformation matrix, and the coordinate system of the left knee joint of the biped robot is taken as the reference coordinate system, and the relationship between other joint coordinate systems and the reference coordinate system can be obtained. Kinematic relationship; the transformation matrix between the coordinate system at each joint and the reference coordinate system is used as the mathematical model between the joint and the joint where the reference coordinate system is located, and all mathematical models constitute the biped robot kinematics coordinate system model;
步骤2,对双足机器人的姿态进行规划Step 2: Plan the posture of the biped robot
步骤2.1,设计双足机器人行走步态流程Step 2.1, design the walking gait process of the biped robot
机器人通过摆动腿前摆改变重心,在摆动腿前摆时,身体重心从双腿中心移到支撑腿上,因此身体先要向支撑腿一侧扭动来移动重心,即通过髋关节的侧向关节来调整重心;为了防止在侧扭时抬腿而造成身体向摆动腿一侧倾倒、步态设计中将侧扭和抬腿分步设计;则机器人一次行走时的关节步态规划如下:The robot changes the center of gravity by swinging the legs forward. When swinging the legs forward, the center of gravity of the body moves from the center of the legs to the support legs. Therefore, the body must first twist to the side of the support legs to move the center of gravity, that is, through the lateral direction of the hip joint. The joints are used to adjust the center of gravity; in order to prevent the body from tipping to the side of the swinging leg when the leg is lifted during lateral twisting, the lateral twisting and leg lifting are designed in steps in the gait design; the joint gait planning of the robot when walking is as follows:
先通过右腿的髋关节、裸关节的侧向关节进行右侧扭来调整重心,侧扭到位后保持,然后左腿的裸关节、膝关节和髋关节的前向关节弯曲,以实现左腿抬起;左腿放下为相反动作,即先通过右腿的髋关节、裸关节左侧扭,然后左腿的裸关节、膝关节和髋关节的前向关节弯曲;First, adjust the center of gravity by twisting the hip joint of the right leg and the lateral joint of the bare joint to the right, and then keep the lateral twist in place, and then bend the bare joint of the left leg, the knee joint and the forward joint of the hip joint to realize the left leg. Lifting; lowering the left leg is the opposite action, that is, first twist the left side through the hip joint of the right leg and the bare joint, and then bend the bare joint of the left leg, the knee joint and the forward joint of the hip joint;
步骤2.2,规划机器人行走时各个关节的姿态Step 2.2, plan the posture of each joint when the robot walks
先假设髋关节的侧向不发生变化,则求解行走轨迹步骤如下:Assuming that the lateral direction of the hip joint does not change, the steps to solve the walking trajectory are as follows:
(1)绘制出髋关节与裸关节随时间改变而变化的曲线图,由此获得髋关节、裸关节的运动学轨迹;(1) Draw a graph of the change of the hip joint and the bare joint with time, thereby obtaining the kinematic trajectory of the hip joint and the bare joint;
(2)与人类行走轨迹进行对比,按照人类行走过程的受力情况明确机器人髋关节、裸关节运动受力的关键点,然后通过三次样条插值的方式,对所有关键点进行插值处理;(2) Compared with the human walking trajectory, according to the force of the human walking process, the key points of the robot's hip joint and bare joint movement force are identified, and then all the key points are interpolated by means of cubic spline interpolation;
(3)分别将髋关节、裸关节处理后的关键点与步骤(1)中髋关节、裸关节运动学轨迹中的多项式进行拟合,获得髋关节与裸关节的平滑轨迹;则该轨迹即为髋关节与裸关节每一步行走后形成的轨迹;(3) Fit the key points processed by the hip joint and the bare joint with the polynomials in the kinematic trajectories of the hip joint and the bare joint in step (1) to obtain a smooth trajectory of the hip joint and the bare joint; then the trajectory is The trajectory formed after each walk of the hip joint and the bare joint;
按照相同的方法,可获得机器人双腿上其他关节在行走时形成的轨迹;将双足机器人一次行走过程中所涉及的关节的轨迹作为规划姿态,则获得规划的姿态后,通过关节处的舵机驱动机器人按照规划的姿态进行行走。According to the same method, the trajectories formed by other joints on the legs of the robot during walking can be obtained; taking the trajectory of the joints involved in one walking process of the biped robot as the planned posture, after obtaining the planned posture, pass the rudder at the joints. The machine-driven robot walks according to the planned posture.
进一步地,所述的预规划的实时步态控制算法,还包括:Further, the pre-planned real-time gait control algorithm also includes:
步骤3,进行姿态规划平稳性判断Step 3, judge the stability of attitude planning
根据步骤2中的规划姿态,在机器人每次准备落脚时进行平稳性计算,判断当前机器人是否满足平稳性要求,判断依据为机器人的平稳点是否在设定的范围内,如在设定的范围内,则不干预,使机器人按照规划姿态进行行走,否则暂停行走,通过机器人的控制器调整机器人腿部的关节的姿态后,重新计算平稳性,直至平稳性满足要求,其中所述的平稳点计算方法为:According to the planned posture in step 2, the stability calculation is performed every time the robot is ready to settle down, to judge whether the current robot meets the stability requirements, and the judgment is based on whether the stable point of the robot is within the set range. If the robot is in, do not intervene and make the robot walk according to the planned posture, otherwise the walking will be suspended. After adjusting the posture of the joints of the robot's legs through the robot's controller, the stability is recalculated until the stability meets the requirements. The calculation method is:
计算机器人的质心位置:Calculate the centroid position of the robot:
其中,n表示机器人全身关节的数量,mi表示第i个关节的质量,表示第 i个关节的质心位置;COMi为第i次采样时机器人的质心位置;即当前为第i次采样;Among them, n represents the number of joints in the whole body of the robot, m i represents the mass of the ith joint, Indicates the position of the center of mass of the i-th joint; COM i is the position of the robot's center of mass in the i-th sampling; that is, the current is the i-th sampling;
计算平稳点W:Compute the stationary point W:
W=-a+COMW=-a+COM
其中,in,
上式中,ts为采样时间,COMi,COMi-1,COMi-2分别为第i次、第i-1次和第i-2次采样时机器人的质心位置,COM为机器人站立不动时的质心位置;In the above formula, t s is the sampling time, COM i , COM i-1 , COM i-2 are the position of the robot's center of mass at the i-th, i-1st and i-2th sampling times, respectively, and COM is the robot standing The position of the center of mass when not moving;
判断平稳点W的位置,若W在设定的范围内,则认为机器人此步行走稳定,否则不稳定。Determine the position of the stable point W. If W is within the set range, it is considered that the robot walks stably, otherwise it is unstable.
进一步地,所述的机器人在行走时,按照以下方法进行障碍物的判断和避障:Further, when the robot walks, it judges and avoids obstacles according to the following methods:
步骤4,在机器人的头部安装有双目摄像头,其包括左右两个单目摄像头,用于机器人前方图像信息的采集;Step 4, a binocular camera is installed on the head of the robot, which includes two left and right monocular cameras, which are used for collecting image information in front of the robot;
对双目摄像头的左右两个摄像头分别进行标定,分别计算地面在左、右摄像头坐标系下的平面方程;The left and right cameras of the binocular camera are calibrated respectively, and the plane equations of the ground in the left and right camera coordinate systems are calculated respectively;
步骤5,通过双目摄像头采集机器人前方图像;
步骤6,对左右摄像头采集的两幅图像进行畸变和极线校正,消去失真,将匹配点约束在一条直线上,减少误匹配并大大缩短匹配时间,最终匹配得到一张视差图;Step 6: Perform distortion and epipolar correction on the two images collected by the left and right cameras, eliminate the distortion, constrain the matching points on a straight line, reduce false matching and greatly shorten the matching time, and finally obtain a parallax map by matching;
步骤7,计算视差图中匹配点在左摄像头坐标系下的三维坐标(x,y,z),获取其高度与水平距离,并与设定阈值比较,判断障碍物是否存在;Step 7: Calculate the three-dimensional coordinates (x, y, z) of the matching point in the disparity map in the left camera coordinate system, obtain its height and horizontal distance, and compare with the set threshold to determine whether an obstacle exists;
此处使用OpenCV视觉库中的cvFindCon—tours轮廓检测函数检测物体的轮廓,并用其外接矩形框标记;Here, use the cvFindCon-tours contour detection function in the OpenCV vision library to detect the contour of the object and mark it with its bounding rectangle;
对障碍物的判别算法:首先随机提取视差图中外接矩形框内物体上若干个白色像素点,计算其位于左摄像机坐标系下的三维坐标(x,y,z),其中x和z分别表示物体相对于左摄像头的高度距离与水平距离,y则表示物体相对于左摄像头光心的左右偏移距离,然后根据设定的阈值判断矩形框内的物体是否为障碍物;Discrimination algorithm for obstacles: First, randomly extract several white pixels on the object in the circumscribed rectangular frame in the disparity map, and calculate its three-dimensional coordinates (x, y, z) in the left camera coordinate system, where x and z represent respectively. The height distance and horizontal distance of the object relative to the left camera, y represents the left and right offset distance of the object relative to the optical center of the left camera, and then judge whether the object in the rectangular frame is an obstacle according to the set threshold;
步骤8,如判断前方无障碍物,则使机器人按照规划的路径行进;如判断前方有障碍物,则令机器人停止动作,并获取障碍物的参数信息;
步骤9,进行避障路径规划。Step 9: Perform obstacle avoidance path planning.
进一步地,所述的对障碍物的判别算法具体包括:Further, the described algorithm for judging obstacles specifically includes:
步骤7.1,随机提取视差图中外接矩形框内若干白色像素点i=1,2,3,...,计算其三维坐标di(xi,yi,zi),并按照水平距离zi的大小排序;Step 7.1, randomly extract a number of white pixels i =1, 2 , 3 , . The size of i is sorted;
步骤7.2,取所有白色像素点水平距离zi的中位数z0,并设定阈值φ,对于所述的白色像素点,如白色像素点i的水平距离zi满足|zi-z0|>φ,则将白色像素点i作为异常点剔除,剩余白色像素点构成集合I;Step 7.2, take the median z 0 of the horizontal distance zi of all white pixels, and set the threshold φ, for the white pixel, for example, the horizontal distance zi of the white pixel i satisfies |z i -z 0 |>φ, then the white pixel i is removed as an abnormal point, and the remaining white pixels constitute the set I;
步骤7.3,计算集合I中白色像素点水平距离zi的平均值z作为外接矩形框内障碍物距离机器人的水平距离;取集合I中白色像素点三维坐标中xi的最大值 xmax作为所述障碍物的高度;Step 7.3, calculate the average value z of the horizontal distance zi of the white pixels in the set I as the horizontal distance between the obstacles in the circumscribed rectangle and the robot; take the maximum value x max of the three -dimensional coordinates of the white pixels in the set I as the the height of the obstacle;
步骤7.4,设定高度阈值xd和水平距离阈值zd,当满足xmax>xd,且时,则判定外接矩形框内的物体为障碍物。Step 7.4, set the height threshold x d and the horizontal distance threshold z d , when x max >x d is satisfied, and , the object in the bounding rectangle is determined to be an obstacle.
进一步地,所述的如判断前方无障碍物,则使机器人按照规划的路径行进;如判断前方有障碍物,则令机器人停止动作,并获取障碍物的参数信息,具体包括:Further, if it is judged that there is no obstacle ahead, the robot will travel according to the planned path; if it is judged that there is an obstacle ahead, the robot will be stopped, and the parameter information of the obstacle will be obtained, specifically including:
步骤8.1,将障碍物的外接矩形框的宽度作为障碍物的宽度,记为Q,外接矩形框的中心作为障碍物中心点,记为O;Step 8.1, take the width of the circumscribed rectangular frame of the obstacle as the width of the obstacle, denoted as Q, and the center of the circumscribed rectangular frame as the center point of the obstacle, denoted as O;
步骤8.2,通过深度检测获取O的三维坐标di(x,y,z),其中y表示中心点相对于左摄像头光心的偏移距离Li;获取外界矩形框中最左侧的一个白色像素点在左摄像头坐标系下的坐标(xL,yL,zL);Step 8.2, obtain the three-dimensional coordinates d i (x, y, z) of O through depth detection, where y represents the offset distance Li of the center point relative to the optical center of the left camera; obtain the leftmost white one in the outside rectangular frame The coordinates of the pixel in the left camera coordinate system (x L , y L , z L );
步骤8.3,根据障碍物的宽度计算出障碍物中心点O的纵坐标,即O点相对于左摄像头光心的偏移距离Lo:Step 8.3, according to the width of the obstacle, calculate the ordinate of the center point O of the obstacle, that is, the offset distance L o of the point O relative to the optical center of the left camera:
步骤8.4,由于双目摄像头安装在机器人的中轴线上,因此障碍物中心点O 相对于机器人中轴线的偏距d为:Step 8.4, since the binocular camera is installed on the central axis of the robot, the offset distance d of the center point O of the obstacle relative to the central axis of the robot is:
其中d>0表示偏右,d<0表示偏左,d=0表示居中。Where d>0 means right, d<0 means left, and d=0 means center.
进一步地,所述的进行避障路径规划,具体包括:Further, the described obstacle avoidance path planning specifically includes:
步骤9.1,设定障碍物的长度为W;Step 9.1, set the length of the obstacle as W;
步骤9.2,当障碍物相对于机器人偏左时,机器人右转角度θ并沿平行安全距离直行一段距离X,机器人中心与障碍物中心的连线与规划路径垂直时,左转角度2θ并直行距离X,使其回归规划路径;Step 9.2, when the obstacle is left relative to the robot, the robot turns right at an angle θ and goes straight for a distance X along the parallel safety distance. When the line connecting the robot center and the obstacle center is perpendicular to the planned path, turn left at an angle 2θ and go straight for a distance X, make it return to the planned path;
对于机器人的避障过程,有:For the obstacle avoidance process of the robot, there are:
上式中,L为机器人的身宽;θ和2θ为机器人的旋转角度;D为障碍物相对机器人的距离;yL为障碍物左侧边界相对于机器人中心的偏移距离;d为考虑存在的误差和安全问题所增加的补偿距离。In the above formula, L is the body width of the robot; θ and 2θ are the rotation angles of the robot; D is the distance of the obstacle relative to the robot; y L is the offset distance of the left boundary of the obstacle relative to the center of the robot; Errors and safety concerns increase the compensation distance.
本发明与现有技术相比,具有以下技术特点:Compared with the prior art, the present invention has the following technical characteristics:
1.在算法的复杂度方面,需要的信息量少,方法简单;在算法的时效性方面,因为本发明需要的信息量少,实施的复杂度低,从而降低了算法的处理时间。1. In terms of the complexity of the algorithm, the required amount of information is small, and the method is simple; in terms of the timeliness of the algorithm, because the present invention requires a small amount of information, the complexity of implementation is low, thereby reducing the processing time of the algorithm.
2.在实际应用方面,本算法能够其能够结合机器人与地形的实际特点,预先设计出机器人每一步的动作使机器人按照计划完成相应的动作,并且通过实时采集前方图像信息进行避障,保证了行走的成功率。2. In terms of practical application, this algorithm can combine the actual characteristics of the robot and the terrain, design the movements of each step of the robot in advance, so that the robot can complete the corresponding movements according to the plan, and collect the front image information in real time to avoid obstacles. success rate of walking.
3.本算法步态稳定性强,且计算简单,符合工程思想,在实际操作领域实用性很强,对双足机器人步态算法领域有一定的指导作用。3. The algorithm has strong gait stability and simple calculation, which conforms to engineering ideas. It has strong practicability in the field of practical operation, and has a certain guiding role in the field of biped robot gait algorithm.
附图说明Description of drawings
图1为本发明算法的流程示意图;Fig. 1 is the schematic flow chart of the algorithm of the present invention;
图2的(a)和(b)分别为本发明的机器人实物外形结构示意图,以及机器人上舵机安装位置示意图;(a) and (b) of Fig. 2 are respectively the physical appearance structure schematic diagram of the robot of the present invention, and the schematic diagram of the installation position of the steering gear on the robot;
图3为本算法中在关节处建立坐标系的示意图;3 is a schematic diagram of establishing a coordinate system at a joint in this algorithm;
图4为关节部分的结构示意图;Fig. 4 is the structural representation of joint part;
图5为机器人向前行走时不同步态的示意图;Fig. 5 is the schematic diagram of different synchronous states when the robot walks forward;
图6为机器人腿部在行走时偏转角度示意图;6 is a schematic diagram of the deflection angle of the robot leg when walking;
图7为机器人脚部受力示意图。FIG. 7 is a schematic diagram of the force on the foot of the robot.
图8为避障算法中障碍物轮廓检测示意图;8 is a schematic diagram of obstacle contour detection in an obstacle avoidance algorithm;
图9为避障算法的避障路径规划示意图。FIG. 9 is a schematic diagram of the obstacle avoidance path planning of the obstacle avoidance algorithm.
具体实施方式Detailed ways
如图1所示,本发明的基本思想是,通过在双足机器人控制器的控制下,先建立双足机器人运动学坐标系模型,然后进行机器人的姿态规划和平稳性判断,最终完成步态行走,实时规划下一步的姿态,以保证机器人行走的稳定性。一种预规划的实时步态控制算法,包括以下步骤:As shown in FIG. 1 , the basic idea of the present invention is that, under the control of the biped robot controller, the biped robot kinematic coordinate system model is first established, and then the robot attitude planning and stability judgment are performed, and finally the gait is completed. Walk, plan the next posture in real time to ensure the stability of the robot's walking. A pre-planned real-time gait control algorithm includes the following steps:
步骤1,建立双足机器人运动学坐标系模型Step 1, establish the kinematic coordinate system model of the biped robot
所述的双足机器人身上的关节处安装有驱动关节旋转的舵机,如图2的(a) 和(b)所示,本实施例中的双足机器人全身共有20个舵机,其中在机器人腿部分布有多处关节,通过舵机的驱动使每条腿部具有6个自由度,即:裸关节具有向前和侧向两个自由度,分别称为踝关节的前向关节和侧向关节(图2中的15、17和16、18);膝关节一个前向自由度(图2中的13、14),称为膝关节的前向关节;髋关节具有三个自由度,包括前向、侧向及水平旋转自由度,分别称为髋关节的前向关节、侧向关节和水平旋转关节(图2中的7、9、11和8、10、12)。机器人上半身中,肘关节具有一个自由度(图2中5、6);肩关节有两个自由度 (图2中的1、3和2、4),颈关节一个自由度(图2中的19),头部一个自由度 (图2中的20)。The joints on the body of the biped robot are equipped with steering gears that drive the rotation of the joints. As shown in (a) and (b) of Figure 2, the biped robot in this embodiment has a total of 20 steering gears. The legs of the robot are distributed with multiple joints, and each leg has 6 degrees of freedom through the drive of the steering gear, namely: the bare joint has two degrees of freedom forward and lateral, which are called the forward joint and the ankle joint respectively. Lateral joints (15, 17 and 16, 18 in Fig. 2); the knee joint has one forward degree of freedom (13, 14 in Fig. 2), called the anterior joint of the knee joint; the hip joint has three degrees of freedom , including the forward, lateral and horizontal rotational degrees of freedom, which are respectively called the anterior joint, lateral joint and horizontal rotational joint of the hip joint (7, 9, 11 and 8, 10, 12 in Figure 2). In the upper body of the robot, the elbow joint has one degree of freedom (5 and 6 in Figure 2); the shoulder joint has two degrees of freedom (1, 3 and 2, 4 in Figure 2), and the neck joint has one degree of freedom (Figure 2). 19), one degree of freedom for the head (20 in Figure 2).
双足机器人的关键是由活动式连接的杆件构成的,相邻的两个杆件连接处称为一个关节,如图4所示。所述的杆件是指机器人躯干上的部分,例如手肘处作为一个关节,其小臂、大臂分别视为一个杆件;在双足机器人身上,相邻的杆件之间活动式连接,使相邻的杆件之间可以发生角度变化,例如相邻的杆件连接处构成转轴式结构。所述的舵机安装在每个关节处,用于驱动关节旋转,舵机可采用例如伺服电机。The key of the biped robot is composed of movably connected rods, and the connection of two adjacent rods is called a joint, as shown in Figure 4. The rod refers to the part on the torso of the robot. For example, the elbow is used as a joint, and the forearm and the arm are regarded as a rod respectively; on a biped robot, the adjacent rods are connected movably. , so that the angle between adjacent rods can be changed, for example, the connection of adjacent rods constitutes a rotating shaft structure. The steering gear is installed at each joint to drive the joint to rotate, and the steering gear can be, for example, a servo motor.
该步骤的思路是,在机器人的每个关节处构件坐标系,通过坐标系的变换来实现关节处的两个杆件上坐标的变换;对于本方案的多关节机器人,每个关节由两个杆件组成,则机器人可看作是多杆件系统,则多次利用坐标变换,就可以建立坐标系之间的关系,从而构成运动学坐标系模型,具体步骤如下:The idea of this step is to realize the transformation of the coordinates on the two rods at the joint through the transformation of the coordinate system at each joint of the robot; for the multi-joint robot of this scheme, each joint consists of two If the robot is composed of rods, the robot can be regarded as a multi-rod system. By using the coordinate transformation multiple times, the relationship between the coordinate systems can be established to form a kinematic coordinate system model. The specific steps are as follows:
步骤1.1,对机器人的各个关节进行编号,对于关节i,确定该关节的原点,原点确定的原则为:Step 1.1, number each joint of the robot. For joint i, determine the origin of the joint. The principle of origin determination is:
当关节i的轴线(关节的旋转轴线)与关节i+1的轴线相交时,取交点作为关节i的原点,当关节i的轴线与关节i+1的轴线异面时,取两条轴线公垂线与关节i+1轴线的交点作为关节i的原点;当关节i的轴线与关节i+1的轴线平行时,取关节i+1轴线与关节i+2轴线的公垂线与关节i+1轴线交点作为关节i的原点,记为Oi。When the axis of joint i (the axis of rotation of the joint) intersects with the axis of joint i+1, take the intersection point as the origin of joint i, when the axis of joint i and the axis of joint i+1 are out of plane, take the two axes The intersection of the vertical line and the axis of joint i+1 is used as the origin of joint i; when the axis of joint i is parallel to the axis of joint i+1, take the common perpendicular of the axis of joint i+1 and the axis of joint i+2 and the axis of joint i The intersection of the +1 axis is taken as the origin of the joint i, denoted as O i .
步骤1.2,确立关节i处坐标系的各个坐标轴Xi、Yi、Zi,以在各个关节处建立坐标系,确定原则为:Step 1.2, establish each coordinate axis X i , Y i , Z i of the coordinate system at joint i to establish a coordinate system at each joint, and the determination principle is:
Zi坐标轴与关节i+1的轴线重合,Xi坐标轴沿i关节轴线、i+1关节轴线的公垂线并指向i+1关节,Yi坐标轴按右手法则确定。The Z i coordinate axis coincides with the axis of the joint i+1, the X i coordinate axis is along the i joint axis, the common perpendicular of the i+1 joint axis and points to the i+1 joint, and the Y i coordinate axis is determined according to the right-hand rule.
如图3所示,本方案中将双足机器人的左脚膝关节(前向关节)的坐标系 O0-X0Y0Z0为参考坐标系,左脚踝关节坐标系为O6-X6Y6Z6,右脚膝关节的坐标系为O12-X12Y12Z12。后两者为虚拟坐标系,仅为计算结果提供辅助和参考。As shown in Figure 3, in this scheme, the coordinate system O 0 -X 0 Y 0 Z 0 of the left knee joint (forward joint) of the biped robot is the reference coordinate system, and the coordinate system of the left ankle joint is O 6 -X 6 Y 6 Z 6 , the coordinate system of the right knee joint is O 12 -X 12 Y 12 Z 12 . The latter two are virtual coordinate systems, which only provide assistance and reference for calculation results.
按照上述方法,在机器人各个关节处建立了坐标系。According to the above method, a coordinate system is established at each joint of the robot.
步骤1.3,根据在各个关节处建立的坐标系,相邻的两个坐标系Oi与Oi-1(即关节i处的坐标系和关节i-1处的坐标系)相比,存在的差距为则相邻的坐标系Oi与Oi-1之间的变换矩阵为:Step 1.3, according to the coordinate system established at each joint, the two adjacent coordinate systems O i are compared with O i-1 (that is, the coordinate system at joint i and the coordinate system at joint i-1). The gap is Then the transformation matrix between adjacent coordinate systems O i and O i-1 is:
上式中,s表示坐标系Oi-1到坐标系Oi的距离,c表示坐标系Oi-1到坐标系 Oi的角度,ai-1表示Xi到Xi+1的距离,di表示Xi到坐标系Oi的测量距离,θi表示从Xi到Xi-1转动的角度。由于一个关节i对应一个杆件,因此通过上述矩阵可求得相邻杆件之间的运动学关系。In the above formula, s represents the distance from the coordinate system O i-1 to the coordinate system O i , c represents the angle from the coordinate system O i-1 to the coordinate system O i , and a i-1 represents the distance from X i to X i+1 , d i represents the measured distance from X i to the coordinate system O i , and θ i represents the rotation angle from X i to X i-1 . Since one joint i corresponds to one rod, the kinematic relationship between adjacent rods can be obtained through the above matrix.
通过上面的变换矩阵得到相邻的两个坐标系之间的运动学关系,由此得到左脚踝关节坐标系O6-X6Y6Z6与参考坐标系O0-X0Y0Z0之间的运动学关系,同理可得到其他关节坐标系与参考坐标系之间的运动学关系。The kinematic relationship between the two adjacent coordinate systems is obtained through the above transformation matrix, thereby obtaining the left ankle joint coordinate system O 6 -X 6 Y 6 Z 6 and the reference coordinate system O 0 -X 0 Y 0 Z 0 In the same way, the kinematic relationship between other joint coordinate systems and the reference coordinate system can be obtained.
本方案中,将每个关节处的坐标系与参考坐标系之间的变换矩阵作为该关节与参考坐标系所在关节之间的数学模型,所有数学模型构成双足机器人运动学坐标系模型。In this scheme, the transformation matrix between the coordinate system at each joint and the reference coordinate system is used as the mathematical model between the joint and the joint where the reference coordinate system is located, and all the mathematical models constitute the biped robot kinematics coordinate system model.
步骤2,对双足机器人的姿态进行规划Step 2: Plan the posture of the biped robot
在本方案中,人形机器人的姿态规划则是建立在所建立的机器人运动学坐标系模型上的,即是以各关节在步骤1所建立的运动学坐标系模型中的坐标来表示,具体实施步骤如下:In this scheme, the posture planning of the humanoid robot is based on the established robot kinematics coordinate system model, that is, it is represented by the coordinates of each joint in the kinematics coordinate system model established in step 1. Proceed as follows:
步骤2.1,设计双足机器人行走步态流程Step 2.1, design the walking gait process of the biped robot
为使规划易于进行,将前向行走步态设计分为重心右移(先是右腿支撑)、左腿抬起、重心移到双腿中间、重心左移、右腿抬起、右腿放下、重心移到双腿间八个阶段,示意图如图5所示。In order to make the planning easy, the forward walking gait design is divided into right shift of the center of gravity (right leg support first), left leg lift, center of gravity shift to the middle of the legs, left shift of gravity center, right leg lifted, right leg lowered, The center of gravity is moved to eight stages between the legs, as shown in Figure 5.
本方案的步态规划是通过摆动腿(抬起的腿)前摆改变重心的,在摆动腿前摆时,身体重心从双腿中心移到支撑腿上,因此身体先要向支撑腿(与地面接触的腿)一侧扭动来移动重心,即通过髋关节的侧向关节来调整重心;为了防止在侧扭时抬腿而造成身体向摆动腿一侧倾倒、步态设计中将侧扭和抬腿分步设计。以先抬起左脚为例,机器人一次行走时的关节步态规划如下:The gait planning of this scheme is to change the center of gravity by swinging the leg (raised leg) forward. When the swinging leg swings forward, the body's center of gravity moves from the center of the legs to the supporting leg. The ground-contacting leg) twists on one side to move the center of gravity, that is, adjusts the center of gravity through the lateral joint of the hip joint; in order to prevent the body from tipping to the side of the swinging leg due to lifting the leg during lateral twisting, the lateral twisting is used in the gait design. and leg lift step-by-step design. Taking raising the left foot first as an example, the joint gait planning of the robot during one walk is as follows:
先通过右腿的髋关节、裸关节的侧向关节进行右侧扭来调整重心,侧扭到位后保持,然后抬起左腿(摆动腿),具体为:左腿的裸关节、膝关节和髋关节的前向关节弯曲,以实现左腿抬起;左腿放下为相反动作,即先通过右腿的髋关节、裸关节左侧扭,然后左腿的裸关节、膝关节和髋关节的前向关节弯曲(弯曲方向与抬起时相反),此时左脚落地;右腿抬起、落地同理。First, adjust the center of gravity by twisting the right side of the hip joint of the right leg and the lateral joint of the bare joint, keep the lateral twist in place, and then lift the left leg (swing leg), specifically: the naked joint of the left leg, knee joint and The forward joint of the hip joint is bent to achieve the lift of the left leg; the lowering of the left leg is the opposite action, that is, the left leg is twisted through the hip joint of the right leg and the bare joint first, and then the bare joint of the left leg, the knee joint and the hip joint are twisted on the left side. The forward joint is bent (the direction of bending is opposite to that of lifting), and the left foot is on the ground at this time; the same is true for lifting and landing of the right leg.
步骤2.2,规划机器人行走时各个关节的姿态Step 2.2, plan the posture of each joint when the robot walks
前向运动即是机器人腿部向前或先后摆动,侧向运动即是机器人腿部向左或向右摆动,对前向与侧向运动进行分别建模,完成机器人的前向行走规划。The forward motion means that the robot's legs swing forward or successively, and the lateral motion means that the robot's legs swing left or right. The forward and lateral movements are modeled separately to complete the forward walking plan of the robot.
前向运动由四个侧向关节和六个前向关节(左右裸关节、髋关节的侧向关节,左右裸关节、膝关节、髋关节的前向关节)的协调运动来实现,通过侧向关节的运动来移动机构的重心,双腿的前向关节的协调运动使机器人向前行走,具体实现如下:The forward movement is achieved by the coordinated movement of four lateral joints and six forward joints (left and right bare joints, lateral joints of the hip joint, left and right bare joints, knee joints, and forward joints of the hip joint). The movement of the joints moves the center of gravity of the mechanism, and the coordinated movement of the forward joints of the legs makes the robot walk forward. The specific implementation is as follows:
对机器人双腿的关节旋转角度进行定义,θ1代表的是左腿从下到上的偏转角度;θ2代表的是左腿从上到下的偏转角度;θ3代表的是右腿从下到上的偏转角度;θ4代表的左腿从上到下的偏转角度,示意图见图6;则在前向运动中,由θ1、θ2、θ3、θ4运动实现。Define the joint rotation angle of the robot's legs. θ 1 represents the deflection angle of the left leg from bottom to top; θ 2 represents the deflection angle of the left leg from top to bottom; θ 3 represents the right leg from bottom. The deflection angle to the top; the deflection angle of the left leg from top to bottom represented by θ 4 , the schematic diagram is shown in Figure 6; then in the forward motion, it is realized by the motion of θ 1 , θ 2 , θ 3 , and θ 4 .
先假设髋关节的侧向不发生变化,也就是四个关节(即左右腿的髋关节的两个转弯关节和侧向关节)的侧向偏转角度均为0,则求解向前或向后运动的方程的步骤如下,以髋关节与踝关节为例:Assuming that the lateral direction of the hip joint does not change, that is, the lateral deflection angles of the four joints (that is, the two turning joints and the lateral joints of the hip joints of the left and right legs) are all 0, then solve the forward or backward movement The steps of the equation are as follows, taking the hip and ankle joints as an example:
(1)绘制出髋关节与裸关节随时间改变而变化的曲线图(即建立在步骤1坐标系上的二维曲线图),由此获得髋关节、裸关节的运动学轨迹;(1) Draw the curve diagram of the hip joint and the bare joint changing with time (that is, the two-dimensional curve diagram established on the coordinate system of step 1), thereby obtaining the kinematic trajectory of the hip joint and the bare joint;
(2)与人类行走轨迹进行对比,按照人类行走过程的受力情况明确机器人髋关节、裸关节运动受力的关键点,然后通过三次样条插值的方式,对所有关键点进行插值处理;(2) Compared with the human walking trajectory, according to the force of the human walking process, the key points of the robot's hip joint and bare joint movement force are identified, and then all the key points are interpolated by means of cubic spline interpolation;
(3)分别将髋关节、裸关节处理后的关键点与步骤(1)中髋关节、裸关节运动学轨迹中的多项式进行拟合,获得髋关节与裸关节的平滑轨迹;则该轨迹即为髋关节与裸关节每一步行走后形成的轨迹。(3) Fit the key points processed by the hip joint and the bare joint with the polynomials in the kinematic trajectories of the hip joint and the bare joint in step (1) to obtain a smooth trajectory of the hip joint and the bare joint; then the trajectory is The trajectory formed after each walk for the hip and bare joints.
按照相同的方法,可获得机器人双腿上其他关节在行走时形成的轨迹;将双足机器人一次行走(左脚从抬起到放下为一次行走)过程中所涉及的关节的轨迹作为规划姿态,则获得规划的姿态后,通过关节处的舵机驱动机器人按照规划的姿态进行行走。According to the same method, the trajectories formed by other joints on the legs of the robot during walking can be obtained; the trajectory of the joints involved in the process of one walking of the biped robot (from raising to lowering the left foot) is used as the planning posture, After obtaining the planned posture, the robot is driven by the steering gear at the joint to walk according to the planned posture.
在机器人每次落脚时会处于一定的不稳定状态,因此还需要进行稳定性判断,根据稳定性判断的结果,对机器人的落脚点进行反馈调节。Every time the robot lands, it will be in a certain unstable state, so it is necessary to make a stability judgment. According to the result of the stability judgment, feedback adjustment is made to the landing point of the robot.
步骤3,进行姿态规划平稳性判断Step 3, judge the stability of attitude planning
地面反作用力对脚部的影响是复杂的,本方案中将其简化成有任意一点P,而地面的反作用力对脚部的贡献可以等价为一个力R与力矩M。而零力矩点的定义就是在地面上存在一点P,使得与地面平行轴方向的、由惯性力(F=ma) 与重力(G=mg)所产生的净力矩为零的点。图7给出了机器人脚部所受作用力分布的例子,沿足底分布的负载具有相同的方向,他们等效于一个合力N,合力 N所通过的在足底上的这个作用点被称为平稳点。该点可以理解为重力和惯性力的合力在地面上的投影,而且在这一点上合力的力矩在水平方向为零。The influence of the ground reaction force on the foot is complex. In this scheme, it is simplified to have any point P, and the contribution of the ground reaction force to the foot can be equivalent to a force R and a moment M. The definition of a zero moment point is that there is a point P on the ground such that the net moment generated by inertial force (F=ma) and gravity (G=mg) in the direction of the axis parallel to the ground is zero. Figure 7 shows an example of the force distribution on the foot of the robot. The loads distributed along the sole have the same direction, and they are equivalent to a resultant force N. The action point on the sole of the foot through which the resultant force N passes is called for a stable point. This point can be understood as the projection of the resultant force of gravity and inertial force on the ground, and the moment of the resultant force at this point is zero in the horizontal direction.
根据步骤2中的规划姿态,在机器人每次准备落脚时进行平稳性计算,判断当前机器人是否满足平稳性要求,判断依据为机器人的平稳点是否在设定的范围内,如在设定的范围内,则不干预,使机器人按照规划姿态进行行走,否则暂停行走,通过机器人的控制器调整机器人腿部的关节(髋关节、膝关节、裸关节) 的姿态后,重新计算平稳性,直至平稳性满足要求,其中所述的平稳点计算方法为:According to the planned posture in step 2, the stability calculation is performed every time the robot is ready to settle down, to judge whether the current robot meets the stability requirements, and the judgment is based on whether the stable point of the robot is within the set range. If the robot is inside, do not intervene and make the robot walk according to the planned posture, otherwise it will suspend walking, adjust the posture of the joints of the robot legs (hip joint, knee joint, bare joint) through the robot controller, and recalculate the stability until it is stable The stability meets the requirements, and the calculation method of the stationary point is as follows:
计算机器人的质心位置:Calculate the centroid position of the robot:
其中,n表示机器人全身关节的数量,本实施例中n=20;mi表示第i个关节的质量,表示第i个关节的质心位置(在步骤1建立的坐标系中的位置);COMi为第i次采样时机器人的质心位置;即当前为第i次采样;Among them, n represents the number of joints in the whole body of the robot, n=20 in this embodiment; m i represents the quality of the ith joint, Indicates the position of the center of mass of the ith joint (the position in the coordinate system established in step 1); COM i is the position of the center of mass of the robot during the ith sampling; that is, it is currently the ith sampling;
计算平稳点W:Compute the stationary point W:
W=-a+COMW=-a+COM
其中,in,
上式中,ts为采样时间,COMi,COMi-1,COMi-2分别为第i次、第i-1次和第i-2次采样时机器人的质心位置,COM为机器人站立不动时的质心位置。In the above formula, t s is the sampling time, COM i , COM i-1 , COM i-2 are the position of the robot's center of mass at the i-th, i-1st and i-2th sampling times, respectively, and COM is the robot standing The position of the centroid when not moving.
判断平稳点W的位置,若W在设定的范围内,则认为机器人此步行走稳定,否则不稳定。本实施例中,所述的设定范围为机器人抬脚后脚中心在地面投影点前后-5~5cm范围。Determine the position of the stable point W. If W is within the set range, it is considered that the robot walks stably, otherwise it is unstable. In this embodiment, the setting range is a range of -5 to 5 cm before and after the projection point on the ground from the center of the foot after the robot lifts the foot.
综上所述,本方案通过对人体步行轨迹的模仿来预先设计双足机器人的步态规划,按照先姿态规划后稳定性判断,预先规划出机器人完整的姿态,实现实时步态控制。To sum up, this scheme pre-designs the gait planning of the biped robot by imitating the human walking trajectory. According to the posture planning first and then the stability judgment, the complete posture of the robot is pre-planned to realize real-time gait control.
本方案提出的预规划的实时步态控制算法解决了机器人正常行走的问题,避开了传统算法的复杂与繁琐,预先设计出机器人每一步的动作使机器人按照计划完成相应的动作,保证了行走的成功率。The pre-planned real-time gait control algorithm proposed in this scheme solves the problem of normal walking of the robot, avoids the complexity and tediousness of traditional algorithms, and pre-designs the movements of each step of the robot so that the robot can complete the corresponding movements according to the plan, ensuring the walking. success rate.
在上述技术方案的基础上,机器人按照规划姿态行走时,采用下面的方法进行障碍物的判断和避障:On the basis of the above technical solutions, when the robot walks according to the planned posture, the following methods are used to judge and avoid obstacles:
步骤4,在机器人的头部安装有双目摄像头,其包括左右两个单目摄像头,用于机器人前方图像信息的采集;Step 4, a binocular camera is installed on the head of the robot, which includes two left and right monocular cameras, which are used for collecting image information in front of the robot;
对双目摄像头的左右两个摄像头分别进行标定,分别计算地面在左、右摄像头坐标系下的平面方程;The left and right cameras of the binocular camera are calibrated respectively, and the plane equations of the ground in the left and right camera coordinate systems are calculated respectively;
步骤5,通过双目摄像头采集机器人前方图像;
步骤6,对左右摄像头采集的两幅图像(左右摄像头同时分别采集一张图像) 进行畸变和极线校正,消去失真,将匹配点约束在一条直线上,减少误匹配并大大缩短匹配时间,最终匹配得到一张视差图;Step 6: Perform distortion and epipolar correction on the two images collected by the left and right cameras (one image is collected by the left and right cameras at the same time), eliminate the distortion, constrain the matching points to a straight line, reduce false matching and greatly shorten the matching time, and finally Match to get a disparity map;
步骤7,计算视差图中匹配点在左摄像头坐标系下的三维坐标(x,y,z),获取其高度与水平距离,并与设定阈值比较,判断障碍物是否存在;Step 7: Calculate the three-dimensional coordinates (x, y, z) of the matching point in the disparity map in the left camera coordinate system, obtain its height and horizontal distance, and compare with the set threshold to determine whether an obstacle exists;
此处使用OpenCV视觉库中的cvFindCon—tours轮廓检测函数检测物体的轮廓,并用其外接矩形框标记,如图8所示。根据其中的白色像素点,利用双目视觉测距原理计算出物体相对左摄像头坐标系下的三维坐标。Here, the contour detection function of cvFindCon-tours in the OpenCV vision library is used to detect the contour of the object and mark it with its bounding rectangle, as shown in Figure 8. According to the white pixels, the three-dimensional coordinates of the object relative to the left camera coordinate system are calculated using the binocular vision ranging principle.
对障碍物的判别算法:首先随机提取视差图中外接矩形框内物体上若干个白色像素点,计算其位于左摄像机坐标系下的三维坐标(x,y,z),其中x和z分别表示物体相对于左摄像头的高度距离与水平距离,y则表示物体相对于左摄像头光心的左右偏移距离,然后根据设定的阈值判断矩形框内的物体是否为障碍物。Discrimination algorithm for obstacles: First, randomly extract several white pixels on the object in the circumscribed rectangular frame in the disparity map, and calculate its three-dimensional coordinates (x, y, z) in the left camera coordinate system, where x and z represent respectively. The height distance and horizontal distance of the object relative to the left camera, y represents the left and right offset distance of the object relative to the optical center of the left camera, and then judge whether the object in the rectangular frame is an obstacle according to the set threshold.
具体步骤如下:Specific steps are as follows:
步骤7.1,随机提取视差图中外接矩形框内若干白色像素点i=1,2,3,...,计算其三维坐标di(xi,yi,zi),并按照水平距离zi(即三维坐标中的zi值)的大小排序;Step 7.1, randomly extract a number of white pixels i =1, 2 , 3 , . The size ordering of i (that is, the zi value in three-dimensional coordinates);
步骤7.2,因为提取和计算过程中存在误差,所以可能存在异常数据,因此取所有白色像素点水平距离zi的中位数z0,并设定阈值φ,对于所述的白色像素点,如白色像素点i的水平距离zi满足|zi-z0|>φ,则将白色像素点i作为异常点剔除,剩余白色像素点构成集合I;Step 7.2, because there are errors in the extraction and calculation process, there may be abnormal data, so take the median z 0 of the horizontal distance zi of all white pixels, and set the threshold φ, for the white pixels, as The horizontal distance zi of the white pixel i satisfies |z i -z 0 |>φ, then the white pixel i is removed as an abnormal point, and the remaining white pixels constitute the set I;
步骤7.3,计算集合I中白色像素点水平距离zi的平均值作为外接矩形框内障碍物距离机器人的水平距离;取集合I中白色像素点三维坐标中xi的最大值 xmax作为所述障碍物的高度;Step 7.3, calculate the average value of the horizontal distance zi of the white pixels in the set I As the horizontal distance of the obstacle from the robot in the circumscribed rectangular frame; take the maximum value x max of x i in the three-dimensional coordinates of the white pixel point in the set I as the height of the obstacle;
步骤7.4,设定高度阈值xd和水平距离阈值zd,当满足xmax>xd,且时,则判定外接矩形框内的物体为障碍物。Step 7.4, set the height threshold x d and the horizontal distance threshold z d , when x max >x d is satisfied, and , the object in the bounding rectangle is determined to be an obstacle.
步骤8,如判断前方无障碍物,则使机器人按照规划的路径行进;如判断前方有障碍物,则令机器人停止动作,并获取障碍物的参数信息,具体如下:
步骤8.1,将障碍物的外接矩形框的宽度作为障碍物的宽度,记为Q,外接矩形框的中心作为障碍物中心点,记为O;Step 8.1, take the width of the circumscribed rectangular frame of the obstacle as the width of the obstacle, denoted as Q, and the center of the circumscribed rectangular frame as the center point of the obstacle, denoted as O;
步骤8.2,通过深度检测获取(即通过双目摄像头检测)O的三维坐标 di(x,y,z),其中y表示中心点相对于左摄像头光心的偏移距离Li;获取外界矩形框中最左侧的一个白色像素点在左摄像头坐标系下的坐标(xL,yL,zL);Step 8.2, obtain the three-dimensional coordinates d i (x, y, z) of O through depth detection (that is, detect by the binocular camera), wherein y represents the offset distance Li of the center point relative to the optical center of the left camera; obtain the outside rectangle The coordinates of the leftmost white pixel in the frame in the left camera coordinate system (x L , y L , z L );
步骤8.3,根据障碍物的宽度计算出障碍物中心点O的纵坐标,即O点相对于左摄像头光心的偏移距离Lo:Step 8.3, according to the width of the obstacle, calculate the ordinate of the center point O of the obstacle, that is, the offset distance L o of the point O relative to the optical center of the left camera:
步骤8.4,由于双目摄像头安装在机器人的中轴线上,因此障碍物中心点O 相对于机器人中轴线的偏距d为:Step 8.4, since the binocular camera is installed on the central axis of the robot, the offset distance d of the center point O of the obstacle relative to the central axis of the robot is:
其中d>0表示偏右,d<0表示偏左,d=0表示居中。Where d>0 means right, d<0 means left, and d=0 means center.
步骤9,进行避障路径规划
步骤9.1,设定障碍物的长度为W;Step 9.1, set the length of the obstacle as W;
在障碍物检测过程中,已经能够比较精确地获得障碍物的宽度尺寸及其相对于机器人的方位信息,但是较难得到障碍的长度尺寸,一般假设其长度为W;In the process of obstacle detection, the width of the obstacle and its orientation information relative to the robot can be obtained relatively accurately, but it is difficult to obtain the length of the obstacle. Generally, its length is assumed to be W;
步骤9.2,当障碍物相对于机器人偏左时,为了能更快绕过障碍物,根据障碍物的位置及实验室环境的不同,设置一个恒定的安全距离,机器人右转角度θ并沿平行安全距离直行一段距离X,机器人中心与障碍物中心的连线与规划路径垂直时,左转角度2θ并直行距离X,使其回归规划路径;障碍物偏右和居中时同理,障碍物偏右时机器人左转,障碍物居中时随机选择左转或右转,不再赘述;示意图如图9所示:在图中,L为机器人的身宽;θ和2θ为机器人的旋转角度; D为障碍物相对机器人的距离;yL为障碍物左侧边界相对于机器人中心的偏移距离;d为考虑存在的误差和安全问题所增加的补偿距离(一般取d=yL)。Step 9.2, when the obstacle is to the left of the robot, in order to bypass the obstacle faster, set a constant safety distance according to the position of the obstacle and the laboratory environment, the robot turns right at an angle θ and follows the parallel safety distance. Go straight for a distance X, when the connection between the robot center and the obstacle center is perpendicular to the planned path, turn left at an angle of 2θ and go straight for a distance X to make it return to the planned path; the same is true when the obstacle is to the right and the center is to the right, the obstacle is to the right When the robot turns left, when the obstacle is centered, it randomly chooses to turn left or right, and I will not repeat it; the schematic diagram is shown in Figure 9: in the figure, L is the body width of the robot; θ and 2θ are the rotation angles of the robot; D is the The distance between the obstacle and the robot; y L is the offset distance of the left boundary of the obstacle relative to the center of the robot; d is the compensation distance added considering the existing errors and safety issues (generally d=y L ).
对于机器人的避障过程,有:For the obstacle avoidance process of the robot, there are:
至此则可完成障碍检测和避障路径规划。So far, obstacle detection and obstacle avoidance path planning can be completed.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811239754.7A CN109333534B (en) | 2018-10-23 | 2018-10-23 | Preplanned real-time gait control algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811239754.7A CN109333534B (en) | 2018-10-23 | 2018-10-23 | Preplanned real-time gait control algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109333534A CN109333534A (en) | 2019-02-15 |
CN109333534B true CN109333534B (en) | 2021-12-17 |
Family
ID=65311403
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811239754.7A Expired - Fee Related CN109333534B (en) | 2018-10-23 | 2018-10-23 | Preplanned real-time gait control algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109333534B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110371213A (en) * | 2019-07-12 | 2019-10-25 | 沈阳城市学院 | A kind of biped robot's walking planning and control method |
CN110834685B (en) * | 2019-09-29 | 2021-05-28 | 中国北方车辆研究所 | Method for quadruped robot to dynamically cross concave obstacle |
CN113050616B (en) * | 2019-12-27 | 2024-09-06 | 深圳市优必选科技股份有限公司 | Control method for walking of biped robot and biped robot |
CN111515954B (en) * | 2020-05-06 | 2021-08-20 | 大连理工大学 | A method for generating high-quality motion paths for robotic arms |
CN112180958B (en) * | 2020-09-23 | 2022-08-19 | 北航歌尔(潍坊)智能机器人有限公司 | Robot and motion coordination method, control device and readable storage medium thereof |
CN112220650B (en) * | 2020-12-09 | 2021-04-16 | 南京伟思医疗科技股份有限公司 | Online step generation control system for exoskeleton robot contralateral training |
CN112731953B (en) * | 2020-12-24 | 2024-07-19 | 深圳市优必选科技股份有限公司 | Robot control method and device, computer readable storage medium and robot |
CN112731952B (en) * | 2020-12-24 | 2022-03-01 | 深圳市优必选科技股份有限公司 | Robot centroid planning method and device, readable storage medium and robot |
CN114700948B (en) * | 2022-04-20 | 2023-07-18 | 中国科学技术大学 | Control system of lower extremity exoskeleton robot based on divergent motion components |
CN114954723B (en) * | 2022-04-22 | 2024-08-09 | 上海清宝引擎机器人有限公司 | Humanoid robot |
CN118915773A (en) * | 2024-08-12 | 2024-11-08 | 合肥工业大学 | Model predictive control-based obstacle avoidance method for humanoid robot |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4184679B2 (en) * | 2001-08-01 | 2008-11-19 | 本田技研工業株式会社 | Method for estimating floor reaction force of bipedal mobile body and method for estimating joint moment of bipedal mobile body |
JP3646169B2 (en) * | 2002-05-07 | 2005-05-11 | 独立行政法人産業技術総合研究所 | Walking controller for legged robot |
JP4810880B2 (en) * | 2005-05-10 | 2011-11-09 | トヨタ自動車株式会社 | Robot and its control method |
KR101687631B1 (en) * | 2010-01-18 | 2016-12-20 | 삼성전자주식회사 | Walking control apparatus of robot and method for controlling the same |
JP5859036B2 (en) * | 2014-02-04 | 2016-02-10 | 本田技研工業株式会社 | robot |
CN105608309B (en) * | 2015-12-11 | 2019-08-02 | 杭州南江机器人股份有限公司 | A kind of biped robot's walking planning and control method |
CN105938499A (en) * | 2016-01-08 | 2016-09-14 | 浙江大学 | Coordinate system establishment method of 3D biped robot |
CN105965506A (en) * | 2016-05-16 | 2016-09-28 | 北京格分维科技有限公司 | Humanoid biped robot walking posture control method based on genetic algorithm |
CN106176149A (en) * | 2016-09-08 | 2016-12-07 | 电子科技大学 | A kind of ectoskeleton gait analysis system based on multi-sensor fusion and method |
CN108009680A (en) * | 2017-11-30 | 2018-05-08 | 航天科工智能机器人有限责任公司 | Humanoid robot gait's planing method based on multi-objective particle swarm algorithm |
-
2018
- 2018-10-23 CN CN201811239754.7A patent/CN109333534B/en not_active Expired - Fee Related
Non-Patent Citations (2)
Title |
---|
仿人机器人的步态规划和步行控制研究;付根平;《中国博士学位论文全文数据库信息科技辑》;20130915;第19-22、32-60页 * |
基于双目视觉的AGV障碍物检测与避障;王铮等;《计算机集成制造系统》;20180730;第400-409页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109333534A (en) | 2019-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109333534B (en) | Preplanned real-time gait control algorithm | |
CN109333506B (en) | Humanoid intelligent robot system | |
CN107901041B (en) | A Robot Vision Servo Control Method Based on Image Mixing Moment | |
KR102714127B1 (en) | Climbing up and down stairs with a robot | |
CN107562052B (en) | Hexapod robot gait planning method based on deep reinforcement learning | |
CN111673755B (en) | Picking robot control system and method based on visual servo | |
US7912583B2 (en) | Environment map building method, environment map building apparatus and mobile robot apparatus | |
US20120155775A1 (en) | Walking robot and simultaneous localization and mapping method thereof | |
KR100981698B1 (en) | Legged mobile robot | |
CN109648558B (en) | Robot curved surface motion positioning method and motion positioning system thereof | |
CN111123911B (en) | Legged intelligent star catalogue detection robot sensing system and working method thereof | |
CN109604777A (en) | Welding seam traking system and method based on laser structure light | |
CN110744541A (en) | Vision-guided underwater mechanical arm control method | |
CN113362396A (en) | Mobile robot 3D hand-eye calibration method and device | |
CN109910011A (en) | A multi-sensor based obstacle avoidance method for a robotic arm and a robotic arm | |
CN101574586A (en) | Shuttlecock robot and control method thereof | |
WO2022000713A1 (en) | Augmented reality self-positioning method based on aviation assembly | |
CN113751981B (en) | Space high-precision assembling method and system based on binocular vision servo | |
CN114299039B (en) | Robot and collision detection device and method thereof | |
CN108098134A (en) | A kind of new pattern laser vision weld joint tracking system and method | |
CN111258311A (en) | Obstacle avoidance method of underground mobile robot based on intelligent vision | |
CN106777876A (en) | A kind of rotating the arc weld seam tracking system information processing method for robot | |
CN110928311A (en) | A Navigation Method for Indoor Mobile Robots Based on Linear Features under Panoramic Cameras | |
CN114842079B (en) | Equipment and method for measuring pose of prefabricated intermediate wall in shield tunnel | |
CN207650650U (en) | Heavily loaded multi-foot robot based on deep vision navigation |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20211217 |