A method for continuous selection and online re-anchoring of motion capture joint quaternion equivalent branches

By calculating the correlation between relative quaternions and historical states, selecting a continuous equivalent representation and performing online re-anchoring correction, the problem of discontinuous joint motion caused by quaternion equivalent branch switching is solved, thus achieving stability and continuity in robot joint control.

CN123137205APending Publication Date: 2026-11-20SUZHOU CHIEN SHIUNG INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611282599.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In the fields of robot teleoperation and human motion capture, the switching of equivalent branches of quaternions leads to discontinuity in joint motion control. Existing technologies cannot effectively identify erroneous branches and restore correct control, resulting in abrupt changes or a sense of lag in robot execution.

Method used

By calculating the correlation between relative quaternions and historical states, a continuous equivalent representation is selected, and online re-anchoring correction is performed when erroneous branches are identified, ensuring that the joint control angle recovers to the correct direction within the same processing cycle.

Benefits of technology

It enables continuous selection of quaternion equivalent branches, avoids abrupt changes in joint angles and step-like sensations, is suitable for long-running robot teleoperation processes, and reduces the impact of abnormal data on control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123137205A_ABST
    Figure CN123137205A_ABST
Patent Text Reader

Abstract

The application discloses a kind of continuous selection and online re-anchor method of motion capture joint quaternion equivalent branch, based on the posture quaternion of target joint proximal and distal bone segment, relative quaternion is calculated, after normalization, it is associated with historical state, continuous relative quaternion is selected from equivalent representation, and then joint control angle is obtained;Joint control angle is compared with preset range, and the continuous error candidate frame that exceeds range is counted or timed, only when it continuously satisfies preset condition, it is confirmed to enter error equivalent branch;Immediately, overall sign change is executed to historical relative quaternion, and complementary angle correction is implemented to current joint control angle to return to normal working area, finally, robot execution target is mapped and output.The application avoids quaternion equivalent representation ambiguity, and improves robot joint control accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robot joint control technology, and in particular to a method for continuous selection and online re-anchoring of equivalent branches of motion capture joint quaternions. Background Technology

[0002] In the fields of robot teleoperation and human motion capture, operators typically wear inertial motion capture gloves or other motion capture equipment. A motion capture computer fuses and calculates data from various posture sensing units to obtain posture quaternions for bone segments such as the palm and finger bones. Then, a control computing device maps the human joint movements into target control quantities for each execution channel of the robot (e.g., a dexterous hand). Quaternions are widely used to represent the spatial posture of bone segments due to their advantages such as the absence of gimbal singularities and smooth interpolation.

[0003] However, the quaternion q and its four components changing sign as a whole to obtain -q represent the same physical rotation. That is, the quaternion representation of attitude has inherent sign ambiguity, and the same physical attitude corresponds to two mathematically equivalent quaternion branches. The motion capture solution may switch between two equivalent representations during continuous output; if the downstream control directly calculates the joint angle from the quaternion of a single frame, the switching of equivalent representations will be interpreted as a non-physical jump in the joint angle, causing the robot to abruptly change its execution target.

[0004] The existing technology has at least the following disadvantages: (1) The conventional mapping from data gloves to dexterous hands usually assumes that the input angle direction is always correct and cannot identify that the upstream posture interpretation has entered the wrong branch; (2) Simply normalizing or interpolating the quaternion can only improve the numerical smoothness and cannot guarantee that the same physical posture will always choose the same equivalent representation in consecutive frames; (3) Although using absolute value folding of quaternion symbols can avoid some jumps, it will reverse the bending of joints that actually exceed the half-circumference boundary, causing the control quantity to change in the opposite direction after bending to the bottom; (4) When relying solely on the previous frame to select consecutive branches, once the historical state is affected by long-term operation or abnormal data and enters the complementary angle branch, the error will continue to propagate and can often only be recovered by restarting the process; (5) Fixed dead zone will suppress jitter when stationary, but may also cause active small continuous movements to produce a step-like feeling or lag. Summary of the Invention

[0005] Objective of the invention: To address the aforementioned problems in the prior art, this invention provides a method for continuous selection and online re-anchoring of quaternion equivalent branches of motion capture joints, enabling the motion capture joint attitude to remain continuous when the quaternion equivalent sign changes; when a historical continuous state enters an erroneous complementary angle branch, the erroneous branch is identified based on the target joint working domain and abnormal persistence conditions, and the historical relative attitude state and the joint control quantity of the current frame are synchronously corrected within the same processing cycle, thereby restoring the correct control direction without interrupting motion capture data reception.

[0006] Technical solution: A method for continuous selection and online re-anchoring of equivalent branches of motion capture joint quaternions, comprising the following steps:

[0007] S1. Perform a validity check on the sampled frames, and obtain the proximal bone segment pose quaternion and distal bone segment pose quaternion of the target joint according to the valid sampled frames.

[0008] S2. Calculate the relative quaternion of the current frame based on the proximal bone segment pose quaternion and the distal bone segment pose quaternion;

[0009] S3. Calculate the historical correlation between the relative quaternion of the current frame and the previous valid relative quaternion saved by the target joint. Select the one that is closer to the historical state from the equivalent quaternions representing the same spatial pose as the continuous relative quaternion of the current frame.

[0010] S4. Calculate the joint control angle of the target joint in the current frame based on the continuous relative quaternion;

[0011] S5. Compare the joint control angle with the normal working range, error candidate threshold, or complementary angle range of the target joint. When the joint control angle is not in the normal working range or complementary angle range, or exceeds the error candidate threshold, determine that the current frame is an error candidate frame and enter the error candidate state. Count or accumulate the duration of consecutively occurring error candidate frames. Only when the error candidate state continuously meets the preset duration condition is it confirmed that the current continuous state has entered the error equivalent branch and needs to be re-anchored.

