The present invention relates to the technical fields of robotic arm motion capture and robotic arm reality synchronization operation, and in particular to motion capture method and system of a robotic arm, a medium, and an electronic device.
One of the most significant challenges facing the application of robotic arms in industrial production, medicine, and other industries is how to operate the robotic arms. Compared with operations through computer instructions and joysticks, an operation mode of implementing reality synchronization through human motion capture is simpler, more direct, and efficient. Currently used non-contact motion capture is mostly vision-based technology to mark human body parts, track human motion, and therefore control a remote robotic arm through pose analysis and the like. However, there is the problem of marker occlusion, the accuracy of visual acquisition data in dark environment is greatly reduced, and poses cannot be obtained accurately under the impact of light brightness. A mode of vision-based motion capture is greatly limited.
For dynamic robotic arm motion capture, it is more straightforward to track the human body through an exoskeleton sensing system. However, a contact operation mode hinders human motion and is not conducive to actual operations. In a markerless non-contact tracking method, an inertial sensor may be used to obtain pose information of human motion. In inertial navigation, navigation parameters at a current moment are calculated by using known information at a previous moment and measurement information at a current moment. This process is continuously repeated. With the presence of external interference and sensing errors, errors occur in all steps of calculation, and the errors in inertial navigation accumulate over time. Therefore, in the use of a combined navigation mode, a state at a next moment can be predicted to the maximum extent by fusing acquired data.
A data fusion method with knowledge transfer based on a Kalman filter (KF) is used by combining motion capture modes of vision and inertial sensors. The basic principle of transfer learning is to use knowledge information in a source domain to improve learning in a target domain, and transfer learning has been researched in many fields such as autonomous driving, computer vision, and sensor networks. A human motion state can be accurately predicted by using this data fusion method with knowledge transfer to implement motion capture of markerless reality synchronization of robotic arms. However, little research has been conducted in this area.
A technical problem to be resolved by the present invention is to provide a robotic arm motion capture method that takes deficiencies in visual sensing and inertial sensing into comprehensive consideration and uses visual sensing as a source domain by using the concept of transfer learning to improve a target domain of inertia sensing, thereby improving prediction accuracy.
To resolve the foregoing problem, the present invention provides a motion capture method of a robotic arm, including the following steps:
S1. fastening a visual sensor on a robotic arm to acquire data as a source domain, fastening an inertial sensor on a corresponding human arm to acquire data as a target domain, and establishing a state space expression of a system;
S2. setting an optimal unknown state observed joint distribution based on the state space expression and by using a total probability theory and using an observed prediction distribution of the source domain as a condition, decomposing a conditional joint observed distribution model, and solving an optimal distribution by using KL divergence; and
S3. transferring knowledge of the source domain measured by the visual sensor into the target domain measured by the inertial sensor based on a KF and the total probability theory, performing data fusion based on Kalman filtering, and predicting a state of the system at a next moment to implement motion capture of the robotic arm.
As a further improvement to the present invention, in step 1, the state space expression of the system established for motion capture of a human body is as follows:
Xi=AXi−1Bui−1+wi−1 (1),
Zi=CXi+vi (2), and
Zi,s=CsXi+vi,s (3),
where a motion angle θi and an angular velocity {dot over (θ)}i in a process of arm motion form a state matrix Xi of the system, Zi is a measurement matrix of the target domain measured by the inertial sensor of the system, and Zi,s is a measurement matrix of the source domain of the system; A, B, C, and Cs are determined by parameter requirements of the system, and μi−1 is a control input of the system; and wi−1 is process noise of the system, and vi and vi,s are measurement noise, both assumed to be Gaussian white noise meeting that an average value is zero.
As a further improvement to the present invention, step S2 includes:
S21. setting the optimal unknown state observed joint distribution by using the total probability theory and using the observed prediction distribution fs of the source domain as the condition as follows:
m(Xi,Zi|fs)=m(Zi|Xi,fs)m(Xi|fs) (4), and
where it is defined that an ideal state observed distribution model is:
S22. decomposing the conditional joint observed distribution model into:
where it is assumed that m(zi|Xi, Zi−1, fs)≡fs(zi,s|Zi−1,s)|z
m(Xn,Zn|fs)=fs(Zn)m(Xn|fs) (8),
where fs(Zn) is knowledge information that needs to be transferred from the source domain into the target domain, and under a condition that fs(Zn) is fixed and known, m(Xn|fs) becomes the only part that allows design optimization; and
S23. solving the optimal distribution by using KL divergence as:
where γ(xi−1) is a normalization function.
As a further improvement to the present invention, step S3 includes:
S31. assuming that the arm motion in the motion capture of the robotic arm meets a linear Gaussian case as follows:
f(xi|xi−1)≡Nx
f(zi|xi)≡Nz
f(zi,s|xi)≡Nz
performing explicit recursive calculation according to Kalman filtering to obtain a corresponding state prior distribution, a corresponding state posterior distribution, and observed prior distribution, as follows:
f(xi|xi−1)≡Nx
f(xi|zi−1)≡Nx
f(zi|zi−1)≡Nz
f(zi,s|zi−1,s)≡Nz
S32. according to the total probability theory, under a condition that fs(Zn) is fixed and known, mo(Xn|fs) is a target domain state prediction optimal distribution, where γ(xi−1) is a normalization function, that is:
deriving the normalization function according to the observed prediction distribution:
and
where a parameter recursion form of
is:
ri−1|i=AT(In
Si−1|i=AT(In
it is satisfied that when i=n−1, . . . , 2, ri|i=ri|i+1+CTR−1Zi|i−1,s, Si|i=CTR−1C, when i=n, rn|n=CTR−1Zn|n−1,s, Sn|n=CTR−1C, recursion of the normalization function represents dynamic transfer of observed information at n moments of the source domain, and the target domain obtains an optimal distribution under this condition; and
S33. obtaining the state prediction optimal distribution of the target domain according to a recursion representation form of the normalization function obtained in step S31:
mo(xi|xi−1,fs)=Nx
where
and an optimal state a priori predicted distribution after transfer of knowledge from the source domain to the target domain for fusion may be obtained according to Formula (14) of the state prior distribution of the KF:
The present invention further provides a computer-readable storage medium, the storage medium including a stored program, where the program performs the foregoing robotic arm motion capture method.
The present invention further provides an electronic device, including: one or more processors, a memory, and one or more programs, where the one or more programs are stored in the memory and are configured to be performed by the one or more processors, and the one or more programs are used for performing the foregoing robotic arm motion capture method.
The present invention further provides a motion capture system of a robotic arm, including the following modules:
a state space expression establishment module, configured to: fasten a visual sensor on a robotic arm to acquire data as a source domain, fasten an inertial sensor on a corresponding human arm to acquire data as a target domain, and establish a state space expression of a system;
an optimal distribution solving module, configured to: set an optimal unknown state observed joint distribution based on the state space expression and by using a total probability theory and using an observed prediction distribution of the source domain as a condition, decompose a conditional joint observed distribution model, and solve an optimal distribution by using KL divergence; and
a motion capture module, configured to: transfer knowledge of the source domain measured by the visual sensor into the target domain measured by the inertial sensor based on a KF and by combining the total probability theory, perform data fusion based on Kalman filtering, and predict a state of the system at a next moment to implement motion capture of the robotic arm.
As a further improvement to the present invention, the state space expression of the system established for motion capture of a human body is as follows:
Xi=AXi−1Bui−1+wi−1 (1),
Zi=CXi+vi (2), and
Zi,s=CsXi+vi,s (3),
where a motion angle θi and an angular velocity {dot over (θ)}i in a process of arm motion form a state matrix Xi of the system, Zi is a measurement matrix of the target domain measured by the inertial sensor of the system, and Zi,s is a measurement matrix of the source domain of the system; A, B, C, and Cs are determined by parameter requirements of the system, and ui−1 is a control input of the system; and wi−1 is process noise of the system, and vi and vi,s are measurement noise, both assumed to be Gaussian white noise meeting that an average value is zero.
As a further improvement to the present invention, the optimal distribution solving module is configured to perform the following steps:
S21. setting the optimal unknown state observed joint distribution by using the total probability theory and using the observed prediction distribution fs of the source domain as the condition as follows:
m(Xi,Zi|fs)=m(Zi|Xi,fs)m(Xi|fs) (4), and
where it is defined that an ideal state observed distribution model is:
S22. decomposing the conditional joint observed distribution model into:
where it is assumed that m(zi|Xi, Zi−1, fs)≡fs(zi,s|Zi−1,s)|z
m(Xn,Zn|fs)=fs(Zn)m(Xn|fs) (8),
where fs(Zn) is knowledge information that needs to be transferred from the source domain into the target domain, and under a condition that fs(Zn) is fixed and known, m(Xn|fs) becomes the only part that allows design optimization; and
S23. solving the optimal distribution by using KL divergence as:
where γ(xi−1) is a normalization function.
As a further improvement to the present invention, the motion capture module is configured to perform the following steps:
S31. assuming that the arm motion in the motion capture of the robotic arm meets a linear Gaussian case as follows:
f(xi|xi−1)≡Nx
f(zi|xi)≡Nz
f(zi,s|xi)≡Nz
performing explicit recursive calculation according to Kalman filtering to obtain a corresponding state prior distribution, a corresponding state posterior distribution, and observed prior distribution, as follows:
f(xi|xi−1)≡Nx
f(xi|zi−1)≡Nx
f(zi|zi−1)≡Nz
f(zi,s|zi−1,s)≡Nz
S32. according to the total probability theory, under a condition that fs(Zn) is fixed and known, mo(Xn|fs) is a target domain state prediction optimal distribution, where γ(xi−1) is a normalization function, that is:
deriving the normalization function according to the observed prediction distribution:
where a parameter recursion form of
is:
ri−1|i=AT(In
Si−1|i=AT(In
it is satisfied that when i=n−1, . . . , 2, ri|i=ri|i+1+CTR−1Zi|i−1,s, Si|i=CTR−1C, when i=n, rn|n=CTR−1Zn|n−1,s, Sn|n=CTR−1C, recursion of the normalization function represents dynamic transfer of observed information at n moments of the source domain, and the target domain obtains an optimal distribution under this condition; and
S33. obtaining the sate prediction optimal distribution of the target domain according to a recursion representation form of the normalization function obtained in step S31:
and an optimal state a priori predicted distribution after transfer of knowledge from the source domain to the target domain for fusion may be obtained according to Formula (14) of the state prior distribution of the KF:
The beneficial effects of the invention are as follows:
The robotic arm motion capture method provides in the present invention takes deficiencies in visual sensing and inertial sensing into comprehensive consideration and uses visual sensing as a source domain by using the concept of transfer learning to improve a target domain of inertia sensing, thereby improving prediction accuracy.
The above description is only an overview of the technical solutions of the present invention. For a clearer understanding of the technical measure of the present invention and implementation according to the content of the specification, and to make the above and other objectives, features, and advantages of the present invention clearer and more comprehensible, detailed description is provided as follows with reference to preferred embodiments and the accompanying drawings.
The present invention is further described below with reference to the accompanying drawings and specific embodiments, to enable a person skilled in the art to better understand and implement the present invention. However, the embodiments are not used to limit the present invention.
As shown in
S1. Fasten a visual sensor on a robotic arm to acquire data as a source domain, fasten an inertial sensor on a corresponding human arm to acquire data as a target domain, and establish a state space expression of a system.
For a human hand of motion capture required for a robotic arm, the three-dimensional position and direction of the center of mass of the hand are used for controlling the position and direction of a robot end effector, as shown in
The quaternion satisfies q02+q12+q22+q32=1. A state space expression of a robotic arm motion capture model is established as follows according to the quaternion method:
Xi=AXi−1Bui−1+wi−1 (1),
Zi=CXi+vi (2), and
Zi,s=CsXi+vi,s (3),
where X, =[q0,i, q1,i, q2,i, q3,i, wx,i, wy,i, wz,i]T, a motion angle θi and an angular velocity {dot over (θ)}i in a process of arm motion form a state matrix X of the system, Zi is a measurement matrix of the target domain measured by the inertial sensor of the system, and Zi,s is a measurement matrix of the source domain of the system; A, B, C, and Cs are determined by parameter requirements of the system, and ui−1 is a control input of the system; and wi−1 is process noise of the system, satisfying a Gaussian distribution N(0, Q), and vi and vi,s are measurement noise, satisfying a Gaussian distribution N(0, R), N(0, Rs), both assumed to be Gaussian white noise meeting that an average value is zero.
Measurement matrices of the target domain and the source domain:
State transfer matrix:
S2. Set an optimal unknown state observed joint distribution based on the state space expression and by using a total probability theory and using an observed prediction distribution of the source domain as a condition, decompose a conditional joint observed distribution model, and solve an optimal distribution by using KL divergence.
S21. Set the optimal unknown state observed joint distribution by using the total probability theory and using the observed prediction distribution fs of the source domain as the condition as follows:
m(Xi,Zi|fs)=m(Zi|Xi,fs)m(Xi|fs) (4), and
where it is defined that an ideal state observed distribution model is:
S22. Decompose the conditional joint observed distribution model into:
where it is assumed that m(zi|Xi, Zi−1, fs)≡fs(zi,s|Zi−1,s)|z
m(Xn,Zn|fs)=fs(Zn)m(Xn|fs) (8),
where fs(Zn) is knowledge information that needs to be transferred from the source domain into the target domain, and under a condition that fs(Zn) is fixed and known, m(Xn|fs) becomes the only part that allows design optimization.
S23. Solve the optimal distribution by using KL divergence as:
where γ(xi−1) is a normalization function.
S3. Transfer knowledge of the source domain measured by the visual sensor into the target domain measured by the inertial sensor based on a KF and by combining the total probability theory, perform data fusion based on Kalman filtering, and predict a state of the system at a next moment to implement motion capture of the robotic arm, specifically including:
S31. Assume that the arm motion in the motion capture of the robotic arm meets a linear Gaussian case as follows:
f(xi|xi−1)≡Nx
f(zi|xi)≡Nz
f(zi,s|xi)≡Nz
perform explicit recursive calculation according to Kalman filtering to obtain a corresponding state prior distribution, a corresponding state posterior distribution, and observed prior distribution, as follows:
f(xi|xi−1)≡Nx
f(xi|zi−1)≡Nx
f(zi|zi−1)≡Nz
f(zi,s|zi−1,s)≡Nz
S32. According to the total probability theory, under a condition that fs(Zn) is fixed and known, mo(Xn|fs) is a target domain state prediction optimal distribution, where γ(xi−1) is a normalization function, that is:
deriving the normalization function according to the observed prediction distribution:
and
where a parameter recursion form of
is:
ri−1|i=AT(In
Si−1|i=AT(In
it is satisfied that when i=n−1, . . . , 2, ri|i=ri|i+1+CTR−1Zi|i−1,s, Si|i=CTR−1C, when i=n, rn|n=CTR−1Zn|n−1,s, Sn|n=CTR−1C, recursion of the normalization function represents dynamic transfer of observed information at n moments of the source domain, and the target domain obtains an optimal distribution under this condition.
S33. Obtain the state prediction optimal distribution of the target domain according to a recursion representation form of the normalization function obtained in step S31:
and an optimal state a priori predicted distribution after transfer of knowledge from the source domain to the target domain for fusion may be obtained according to Formula (14) of the state prior distribution of the KF:
Through Formulas (18), (21), (22), and (23), a total probability design algorithm of knowledge transfer based on a KF may be obtained, specifically:
A. Source domain knowledge transfer:
1. When i=n, rn|n=CTR−1zn|n−1,s, Sn|n=CTR−1C:
Substitute rn|n, Sn|n into Formulas (19) and (20) to obtain rn−1|n, Sn−1|n.
2. When i=n−1, . . . , 2, ri|i=ri|i+1+CTR−1zi|i−1,s, Si|i=Si|i+1+CTR−1C
Substitute into Formulas (19) and (20) to obtain ri−1|i, Si−1|i.
B. Target domain state prediction
1. When i=1, an a priori initial value μ1|0, Σ1|0 is set to obtain μ1|1, Σ1|1.
2. When i=2, . . . , n:
Substitute μi−|i−1, Σi|i−1 into Formulas (22) and (23) to obtain μi|i−1, Σi|i−1.
Substitute μi|i−1, Σi|i−1 into Formula (16) to obtain μi|i, Σi|i.
Referring to steps S2 and S3, through the use of the total probability design algorithm of knowledge transfer based on a KF, under a condition of transferring measured prediction knowledge of a source domain, state prediction of a target domain is improved, and measurement data of the target domain is fused to obtain a state estimation value with a better tracking effect to perform effective object tracking, thereby implementing better motion capture. Simulation is performed by using an iterative algorithm, and comparison is made with a conventional method. Root-mean-square deviation indicators (mean norm squared-errors, MNSEs) according to different source domain measurement noise Rs are used for comparison. For the obtained results and simulated diagram, reference is made to
An experimental method of reference comparison is used in a whole simulation process to compare the tracking effects of a case in which the present invention is not used and a case in which dynamic knowledge transfer of the present invention is used. A conventional KF method is compared with the method in the present invention in the case of different measurement noise covariance matrices in a source domain. As can be seen
The motion capture method of robotic arm provides in the present invention takes deficiencies in visual sensing and inertial sensing into comprehensive consideration and uses visual sensing as a source domain by using the concept of transfer learning to improve a target domain of inertia sensing, thereby improving prediction accuracy.
Further disclosed in a preferred embodiment of the present invention is a computer-readable storage medium, the storage medium including a stored program, where the program performs the motion capture method of robotic arm in Embodiment 1.
Further disclosed in a preferred embodiment of the present invention is an electronic device. The electronic device includes: one or more processors, a memory, and one or more programs, where the one or more programs are stored in the memory and are configured to be performed by the one or more processors, and the one or more programs are used for performing the motion capture method of robotic arm in Embodiment 1.
Further disclosed in a preferred embodiment of the present invention is a motion capture system of a robotic arm, including the following modules:
a state space expression establishment module, configured to: fasten a visual sensor on a robotic arm to acquire data as a source domain, fasten an inertial sensor on a corresponding human arm to acquire data as a target domain, and establish a state space expression of a system;
an optimal distribution solving module, configured to: set an optimal unknown state observed joint distribution based on the state space expression and by using a total probability theory and using an observed prediction distribution of the source domain as a condition, decompose a conditional joint observed distribution model, and solve an optimal distribution by using KL divergence; and
a motion capture module, configured to: transfer knowledge of the source domain measured by the visual sensor into the target domain measured by the inertial sensor based on a KF and by combining the total probability theory, perform data fusion based on Kalman filtering, and predict a state of the system at a next moment to implement motion capture of the robotic arm.
The state space expression of the system established for motion capture of a human body is as follows:
Xi=AXi−1Bui−1+wi−1 (1),
Zi=CXi+vi (2), and
Zi,s=CsXi+vi,s (3),
where a motion angle θi and an angular velocity {dot over (θ)}i in a process of arm motion form a state matrix Xi of the system, Zi is a measurement matrix of the target domain measured by the inertial sensor of the system, and Zi,s is a measurement matrix of the source domain of the system; A, B, C, and Cs are determined by parameter requirements of the system, and ui−1 is a control input of the system; and wi−1 is process noise of the system, and vi and vi,s are measurement noise, both assumed to be Gaussian white noise meeting that an average value is zero.
The optimal distribution solving module is configured to perform the following steps:
S21. Set the optimal unknown state observed joint distribution by using the total probability theory and using the observed prediction distribution fs of the source domain as the condition as follows:
m(Xi,Zi|fs)=m(Zi|Xi,fs)m(Xi|fs) (4), and
where it is defined that an ideal state observed distribution model is:
S22. Decompose the conditional joint observed distribution model into:
where it is assumed that m(zi|Xi, Zi−1, fs)≡fs(zi,s|Zi−1,s)|z
m(Xn,Zn|fs)=fs(Zn)m(Xn|fs) (8),
where fs(Zn) is knowledge information that needs to be transferred from the source domain into the target domain, and under a condition that fs(Zn) is fixed and known, m(Xn|fs) becomes the only part that allows design optimization.
S23. Solve the optimal distribution by using KL divergence as:
where γ(xi−1) is a normalization function.
The motion capture module is configured to perform the following steps:
S31. Assume that the arm motion in the motion capture of the robotic arm meets a linear Gaussian case as follows:
f(xi|xi−1)≡Nx
f(zi|xi)≡Nz
f(zi,s|xi)≡Nz
perform explicit recursive calculation according to Kalman filtering to obtain a corresponding state prior distribution, a corresponding state posterior distribution, and observed prior distribution, as follows:
f(xi|xi−1)≡Nx
f(xi|zi−1)≡Nx
f(zi|zi−1)≡Nz
f(zi,s|zi−1,s)≡Nz
S32. According to the total probability theory, under a condition that fs(Zn) is fixed and known, mo(Xn|fs) is a target domain state prediction optimal distribution, where γ(xi−1) is a normalization function, that is:
derive the normalization function according to the observed prediction distribution:
and
where a parameter recursion form of
is:
ri−1|i=AT(In
Si−1|i=AT(In
it is satisfied that when i=n−1, . . . , 2, ri|i=ri|i+1+CTR−1Zi|i−1,s, Si|i=CTR−1C, when i=n, rn|n=CTR−1Zn|n−1,s, Sn|n=CTR−1C, recursion of the normalization function represents dynamic transfer of observed information at n moments of the source domain, and the target domain obtains an optimal distribution under this condition.
S33. Obtain the state prediction optimal distribution of the target domain according to a recursion representation form of the normalization function obtained in step S31:
and an optimal state a priori predicted distribution after transfer of knowledge from the source domain to the target domain for fusion may be obtained according to Formula (14) of the state prior distribution of the KF:
The motion capture system of robotic arm in the embodiments of the present invention is configured to implement the foregoing robotic arm motion capture method. Therefore, for specific implementations of the system, reference may be made to the embodiment part of the robotic arm motion capture method above. Therefore, for specific implementations of the system, reference may be made to the description of corresponding embodiment parts. Details are not described again herein.
In addition, the robotic arm motion capture system in this embodiment is configured to implement the foregoing robotic arm motion capture method. Therefore, the functions of the system correspond to the functions of the foregoing method. Details are not described again herein.
The foregoing embodiments are merely preferred embodiments used to fully describe the present invention, and the protection scope of the present invention is not limited thereto. Equivalent replacements or variations made by a person skilled in the art to the present invention all fall within the protection scope of the present invention. The protection scope of the present invention is as defined in the claims.
Number | Date | Country | Kind |
---|---|---|---|
202210228647.4 | Mar 2022 | CN | national |
This application is a Continuation Application of PCT/CN2022/099469, filed on Jun. 17, 2022, which claims priority to Chinese Patent Application No. 202210228647.4, filed on Mar. 8, 2022, which is incorporated by reference for all purposes as if fully set forth herein.
Number | Name | Date | Kind |
---|---|---|---|
11254002 | Ebrahimi Afrouzi et al. | Feb 2022 | B1 |
20150217444 | Asada | Aug 2015 | A1 |
Number | Date | Country |
---|---|---|
103112007 | May 2013 | CN |
106182003 | Dec 2016 | CN |
111890373 | Nov 2020 | CN |
114454174 | May 2022 | CN |
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2022/099469 | Jun 2022 | US |
Child | 18083507 | US |