[0012] S6. In the same processing cycle that confirms entry into the erroneous equivalent branch, perform an overall sign change or adopt a branch correction operation equivalent to the overall sign change on the historical relative quaternion used for the continuity judgment of the next frame, and perform complementary angle correction on the joint control angle of the current frame so that the corrected joint control angle returns to the normal working domain.

[0013] S7. Map the corrected joint control angle, or the joint control angle when the erroneous equivalent branch is not confirmed, to the execution target of the corresponding execution channel of the robot and output it. If the current frame is invalid, use the previous valid execution target; if the current frame is valid, update the historical record of the execution target of the target joint.

[0014] Further, in step S2, calculating the relative quaternion of the current frame includes: normalizing the proximal bone segment pose quaternion and the distal bone segment pose quaternion to unit quaternions respectively; taking the inverse of the normalized proximal bone segment pose quaternion and performing a quaternion multiplication operation with the normalized distal bone segment pose quaternion to obtain the relative quaternion of the current frame.

[0015] Furthermore, in step S3, the calculation of historical correlation involves calculating the four-dimensional dot product of the relative quaternion of the current frame and the previous valid relative quaternion; when the four-dimensional dot product is less than zero, the four components of the relative quaternion of the current frame are changed to the same sign to obtain the continuous relative quaternion; when the four-dimensional dot product is greater than or equal to zero, the relative quaternion of the current frame is directly used as the continuous relative quaternion.

[0016] Furthermore, when the target joint has not yet saved the previous valid relative quaternion, the relative quaternion of the first valid sampling frame is normalized, and after selecting the initial sign according to the preset normalization rule, it is saved as the previous valid relative quaternion; the preset normalization rule includes making the scalar part of the relative quaternion non-negative.

[0017] Furthermore, in step S4, the calculation of the joint control angle includes: taking the scalar part of the continuous relative quaternion, limiting the scalar part to the closed interval [-1, 1], and performing an inverse cosine operation on the limited scalar part to obtain the joint control angle with a value range of [0, π]; or, using an equivalent angle quantity that has a monotonically corresponding relationship with the scalar part as the joint control angle.

[0018] Furthermore, in step S5, the normal working domain is the range of joint control angles within which the target joint can move normally; the complementary angle interval is the angle interval outside the normal working domain formed by the complementary transformation of the joint control angles that can move normally; the error candidate threshold is set outside the normal working domain to determine whether the joint control angle deviates abnormally from the boundary value of the normal working domain; the preset duration condition is: the number of consecutive frames in which the error candidate state appears reaches a preset frame number threshold, or the duration of the error candidate state reaches a preset duration threshold; when the joint control angle of any sampled frame is within the normal working domain, or when any sampled frame is an invalid frame, the accumulated number of error candidate frames or the duration is cleared to zero.

[0019] Further, in step S6, the complementary angle correction involves replacing the joint control angle of the current frame with the difference between π and the joint control angle of the current frame; after performing the complementary angle correction, the error candidate count is cleared to zero; the transformed historical relative quaternion state is used for historical correlation calculation in the next frame, and the corrected joint control angle is used for execution target mapping in the current frame. The branch correction operation equivalent to the overall sign change is to use other transformations that do not change the actual physical attitude but can switch the historical state from the incorrect mathematical representation branch to the correct mathematical representation branch.

[0020] Furthermore, the validity check in step S1 includes: when any component of the proximal bone segment pose quaternion or the distal bone segment pose quaternion is a non-finite number, the modulus is not greater than the effective modulus threshold, or the sampling frame parsing fails, the sampling frame is determined to be an invalid frame; for invalid frames, the previous valid relative quaternion is not updated, and the previous valid execution target output of the target joint is maintained.

[0021] Further, in step S7, the mapping includes: linearly mapping the joint control angle based on the target joint's motion capture opening calibration angle, motion capture closing calibration angle, execution channel opening calibration target, and execution channel closing calibration target; wherein, firstly, the joint control angle is limited to the range defined by the motion capture opening calibration angle and the motion capture closing calibration angle, so that joint control angles exceeding the calibration range are mapped to the opening endpoint or closing endpoint, and then the mapping result is limited to the execution channel safety target range; when the mechanical direction of the execution channel is opposite to the joint bending direction, the execution channel opening calibration target and the execution channel closing calibration target are exchanged; for nonlinear transmission mechanisms, piecewise mapping or lookup table mapping that maintains the endpoint and monotonic relationship is used instead of the linear mapping.

[0022] Furthermore, the method is applied in parallel to multiple target joints; each target joint maintains a mutually isolated state record, which includes: the previous valid relative quaternion, the previous valid joint control angle, the previous valid execution target, the error candidate count or cumulative duration, the historical benchmark establishment flag, and the input calibration range, output calibration range, and orientation configuration of the target joint; when any target joint experiences invalid input or online re-anchoring, the state records saved by other target joints are not changed.

[0023] Beneficial effects: (1) Continuous branch selection: Based on the correlation between the current relative quaternion and the previous effective relative quaternion, the one that is continuous with the historical state is selected from the two equivalent representations. The overall sign change of the quaternion of the same physical attitude will not directly become a joint angle mutation, thus maintaining the continuity of the attitude representation of adjacent control frames.

[0024] (2) First calculate the relative posture between adjacent bone segments, and then obtain the joint angle from the continuous relative quaternion. The common spatial motion of the operator's adjacent bone segments will not be completely superimposed on the single joint flexion and extension target. The obtained control quantity corresponds more directly to the relative motion of the target joint.

[0025] (3) Instead of using simple absolute value folding of angles or quaternion components, mathematical equivalent representation is chosen and the relative rotation direction is retained. The actual joint movement can still change continuously along the original direction after crossing intermediate angles such as π / 2, thus avoiding the return of the target quantity when bending deeply.

[0026] (4) Error branch determination uses the target joint working domain and the number of consecutive abnormal frames or duration. Single frame noise, network jitter or short-term high-angle spikes will not immediately trigger re-anchoring, reducing the risk of misjudging normal limit bending as an error branch.

[0027] (5) After confirming the erroneous branch, the current angle of this frame and the historical relative quaternion used for the continuity judgment of the next frame are corrected at the same time. The output of this frame returns to the correct working domain, and the next frame is referenced by the corrected historical state, which avoids the abnormality from repeatedly appearing in subsequent frames when only the current output is corrected.

[0028] (6) Online re-anchoring is completed within the data reception and mapping loop, without stopping the motion capture service, restarting the acquisition node, or re-establishing the status of all channels, making it suitable for long-term continuous robot teleoperation processes;

[0029] (7) Invalid quaternions, failed parsing frames or discontinuous frames will not be interpreted as zero corners, but the previous valid execution target will be maintained and the error candidate count will be reset. Communication or acquisition abnormalities will not necessarily cause the dexterous hand to suddenly open or close or accidentally trigger the re-anchor.

[0030] (8) The left and right hands, different joints and execution channels respectively save the historical posture, candidate count and the previous valid target. An anomaly or re-anchoring of one channel will not modify the state of other channels, which is convenient for parallel mapping of multiple joints;

[0031] (9) Independent calibration, orientation configuration and safety limit are adopted between the joint angle and the execution target. The attitude continuity and online re-anchoring results can be mapped to pulse width, position, angle, normalized opening and closing amount or other target quantities, so as to adapt to dexterous hands with different structures and driving protocols. Attached Figure Description

[0032] Figure 1 This is a flowchart and implementation environment diagram of one embodiment of the present invention;

[0033] Figure 2 This is a flowchart illustrating the overall process of state continuity, anomaly detection, and execution mapping according to one embodiment of the present invention.

[0034] Figure 3 This is a state transition diagram for error branch detection and online re-anchoring according to an embodiment of the present invention. Detailed Implementation

[0035] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0036] Figure 1This diagram illustrates a processing flowchart and implementation environment diagram of one embodiment of the method of the present invention. The implementation environment employs an inertial motion capture glove, a motion capture acquisition computer, a control computing device, a communication network, a dexterous hand driving device, and a dexterous hand body in terms of hardware. The inertial motion capture glove is mounted on the operator's hand, with each posture sensing unit corresponding to the palm, proximal phalanx, middle phalanx, distal phalanx, or other limb segments requiring data acquisition. The motion capture glove is connected to the motion capture acquisition computer via wired or wireless means. The motion capture acquisition computer performs sensor data fusion and bone segment posture calculation, and provides continuous motion capture data frames to the control computing device via a local area network or equivalent communication link. The control computing device is connected to the dexterous hand driving device. This connection can be a serial bus, industrial bus, Ethernet, USB, wireless communication, or internal controller communication. The dexterous hand driving device receives position, angle, pulse width, normalized opening / closing amount, or other equivalent target quantities, and drives the dexterous hand's finger flexion / extension, thumb swing, or wrist movement. The motion capture computer and the control computing device can be two separate computers, or they can be combined and deployed on the same computing device; the dexterous hand drive device can also be integrated with the control computing device.

[0037] The implementation environment, in terms of software, may include a motion capture and attitude calculation program, a network data service program, a motion capture data receiving and parsing program, an attitude state continuity program, an error branch detection and online re-anchoring program, an execution target mapping program, and a dexterity hand driver program. The motion capture and attitude calculation program generates a frame index, time information, joint identifiers, and attitude quaternions for multiple bone segments for each sampling frame. The network data service program encapsulates the above data into data frames and sends them to the control computing device. The motion capture data receiving and parsing program identifies the complete data frame according to the communication protocol, converts the raw bytes into quaternion components, and establishes channel indices according to left / right hand, fingers, and bone segments. The attitude state continuity program reads the attitude quaternions of the proximal and distal bone segments of the target joint in the same frame, obtains the relative joint attitude, and selects an equivalent representation that is continuous with the historical state. The error branch detection and online re-anchoring program updates the channel state according to the target joint's working domain and abnormal persistence conditions. The execution target mapping program converts the effective joint angles into target values ​​for the corresponding dexterity hand execution channels, which are then distributed by the dexterity hand driver program.

[0038] During the initialization process of this method, at the start of execution, the historical reference flag is set to not established, the error candidate count is cleared to zero, and the previous valid execution target is set to the safe initial target, the mechanical opening target, or the current feedback value of the actuator. After the first valid data frame arrives, the relative quaternion is normalized, and the initial sign is selected according to a preset normalization rule, such as making the scalar part non-negative; this result is saved as the previous valid relative quaternion. Each valid frame after the first frame uses the previous valid state of the target joint as the continuity criterion, without using the historical states of other joints.

[0039] Preferably, a method for continuous selection and online re-anchoring of equivalent branches of dynamic capture joint quaternions includes the following steps:

[0040] S1. Perform a validity check on the sampled frames, and obtain the proximal bone segment pose quaternion and distal bone segment pose quaternion of the target joint according to the valid sampled frames.

[0041] S2. Calculate the relative quaternion of the current frame based on the proximal bone segment pose quaternion and the distal bone segment pose quaternion. The relative quaternion represents the relative rotation of the distal bone segment relative to the proximal bone segment.

[0042] Specifically, for quaternions and Its inner product is defined as ;

[0043] The limiting function can be equivalently defined as: That is, when Time to take ,when Time to take ,when Time to take . It is a limiting function that restricts v to a closed interval [L,H], where L is no greater than H.

[0044] After the proximal and distal bone segment posture quaternions are validated and normalized, the proximal bone segment posture quaternion is inverted and multiplied by the distal bone segment posture quaternion to obtain the relative quaternion: ,in, This represents quaternion multiplication. For a unit quaternion, It can be obtained from conjugate. After actual calculation, it is normalized again. To avoid sensing and floating-point errors causing it to deviate from the unit modulus.

[0045] S3. Normalize the relative quaternion of the current frame and calculate the historical correlation with the previous valid relative quaternion saved by the target joint. Select the one that is closer to the historical state from the two equivalent quaternions representing the same spatial pose as the continuous relative quaternion of the current frame.

[0046] because and Representing the same physical attitude, this method determines the sign factor based on the dot product of the current relative quaternion and the previous valid relative quaternion: when hour, ,in, This represents the inner product operation in four-dimensional Euclidean space. When the dot product is less than 0... The current continuous relative quaternion is: .

[0047] S4. Calculate the joint control angle of the target joint in the current frame based on the continuous relative quaternion;

[0048] The first valid frame did not At that time, it can be based on The sign of the scalar part is chosen for the initial hemisphere. Let... for The scalar part, then the joint control angle used is:

[0049] ;

[0050] The above formula provides a preferred half-angle joint control quantity; if the specific motion capture protocol uses a full axis angle, a double angle or other monotonic equivalent control quantity can be used during the calibration stage, but the continuous representation selection and online re-anchoring relationship remain unchanged.

[0051] S5. Compare the joint control angle with the target joint's preset normal operating range, error candidate threshold, or complementary angle range. When the joint control angle is not in the normal operating range or complementary angle range, or exceeds the error candidate threshold, determine the current frame as an error candidate frame and enter the error candidate state. Count or accumulate the duration of consecutively occurring error candidate frames. Only when the error candidate state continuously meets the preset duration condition is it confirmed that the current continuous state has entered the error equivalent branch and needs to be re-anchored.

[0052] The normal working domain is the range of joint control angles within which the target joint can move normally under the correct quaternion equivalent branch, denoted as:

[0053] ;

[0054] in, This is the minimum joint angle for normal movement; This represents the maximum joint angle during normal movement. The two endpoints are determined through actual calibration using a motion capture glove, the normal range of motion of a human joint, or the mechanically permissible range of a robot. A small tolerance can be added beyond the measured endpoints to cover measurement noise and normal limit movements. For example, the normal working range of the right index finger can be set as:

[0055] ;

[0056] The complementary angle range is an angle range outside the normal working range formed after the normal joint angle is transformed by complementary transformation.

[0057] The complementary transformation used in this method is:

[0058] ;

[0059] Therefore, the error complementation candidate region can be defined as:

[0060] ;

[0061] The minus sign indicates the set difference, which excludes the overlapping parts that still fall within the normal working domain.

[0062] For example:

[0063] ;

[0064] After complementary transformation, we obtain:

[0065] ;

[0066] After removing the portion overlapping with the normal operating domain, the high-angle side error complementation candidate region is approximately:

[0067] ;

[0068] The error candidate threshold is a directional judgment boundary set outside the normal working domain and within the error complementary candidate region. The high-angle side error candidate threshold is denoted as... ,satisfy:

[0069] ;

[0070] in, Represents a set The upper bound. When At this point, the current frame satisfies the high-angle side error candidate condition. The high-angle side is the side with a larger upper limit than the normal operating range.

[0071] The candidate threshold for low-angle side error is denoted as ,satisfy:

[0072] ;

[0073] in, Represents a set The infinite limit. When At this point, the current frame satisfies the low-angle side error candidate condition. The low-angle side is the side that is smaller than the lower limit of the normal operating range.

[0074] In the existing right index finger embodiment:

[0075] ;

[0076] The error complement angle is approximately 2.78 rad; therefore, the error candidate threshold on the high-angle side can be set to... .

[0077] The complete determination of erroneous candidate frames includes:

[0078] (1) When using interval criteria: ;

[0079] (2) When using threshold criteria: or ;

[0080] Only valid frames that meet the above conditions are considered error candidate frames. Error candidate frames must also be consecutive for a specified number of frames or duration before they can be finally confirmed to enter the error equivalent branch and re-anchoring is performed.

[0081] For valid input, when season ;when season The same applies if the input is invalid or the frame continuity requirement is not met. Therefore, the candidate count only reflects consecutive valid abnormal frames. At that time, perform synchronous reanchoring on the current consecutive relative quaternions and the current angle:

[0082] ;

[0083] Subsequently As the next frame of history, and will Input execution mapping module. Because... and Representing the same physical attitude, changing the sign of a quaternion does not change the attitude itself; complementary angle correction brings the control variables of the current frame back to the correct working domain of the target joint.

[0084] S6. Within the same processing cycle confirming entry into the erroneous equivalent branch, perform an overall sign change or an equivalent transformation corresponding to the erroneous equivalent branch on the historical relative quaternion used for the continuity judgment of the next frame, and follow the... Perform corresponding complementary angle correction on the joint control angle of the current frame so that the corrected joint control angle returns to the normal working domain;

[0085] The unit quaternions q and -q represent identical space rotations:

[0086] ;

[0087] Therefore, if the historical relative quaternion is:

[0088] ;

[0089] After performing a global sign change, the result is:

[0090] ;

[0091] This operation does not change the actual spatial pose of the target joint, but changes the mathematically equivalent branch where the quaternion is located, so that the next frame can make a continuity judgment with the correct historical branch.

[0092] The joint control angle used in this method is: The corresponding control angle correction is: The overall sign change of the historical quaternion and the complementary angle correction performed on the current control angle are two corresponding operations.

[0093] S7. Map the corrected joint control angle, or the joint control angle when the erroneous equivalent branch is not confirmed, to the execution target of the corresponding execution channel of the robot and output it. If the current frame is invalid, use the previous valid execution target; if the current frame is valid, update the historical record of the execution target of the target joint.

[0094] The motion capture opening calibration angle and the motion capture closing calibration angle are respectively , The target calibration when the execution channel is open and the target calibration when the execution channel is closed are respectively , The following formula can be used to achieve linear mapping and dual limiting:

[0095] ;

[0096] The inner limiting layer maps joint angles exceeding the motion capture calibration range to the opening or closing endpoints, while the outer limiting layer ensures the target does not exceed the actuator's safe range. When the actuator direction is reversed... Since the natural value is negative, there is no need to change the attitude continuity and online re-anchoring processing. For nonlinear transmission mechanisms, the linear mapping and double limiting in the above equation can be replaced with piecewise linear functions or lookup table functions that maintain the endpoints and monotonic relationships.

[0097] Preferably, one embodiment is as follows: Figure 2 The overall flow of the present invention, including state continuity, anomaly determination and execution mapping, is shown, including steps S101 to S112.

[0098] S101: Establish connection and receive motion capture data frames. The control computing device establishes a data channel based on the address and port of the motion capture server, sends subscription or connection requests, and cyclically receives data frames containing frame indexes, left and right hand identifiers, and bone segment poses. Communication can use connectionless datagrams, connection-oriented byte streams, or shared memory, as long as it can provide frame-organized pose data to the control side.

[0099] S102: Parse the poses of the left and right hands and bone segments. Verify the frame header, data length, and field offset according to the communication protocol. Convert the four pose components of each bone segment into floating-point quaternions, and select the proximal bone segment pose quaternion of the target joint based on the left / right hand, finger, and bone segment index. and distal bone segment posture quaternion .

[0100] S103: Perform a validity check. Check if each component of the quaternion is a finite number, if the modulus is greater than the valid threshold, and check if the frame index is repeated, backwards, or exceeds the allowed interval. When any necessary pose is invalid or data frame parsing fails, the frame is not interpreted as a zero pose, the previous valid relative quaternion is not updated, the previous valid execution target is maintained, and the error candidate count is cleared.

[0101] S104: Calculate joint relative pose. Normalize the valid proximal and distal poses, and obtain the current relative quaternion by multiplying the inverse of the proximal pose by the quaternion of the distal pose. This relative posture reflects the rotation of the distal bone segment relative to the proximal bone segment, thereby reducing the impact of the two bone segments moving together with the palm on the control of the target joint.

[0102] S105: Normalize and calculate historical correlations. Normalize the current relative quaternion. If no historical benchmark has been established for this channel, save the current relative quaternion according to the preset normalization rules; if a previous valid relative quaternion already exists... Then calculate the four-dimensional dot product of the current relative quaternion and the previous valid state.

[0103] S106: Select continuous equivalent representation. When the dot product is less than zero, select... As the current continuous representation; when the dot product is greater than or equal to zero, choose This choice only changes the mathematical representation of the quaternion, without changing its corresponding physical pose, and places adjacent frames in the same four-dimensional hemisphere.

[0104] S107: Calculate joint angles and form candidate historical states. Calculate the joint control angles based on the selected continuous relative quaternions, and use the current continuous relative quaternion as the candidate historical state for this frame. To ensure that online re-anchoring can synchronously correct the state, the writing of historical states in this step can be delayed until after the re-anchoring judgment is completed, or it can be written first and then overwritten by the online re-anchoring module within the same cycle.

[0105] S108: Identify erroneous branch candidates. Compare the joint angle of this frame with the normal minimum angle, normal maximum angle of the target joint, and the erroneous candidate threshold. When the joint angle is within the normal working region, it is determined to be in a normal state and the candidate count is cleared; when the joint angle enters a region that can only be generated by the erroneous continuation of complementary branches or equivalent states, it is determined to be an erroneous candidate state.

[0106] S109: Accumulated Continuous Anomalies. Increment the count for consecutively occurring erroneous candidate frames, or accumulate their duration. The count is reset to zero when normal, invalid, or discontinuous frames appear between candidate frames. The preset duration condition is determined based on the sampling frequency and allowable recovery time, ensuring that single-frame noise, network jitter, and short-term attitude spikes do not directly trigger re-anchoring.

[0107] S110: Perform online reanchoring. When consecutive anomalies reach a preset number of frames or duration, confirm that the current consecutive state has entered the erroneous equivalent branch. This method changes the sign of the saved historical relative quaternions as a whole or performs an equivalent state transformation within the same processing cycle, and converts the current erroneous angle into the corresponding complementary angle or normal operating domain angle; then, it clears the candidate count. The synchronously corrected historical relative quaternions are used for the dot product judgment in the next frame, and the corrected current angle is used for the mapping in this frame. Therefore, the correct output can be restored in this frame, and subsequent frames will not return to the erroneous branch.

[0108] S111: Perform calibration mapping and amplitude limiting. Map the angle after re-anchoring or the normal angle without re-anchoring according to the dynamic capture opening calibration angle, dynamic capture closing calibration angle, execution channel opening calibration target, and execution channel closing calibration target. When the mechanical direction is reversed, the output endpoints are exchanged without changing the attitude continuity process. The mapping result is limited to the actuator's safe range; for nonlinear mechanisms, multiple calibration points can be used for piecewise mapping.

[0109] S112: Output target and save valid state. The targets from each channel are grouped into left and right hand target arrays, which are output to the dexterous hand drive device via control messages or a drive interface. After processing a valid frame, the continuous relative quaternions, joint angles, and execution target of the current frame are saved; for invalid frames, the previous valid state is retained. This forms a closed loop of "current frame processing—state saving—next frame continuous judgment".

[0110] Preferably, one embodiment is as follows: Figure 3 This illustrates the state transitions for error branch detection and online re-anchoring. In the normal continuous state, continuous branch selection is referenced to a valid relative quaternion on the target joint. After entering the abnormal candidate state, this method can maintain the current continuous output but does not immediately change the historical branches. Only when the abnormality persists and the trigger condition is met will it enter the re-anchoring state. The re-anchoring state is a single state update process: first, the equivalent transformation corresponding to the error branch is determined; then, the historical relative quaternion and the current control angle are updated synchronously; finally, it returns to the normal continuous state. If a normal frame or an invalid frame occurs during the candidate period, it returns to the normal continuous state and the candidate count is cleared.

[0111] This application also includes the following embodiments:

[0112] Example 1: Deployment and Connection of Virdyn Motion Capture Gloves with DreamsCapStudio

[0113] In this embodiment, the Virdyn inertial motion capture glove is used to collect the operator's left and right hand postures, and DreamsCapStudio is used as the motion capture and posture calculation software. The posture sensing units of the Virdyn glove move with the operator's palm and finger bones. The acquisition end receives data from each sensing unit, and DreamsCapStudio completes device identification, sensor data fusion, skeletal model association, and bone segment posture calculation to form posture quaternions for the left and right hands and their multiple bone segments.

[0114] The motion capture acquisition computer running DreamsCapStudio and the control computing device running the mapping control program are connected to the same communicable network. The control computing device sends a connection or subscription request to the motion capture data server based on the service address provided by the motion capture acquisition computer. The motion capture data server then sends continuous data frames to the control computing device. In actual deployment, glove wearing and device recognition are completed first, then the left and right hand skeletal models in DreamsCapStudio are confirmed to update with the operator's movements, and finally the control receiving node is started.

[0115] In this embodiment, DreamsCapStudio and Virdyn are preferred examples of motion capture software and inertial motion capture gloves, respectively. Other motion capture software and gloves capable of outputting left and right hand bone segment posture quaternions, rotation matrices, Euler angles, or convertible posture data can replace the above products; when the input is not a quaternion, it is first converted into a unit quaternion before entering the subsequent processing chain.

[0116] Example 2: UDP motion capture data access and parsing

[0117] In the preferred implementation, the control node communicates with the motion capture server via UDP, with the server port set to 7000. After startup, the control node reads the configurable server address, constructs the server network address, and sends a connection command. Subsequently, the control node reads datagrams in an independent receive loop, with the receive buffer capable of holding one complete frame of motion capture data. Port 7000, datagram communication, and the specific connection command are all implementation parameters and can be replaced according to the motion capture software protocol.

[0118] Upon receiving a datagram, the control node first checks the received length and then converts the byte sequence into motion capture calculation data according to the protocol. The parsing result includes at least the frame index, the set of quaternions for the left-hand bone segments, and the set of quaternions for the right-hand bone segments. The control node invokes the processing procedure separately for each hand and generates independent target arrays for the left and right hands. If byte parsing fails, necessary fields are missing, or frame data is invalid, the frame is skipped, and the previous valid pose and execution target are not updated.

[0119] To facilitate the determination of data continuity, the current frame index can be compared with the previous valid frame index. When the frame index is duplicated, the duplicate frame is discarded; when the frame interval exceeds the allowable range, the previous valid target can continue to be used, and the error branch candidate count is reset to avoid mistaking the first frame after the communication interruption as a continuity anomaly.

[0120] Example 3: Normal Continuous Mapping

[0121] The motion capture glove outputs data at a preferred sampling frequency of approximately 60 Hz. For any target joint, the control node selects the pose quaternions of the proximal and distal bone segments from the same frame, checking that their components are finite values ​​and their magnitudes are greater than the effective threshold. After normalizing the two quaternions, the relative quaternion is calculated according to equation (3).

[0122] Upon arrival of the first valid frame, this method establishes the previous valid relative quaternion of the target joint according to preset normalization rules. Upon arrival of subsequent frames, the dot product of the current relative quaternion and the previous valid relative quaternion is calculated; if the dot product is negative, the sign of the current quaternion is changed. As the operator gradually bends the target finger from open to closed, the joint angles gradually increase from the open angle, and can realistically cross... As long as the current angle is within the normal operating range, the error candidate count remains zero.

[0123] The control node performs linear or piecewise mapping based on the joint's input opening angle, input closing angle, and the dexterous hand's open and closed target positions, limiting the results to the range allowed by the driver. The left and right hands each form an array containing multiple finger and wrist targets, which are then sent to the corresponding dexterous hand by the subsequent driver program.

[0124] Example 4: Reversing the equivalence symbols of input quaternions

[0125] In a continuous pose sequence, the motion capture solution may convert the quaternion of a bone segment in a certain frame from... Switch to representing the same physical attitude The current relative quaternion may therefore be in the opposite direction to the previous valid relative quaternion. After the continuous branch selection module detects that the dot product of the two is less than zero, it changes the sign of the current relative quaternion as a whole, then calculates the joint angle and saves the continuous state.

[0126] Automated verification can insert overall sign-changing frames into the quaternions corresponding to the consecutive angle sequences 0.2, 1.2, 1.55, 1.7, and 2.0 rad. The processed angles are consistent with the unsigned sequences, and the angles cross... Then it continues to increase. This embodiment illustrates that the present invention eliminates the switching of mathematical equivalence representations, and does not revert the true depth curvature back to a smaller angle.

[0127] Example 5: Online Recovery of Long-Running Error Branches

[0128] This embodiment uses the right index finger flexion-extension channel as the verification object. The normal opening angle of this channel is approximately 0.36 rad, and the normal maximum bending angle is approximately 2.36 rad; when the historical continuous states fall into the erroneous complementary branch, the opening posture may be interpreted as approximately ( -0.36 = 2.78 rad. The above values ​​are example calibration values ​​for this implementation and can be recalibrated according to different gloves, wearing conditions, and target joint working domains.

[0129] The error candidate threshold is set to 2.57 rad, which falls between the normal maximum bending angle of 2.36 rad and the error opening interpretation angle of 2.78 rad. The re-anchoring duration condition is set to 15 consecutive frames; at a sampling frequency of approximately 60 Hz, this condition is used to exclude short-term spikes. 2.57 rad and 15 frames are example parameters and can be adjusted to other thresholds, frame numbers, or durations based on the joint's normal operating domain, sampling frequency, noise level, and allowable recovery time.

[0130] When a consecutive angle first exceeds 2.57 rad, the candidate count increases from 0 to 1. For the first 14 consecutive candidate frames, only the state is accumulated without re-anchoring. When the 15th consecutive candidate frame arrives, the method confirms entry into an erroneous branch, changes the sign of the historical relative quaternions saved for the target joint, corrects the current angle of approximately 2.78 rad to approximately 0.36 rad, and resets the count to zero. The corrected 0.36 rad is used for mapping in this frame, and the changed historical relative quaternions are used for dot product judgment in the next frame. A normal 2.36 rad full bend will not trigger; the count is immediately reset to zero when a normal frame, an invalid frame, or a short-term high-angle spike ends during the candidate period.

[0131] This online processing does not terminate DreamsCapStudio, close the UDP receive loop, or require restarting the ROS 2 node or reinitializing other fingers, thus restoring the correct opening and closing direction of the target channel during long-term operation.

[0132] Example 6: Abnormal Input, Frame Drops, and Intermittent Data Preservation

[0133] If any necessary input quaternion contains non-finite components, has a modulus less than a valid threshold, or fails to parse a data frame, this method marks the frame as invalid. Invalid frames do not enter the relative attitude successive selection, do not overwrite the previous valid relative quaternion, and do not interpret the current attitude as a zero angle; the execution side continues to use the previous valid target of the target joint and clears the error candidate count.

[0134] When the network temporarily loses frames, the control unit maintains the previous valid target until the next valid frame arrives. If the frame index is available, duplicate frames are not processed repeatedly, and frames exceeding the allowed interval can be treated as new consecutive segments. The first recovered valid frame can continue to be compared with the previous valid historical state; when the interruption time exceeds the set value, the historical reference for this channel can also be re-established, but invalid data must not be used to establish the reference.

[0135] Example 7: ROS 2 Message Publishing and Dexterous Hand Execution

[0136] In the optimal implementation of the project, after completing data parsing and the aforementioned posture processing, the motion capture receiving node publishes seven-channel target arrays for both the left and right hands. Each array sequentially contains multiple finger flexion / extension, thumb flexion / extension, thumb swing, or wrist targets. The bridging node subscribes to the left and right hand target arrays and, based on the physical correspondence between the left and right hands, the channel order, the opening / closing endpoints of each actuator, and the direction configuration, converts the targets into dexterous hand driving commands.

[0137] When the left and right motion capture gloves are physically installed in opposite directions to the dexterous hand, the bridging node can swap the left and right hand routes; this routing does not change the quaternion history state stored in each channel. The bridging node can also perform final safety limiting on the target value and send it to the left and right dexterous hands via serial port, bus, or vendor driver interface. After receiving the target, the dexterous hand driver causes the corresponding finger to move from the current pose to the target pose.

[0138] ROS2, the specific topic name, the seven-channel array, and PWM are all implementation methods that can be adopted in this embodiment. Equivalent implementations can use other message middleware, function calls, shared memory, industrial buses, or network interfaces, and can also output angle, position, normalized opening / closing amount, or force / position hybrid control targets.

[0139] Example 8: Functional Verification

[0140] A stateless angle calculation method can be used as a comparison: for each frame, the inverse cosine angle is directly calculated based on the dot product of the two attitude quaternions, without storing the previous valid relative quaternion. When the motion capture decoder is representing the same physical attitude... and When switching between these methods, the control method may interpret the small angle on the open side as a complementary angle, causing the target to enter the opposite direction after restarting, prolonged operation, or data representation switching. This phenomenon is used to illustrate the technical problem that needs to be solved and is not intended as proof that the method of this invention has achieved a specific statistical success rate.

[0141] When verifying the method of the present invention, data can be constructed or collected including normal continuous postures, single-frame overall sign changes, continuous overall sign changes, and actual joint angle crossings. The data sequence includes zero-modulus input, short-term high-angle spikes, and persistent error branches. During the verification process, the input quaternion, the selected continuous relative quaternion, the error candidate count, the angle before and after re-anchoring, and the final execution target are recorded, and the following checks are performed respectively: whether the output remains continuous before and after the equivalent symbol flip; whether the original direction is maintained for real large-angle bending; whether synchronous re-anchoring is triggered after the persistent anomaly is met; and whether the candidate state is reset for normal or invalid frames.

[0142] In actual motion capture gloves and robotic actuators, multiple cold starts, restarting only the mapping program, long-term continuous operation, and repetitive actions of opening-bending-opening can be used as comparative working conditions to count the number of times the wrong direction occurs, the re-anchor recovery time, the number of false triggers, and the arrival status of the endpoint.

[0143] The meanings of the symbol parameters are shown in Table 1.

[0144] Table 1 Meaning of Symbolic Parameters .

Claims

1. A method for continuous selection and online re-anchoring of equivalent branches of quaternions in motion capture joints, characterized in that, Includes the following steps: S1. Perform a validity check on the sampled frames, and obtain the proximal bone segment pose quaternion and distal bone segment pose quaternion of the target joint according to the valid sampled frames. S2. Calculate the relative quaternion of the current frame based on the proximal bone segment pose quaternion and the distal bone segment pose quaternion; S3. Calculate the historical correlation between the relative quaternion of the current frame and the previous valid relative quaternion saved by the target joint. Select the one that is closer to the historical state from the equivalent quaternions representing the same spatial pose as the continuous relative quaternion of the current frame. S4. Calculate the joint control angle of the target joint in the current frame based on the continuous relative quaternion; S5. Compare the joint control angle with the normal working range, error candidate threshold or complementary angle range of the target joint. When the joint control angle is not in the normal working range or complementary angle range, or exceeds the error candidate threshold, determine the current frame as an error candidate frame and enter the error candidate state. Count or accumulate the duration of consecutively occurring error candidate frames. Only when the erroneous candidate state continuously meets the preset persistence condition is the current continuous state confirmed to have entered the erroneous equivalent branch and requires reanchoring correction. S6. In the same processing cycle that confirms entry into the erroneous equivalent branch, perform an overall sign change or adopt a branch correction operation equivalent to the overall sign change on the historical relative quaternion used for the continuity judgment of the next frame, and perform complementary angle correction on the joint control angle of the current frame so that the corrected joint control angle returns to the normal working domain. S7. Map the corrected joint control angle, or the joint control angle when the erroneous equivalent branch is not confirmed, to the execution target of the corresponding execution channel of the robot and output it. If the current frame is invalid, use the previous valid execution target; if the current frame is valid, update the historical record of the execution target of the target joint.

2. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, In step S2, the relative quaternion of the current frame is calculated, including: normalizing the proximal bone segment pose quaternion and the distal bone segment pose quaternion to unit quaternions respectively; taking the inverse of the normalized proximal bone segment pose quaternion and performing a quaternion multiplication operation with the normalized distal bone segment pose quaternion to obtain the relative quaternion of the current frame.

3. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, In step S3, the calculation of historical correlation involves calculating the four-dimensional dot product of the relative quaternion of the current frame and the previous valid relative quaternion. When the four-dimensional dot product is less than zero, the four components of the relative quaternion of the current frame are changed to a continuous relative quaternion. When the four-dimensional dot product is greater than or equal to zero, the relative quaternion of the current frame is directly used as the continuous relative quaternion.

4. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, Also includes: When the target joint has not yet saved the previous valid relative quaternion, the relative quaternion of the first valid sampling frame is normalized, and after selecting the initial sign according to the preset normalization rule, it is saved as the previous valid relative quaternion; the preset normalization rule includes making the scalar part of the relative quaternion non-negative.

5. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, In step S4, the joint control angle of the target joint in the current frame is calculated, including: taking the scalar part of the continuous relative quaternion, limiting the scalar part to the closed interval [-1,1], and performing an inverse cosine operation on the limited scalar part to obtain the joint control angle with a value range of [0,π].

6. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, In step S5, the normal working domain is the range of joint control angles within which the target joint can move normally; the complementary angle interval is the angle interval outside the normal working domain formed by complementary transformation of the joint control angles within the normal working domain; the error candidate threshold is set outside the normal working domain to determine whether the joint control angle deviates abnormally from the boundary value of the normal working domain; the preset duration condition is when the number of consecutive frames in which the error candidate state appears reaches a preset frame threshold, or when the duration of the error candidate state reaches a preset duration threshold. When the joint control angle of any sampling frame is within the normal operating range, or when any sampling frame is an invalid frame, the accumulated number of erroneous candidate frames or the duration is cleared to zero.

7. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, In step S6, the complementary angle correction involves replacing the joint control angle of the current frame with the difference between π and the joint control angle of the current frame; after performing the complementary angle correction, the error candidate count is cleared to zero; the transformed historical relative quaternion state is used for the historical correlation calculation of the next frame, and the corrected joint control angle is used for the execution target mapping of the current frame.

8. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, The validity check in step S1 includes: when any component of the proximal bone segment pose quaternion or the distal bone segment pose quaternion is a non-finite number, the modulus is not greater than the effective modulus threshold, or the sampling frame parsing fails, the sampling frame is determined to be an invalid frame; for invalid frames, the previous valid relative quaternion is not updated, and the previous valid execution target output of the target joint is maintained.

9. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion capture joints according to claim 1, characterized in that, In step S7, the mapping includes: linearly mapping the joint control angle based on the target joint's dynamic capture opening calibration angle, dynamic capture closing calibration angle, execution channel opening calibration target, and execution channel closing calibration target; firstly, limiting the joint control angle within the range defined by the dynamic capture opening calibration angle and the dynamic capture closing calibration angle, so that joint control angles exceeding the calibration range are mapped to the opening endpoint or closing endpoint, and then limiting the mapping result within the execution channel safety target range; when the mechanical direction of the execution channel is opposite to the joint bending direction, the execution channel opening calibration target and the execution channel closing calibration target are exchanged; for nonlinear transmission mechanisms, piecewise mapping or lookup table mapping that maintains the endpoint and monotonic relationship is used instead of the linear mapping.

10. The method for continuous selection and online re-anchoring of equivalent branches of quaternions of motion-captured joints according to any one of claims 1 to 9, characterized in that, The method is applied in parallel to multiple target joints; Each target joint maintains its own isolated state records, which include: the previous valid relative quaternion, the previous valid joint control angle, the previous valid execution target, the error candidate count or cumulative duration, the historical benchmark establishment flag, and the input calibration range, output calibration range, and direction configuration of the target joint; when any target joint experiences invalid input or online re-anchoring, the state records saved by other target joints are not changed.