Robot operation data collection method based on SLAM
Through SLAM technology and ArUco mark detection, combined with IMU data, high-precision robot skill data collection is achieved, which solves the problems of traditional methods' low efficiency and accuracy dependence on sensors in dynamic environments, and improves the efficiency and accuracy of robot skill learning.
Patent Information
- Application Number
- CN202410813583.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-06
AI Technical Summary
Traditional robot skill operation data collection methods are inefficient in dynamic and complex environments, and their accuracy relies on sensor precision. It is difficult to meet the needs of multi-robot collaboration. Data collection is time-consuming and labor-intensive, and lacks efficient automation.
Using a SLAM-based robot operation data collection method, the camera system and monocular visual inertial SLAM algorithm are combined with ArUco mark detection to achieve high-precision positioning and map construction, automatically adjust the operation path, optimize positioning combined with IMU data, and quickly collect multiple types of robot skills. Operation data.
It achieves efficient and fast robot skill data collection, improves data integrity and robustness, and reduces the training cost of robot skill learning, especially in the fields of reinforcement learning and imitation learning.
Smart Images

Figure CN118596146A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot skill learning, and in particular to a robot operation data collection method based on SLAM. Background Art
[0002] In today's robotics field, especially in autonomous navigation and environmental perception, SLAM (Simultaneous Localization and Mapping) technology has become a hot topic in research and application. SLAM technology obtains environmental data through sensors (such as cameras, lidar, etc.), builds maps in real time, and determines the position of the robot in the map. Traditional navigation methods, such as GPS-based positioning, do not work well indoors and in environments with unstable signals. SLAM technology can achieve high-precision positioning and mapping in these scenarios, greatly expanding the scope of robotics applications.
[0003] In the field of robot skill learning (robot reinforcement learning, imitation learning, embodied intelligence), it is often necessary to collect a large amount of skill operation data for subsequent analysis, optimization and training of skill learning models. For example, in the training of service robot pouring skills, a large amount of information such as terminal trajectory path and environmental images needs to be recorded. The amount, accuracy and completeness of these data directly affect the efficiency and quality of robot skill learning training. However, the current collection of robot skill operation data faces many challenges. First, traditional data collection methods rely on pre-set sensors and fixed operation paths, and it is difficult to efficiently generalize multiple operation trajectories to adapt to dynamic and complex working environments. Secondly, the accuracy of the data depends on the accuracy and stability of the sensors, and sensor errors and environmental noise will cause data deviations. Especially in the scenario of multi-robot collaboration, the relative position and action coordination between robots require high-precision positioning and synchronization, and traditional methods are difficult to meet this demand. Finally, the data collection process is often time-consuming and laborious, requiring manual remote control of the robotic arm to collect repeatedly, and it is difficult to achieve efficient automation.
[0004] The application of SLAM technology in the collection of robot skill operation data has significant advantages. First, SLAM technology can achieve high-precision positioning and map construction in complex environments, providing robots with accurate environmental models and location information. Secondly, SLAM technology can update maps and positioning information in real time, enabling robots to adapt to dynamically changing working environments, automatically adjust operating paths, and improve work efficiency and data collection accuracy. In addition, SLAM technology can also be combined with other sensor data (such as IMU, depth cameras, etc.) to achieve multi-sensor fusion and improve data integrity and robustness. Summary of the invention
[0005] In order to solve the above technical problems existing in the prior art, the present invention proposes a robot operation data collection method based on SLAM, which collects raw data through a camera system tool, a data processing algorithm based on monocular visual inertial SLAM, and an ArUco mark detection algorithm to realize coordinate system conversion and gripper finger width recognition, and finally obtain the positioning coordinates of the system tool coordinate system in the world coordinate system and frame-synchronized video information. The specific technical scheme is as follows:
[0006] A method for collecting robot operation data based on SLAM, comprising the following steps:
[0007] Step 1: Use a handheld gripper tool with a camera to capture its operation video by setting ArUco marks;
[0008] Step 2: Use the monocular visual inertial SLAM algorithm to track and locate the camera in the collected video, estimate the camera's position in space, and construct a three-dimensional environment map. Then, periodically detect the camera positioning and update the map to obtain the camera trajectory.
[0009] Step 3: Through ArUco mark detection, the camera trajectory coordinates are used to obtain the positioning coordinates of the gripper tool coordinate system in the world coordinate system and the width of the gripper finger of the gripper tool end effector, thereby obtaining the trajectory of the handheld gripper tool and the width change data of the gripper finger;
[0010] Step 4: Output and save the image data of the operation video, the trajectory data of the handheld gripper tool, the width change data of the gripper fingers, and the data timestamp.
[0011] Furthermore, the step 1 includes:
[0012] Stick the ArUco logo on the two gripper finger seats of the hand-held gripper and in the shooting environment;
[0013] Place the handheld gripper tool facing the calibration chessboard to shoot a video and calibrate it to obtain the camera intrinsic parameters;
[0014] Use a handheld gripper tool to record a continuous operation video.
[0015] Furthermore, the step 2 includes:
[0016] The ORB feature extractor is used to extract the feature points of the current input frame image in the video.
[0017] Track feature points and estimate the camera’s position in the 3D environment map.
[0018] Use feature points and IMU data to optimize and update the camera pose and 3D environment map.
[0019] Get the camera's trajectory point.
[0020] Furthermore, the ORB feature extractor extracts the ORB feature points P of the current input frame image. cur and descriptor D cur , and save;
[0021] The tracking feature points and estimating the camera's position and posture in the three-dimensional environment map are specifically as follows: checking whether the current input frame is the first frame, and if it is the first frame, initializing the camera's position and posture to the initial position If it is not the first frame, get the ORB feature point P from the previous frame pre and descriptor D pre , use the FLANN matcher to match the descriptors of the current frame and the previous frame, filter the matching results, select the best matching point pair and extract the matched 3D points from the map and the 2D points from the current frame image, then obtain the camera intrinsic parameter matrix, use the EPnP algorithm to calculate the camera's pose, including the rotation vector and translation vector, and finally convert the rotation vector and translation vector into a homogeneous coordinate transformation matrix, that is, the camera's pose coordinates based on the SLAM coordinate system
[0022] Furthermore, the use of feature points and IMU data to optimize and update the camera pose and the three-dimensional environment map is specifically as follows: using the feature points of the current frame [P cur ,D cur ] and IMU data [A cur ,W cur ]Update the local map and use local bundle adjustment to optimize the local map; look for closed loops in the map and detect closed loops by identifying the similarity of feature points. If a closed loop is found, use pose graph optimization for global optimization to reduce cumulative errors; if feature points drift or tracking is lost, relocalize and rematch features to correct the pose.
[0023] Furthermore, the step three includes:
[0024] Use OpenCV's ArUco library to detect the ArUco logo from the current frame of the captured video, identify its four corner points and ID, and filter out interference and misidentification by the average distance of the corner points from the camera and the ID;
[0025] The camera uses the ArUco library's landmark pose detection algorithm to identify the poses of the left and right gripper ArUco landmarks based on the current camera coordinate system. And calculate the mean of the two to obtain the homogeneous transformation matrix T from the camera coordinate system to the handheld gripper tool coordinate system cam→tcp Calculate the absolute value of the difference between the two X-axis values to obtain the gripper width F width ;
[0026] Use the EPnP algorithm to calculate the desktop ArUco marker pose based on the SLAM mapping coordinate system And calculate the homogeneous transformation matrix T from the world coordinate system with the origin as the desktop ArUco mark to the SLAM coordinate system tag→slam , calculate the trajectory of the handheld gripper tool coordinate system based on the world coordinate system According to the coordinate transformation formula: T tcp =T tag→slam ×T cam ×T cam→tcp .
[0027] Furthermore, the handheld clamp tool is designed by imitating a real clamp design and ergonomic design, the clamp body is made of PLA material, and the clamp fingers are made of TPU material.
[0028] The beneficial effects of the present invention are as follows: a software and hardware combination method for collecting robot operation data based on human demonstration and SLAM positioning is proposed, which uses simple and low-cost hardware design, efficient, fast and low-threshold human skill demonstration, and combines monocular visual inertial SLAM technology to track and locate the movement of human handheld grippers in real time, and finally performs TCP coordinate transformation based on ArUco mark recognition, thereby realizing the collection of multiple types of high-precision and fast general robot operation data. Furthermore, by using this method to quickly and low-costly construct multiple types of robot skill operation data sets, the training cost of robot skill learning is reduced, and the training accuracy is effectively improved, especially for training in the fields of robot skill reinforcement learning, imitation learning, embodied intelligence, etc., the cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic flow chart of a method for collecting robot operation data based on monocular visual inertial SLAM according to an embodiment of the present invention;
[0030] Figure 2 is a schematic structural diagram of a handheld data acquisition gripper according to an embodiment of the present invention;
[0031] Figure 3 yes Figure 1 Schematic diagram of the structure viewed from above;
[0032] Figure 4 1 is a structural diagram of a monocular visual-inertial SLAM system according to an embodiment of the present invention;
[0033] In the figure, 1 is the Gopro10 camera, 2 is the palm rest, 3 is the top cover, 4 is the clamp body, 5 is the clamp finger, 6 is the clamp trigger, 7 is the clamp base, 8 is the clamp finger seat, 9 is the ArUco logo, 10 is the transmission rod, 11 is the special-shaped transmission gear, and 12 is the trigger spring. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and technical effect of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0035] like Figure 1 As shown, an embodiment of the present invention discloses a method for collecting robot operation data based on monocular visual inertial SLAM. First, a universal handheld gripper tool is designed in the hardware part, which is composed of a 3D printed gripper body, fingers, ArUco logo, and a Gopro camera. The human-held gripper can imitate the robot to perform skill operations through the imitation of the entity gripper design and ergonomic design. The operation process video and inertial information are recorded in real time through the Gopro sports camera, thereby realizing fast and efficient reproduction and recording of operation skills.
[0036] Then, a monocular visual-inertial SLAM algorithm is used to extract features from the raw information collected by the above sensors at multiple scales. The position of the camera system in space is estimated by tracking and positioning visual and inertial information, and a three-dimensional map of the environment is constructed based on the positioning results and sensor data. After obtaining the environmental map, when positioning fails or drift occurs, the position of the sensor is re-determined by matching the current sensor data with the feature points in the map. Periodically check whether there is a closed loop in the map to determine whether the path passed by the sensor has been visited before to correct the accumulated error. The monocular visual-inertial SLAM algorithm will continuously repeat the above steps to update the position of the camera system and the environmental map in real time, and continuously optimize the positioning accuracy.
[0037] Finally, the skill operation trajectory obtained by SLAM algorithm positioning is exported, and the coordinate system conversion and gripper finger width recognition are realized through ArUco mark detection. Finally, the positioning coordinates of the TCP gripper tool coordinate system in the world coordinate system and the width of the end effector gripper finger, as well as the frame-synchronized video information, are obtained.
[0038] Specifically, the data collection method includes the following steps:
[0039] Step 1: Use handheld hardware to capture raw video, including:
[0040] Step 1.1, design a handheld data acquisition gripper with a camera and paste the ArUco logo according to the use:
[0041] like Figure 2 and Figure 3The handheld hardware designed by the present invention to imitate the appearance of a real gripper is shown: a handheld data acquisition gripper. The structure of the data acquisition gripper consists of a Gopro10 camera 1, a palm rest 2, a top cover 3, a gripper trigger 6, a trigger spring 12, a transmission rod 10, a special-shaped transmission gear 11, a gripper finger seat 8, a gripper finger 5, a linear slide rail, a gripper body 4, a gripper base 7, and an ArUco logo 9, a total of 12 parts, and is fastened by M3 series hexagon socket bolts.
[0042] The data acquisition clamp is operated by hand, and the functions of different components during the operation are as follows: the Gopro10 camera collects visual and inertial information, the person holds the clamp trigger 6 tightly to compress the trigger spring 12, driving the transmission rod 10 and the special-shaped transmission gear 11 to control the two clamp finger seats 8 and the clamp fingers 5 to make a linear approach movement on the linear slide rail to achieve clamp closure, and the spring rebounds after releasing the hand, and the clamp opens naturally, the top cover 3 is used to install the camera and the mirror film, and the clamp base 7 and the palm rest 2 are convenient for storing and placing the clamp.
[0043] The gripper trigger structure controls the opening and closing of the gripper, ensuring the smoothness of skill operation by holding the gripper and the reproducibility of skill learning of the robot arm. The gripper body is 3D printed with PLA material, and the gripper fingers are 3D printed with TPU material. The overall weight is light and the cost is very low, which is conducive to the efficient collection of large-scale original skill data.
[0044] Paste ArUco marks 9 on the two gripper finger seats 8 of the handheld gripper hardware to track the width information of the gripper during the SLAM operation. Paste ArUco marks 9 in the environment where the operation skills are reproduced so that the SLAM coordinate system can be converted to the world coordinate system later. Note that three ArUco marks 9 are used here, each with different ID information.
[0045] Step 1.2, use the handheld data acquisition gripper to record the camera internal parameters and gripper calibration video:
[0046] The handheld data acquisition gripper faces the calibration chessboard to shoot a video and calibrate it to obtain the camera intrinsic parameter matrix: Matrix cam =[fx,fy,cx,cy,k1,k2,p1,p2,k3]
[0047] =[854.264,847.187,964.132,698.562,-0.256,0.091,0.0009,
[0048] -0.00039,-0.01642375]
[0049] Repeatedly open and close the gripper 5 to 10 times in a static state to obtain the gripper calibration video for subsequent gripper width identification and calculation of the Cam camera to TCP gripper tool coordinate system conversion:
[0050]
[0051] Step 1.3, use the handheld data acquisition gripper to record N skill operation videos:
[0052] Use the handheld gripper to record a water pouring skill operation video. The process is: click record - hold the gripper and pull the trigger to grab the water cup - pour water - release the trigger to put down the water cup - click record to stop, and repeat the above process 50 times.
[0053] Step 2: Set up and initialize the ORB feature extractor, map M, and camera pose IMU data[A 0 ,W 0 ] and gripper trajectory storage structure Image storage structure I[I 0 ,I 1 ,I 2 ,…I N ], jaw width variation storage structure Timestamp storage structure
[0054]
[0055] Step 3: loop through each frame of the camera input image I cur and IMU[A cur ,W cur ] data to generate SLAM camera trajectory, refer to Figure 4 After the camera data is input, the thread for feature point tracking, the thread for local mapping, the thread for closed-loop detection and global optimization, and the thread for visualization are carried out, including:
[0056] Step 3.1, extract the ORB feature points of the current input frame image: When the camera data is input, use the ORB algorithm to extract feature points from the current frame image
[0057] P cur [{"pt":(x,y),"size":scale,"angle":orientation"class_id":id}] and descriptor D cur [[d1 1 ,d1 2 ,...,d1 32 ],[d2 1 ,d2 2 ,...,d2 32],…], and save these feature points for subsequent use.
[0058] Step 3.2, track feature points and estimate camera pose: First, check whether it is the first frame. If it is the first frame, initialize the camera pose to the initial position. If it is not the first frame, get the ORB feature point P from the previous frame pre and descriptor D pre , use the FLANN matcher to match the descriptors of the current frame and the previous frame, filter the matching results, select the best matching point pair and extract the matched 3D points from the map and the 2D points from the current frame image, then use the EPnP algorithm to calculate the camera's pose, including the rotation vector and the translation vector, and finally convert the rotation vector and the translation vector into a homogeneous coordinate transformation matrix, that is, the camera's pose coordinates based on the SLAM system:
[0059]
[0060] Among them, for the current frame camera pose, an empty list can be initialized to store 3D points and 2D points, then each matching pair is traversed, the corresponding 3D points are obtained from the map, and the 2D points of the current frame are extracted, and these points are added to the 3D point list and the 2D point list respectively. Next, the camera intrinsic parameter matrix is obtained, and the solveEPnP function of OpenCV is used to solve the pose relationship between 3D points and 2D points based on the EPnP algorithm, the rotation vector is converted to a rotation matrix, and the rotation matrix and translation vector are combined to generate the camera pose of the current frame. Finally, the ORB feature points and descriptors of the current frame are saved for use in the next frame, and the camera pose of the current frame is returned.
[0061] The pseudo code for this step is as follows:
[0062]
[0063] Step 3.3, integrate IMU data: Use IMU data [A cur ,W cur ] is integrated to further improve the accuracy of camera pose estimation and update the pose of the current frame.
[0064] Step 3.4, update the SLAM map and optimize globally:
[0065] Use the feature points of the current frame [P cur ,D cur ] and IMU data [A cur ,W cur ] Update the local map and use local bundle adjustment (Local BA) to optimize the local map and improve the map M and camera pose T cam accuracy.
[0066] Look for closed loops in the map and detect them by identifying the similarity of feature points. If a closed loop is found, use Pose Graph Optimization to perform global optimization to reduce the accumulated error.
[0067] If drift or tracking loss occurs, re-perform feature matching from step 3.1 to reposition and correct the pose.
[0068] Step 3.5, update the camera trajectory point: update the camera pose of the current frame Add to camera track storage structure In the example, the image I of the current frame is cur Add image storage structure I[I 0 ,I 1 ,I 2 ,…I N ], the timestamp of the current frame Added to timestamp storage structure middle.
[0069] Step 4, realizing coordinate transformation and gripper width recognition based on ArUco mark detection, including:
[0070] Step 4.1, ArUco logo detection: Use OpenCV's ArUco library to detect the ArUco logo from the current frame image, identify its four corner points and ID, and filter out interference and misidentification by the average distance of the corner points from the camera and the ID.
[0071] Step 4.2, track and record the gripper width: the camera uses the landmark pose detection algorithm in the ArUco library to identify the pose of the left and right gripper ArUco landmarks based on the current camera coordinate system. And calculate the mean of the two to obtain the homogeneous transformation matrix T from the camera coordinate system to the TCP coordinate system cam→tcp Calculate the absolute value of the difference between the two X-axis values to obtain the gripper width F width .
[0072] Step 4.3, calculate the TCP trajectory points: use the EPnP algorithm to calculate the desktop ArUco marker pose based on the SLAM mapping coordinate system And calculate the homogeneous transformation matrix from the world coordinate system with the origin as the desktop ArUco marker to the SLAM coordinate system:
[0073]
[0074] Calculate the trajectory of the TCP gripper tool coordinate system based on the world coordinate system According to the coordinate transformation formula: T tcp =T tag→slam ×T cam×T cam→tcp .
[0075] Step 5: Output data collection results:
[0076] Output and save the required data in dictionary form: TCP trace Jaw width variation Observed image I[I 0 ,I 1 ,I 2 ,…I N ], timestamp
[0077] In summary, the method of the present invention integrates TCP posture repositioning and end-effector posture recognition. Through this method, the movement of human handheld grippers is tracked and located in real time, and then mapped to robot operations. It can realize the collection of various types of high-precision and fast robot general skill operation data in a short time. Compared with traditional manual remote control collection, it can obtain more types and better quality operation data sets.
[0078] The above is only a preferred implementation case of the present invention and does not limit the present invention in any form. Although the implementation process of the present invention is described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the above examples, or replace some of the technical features therein with equivalents. All modifications, equivalent replacements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for collecting robot operation data based on SLAM, characterized in that: The following steps are involved: Step 1: Use a handheld gripper tool with a camera to capture its operation video by setting ArUco marks; Step 2: Use the monocular visual inertial SLAM algorithm to track and locate the camera in the collected video, estimate the camera's position in space, and construct a three-dimensional environment map. Then, periodically detect the camera positioning and update the map to obtain the camera trajectory. Step 3, through ArUco mark detection, the camera trajectory coordinates are used to obtain the positioning coordinates of the gripper tool coordinate system in the world coordinate system and the width of the gripper finger of the gripper tool end effector, thereby obtaining the gripper tool trajectory and gripper finger width change data; Step 4: Output and save the image data of the operation video, the trajectory data of the gripper tool, the width change data of the gripper fingers, and the data timestamp.
2. The robot operation data collection method based on SLAM according to claim 1, characterized in that: The step one comprises: Stick the ArUco logo on the two gripper finger seats of the hand-held gripper and in the shooting environment; Place the handheld gripper tool facing the calibration chessboard to shoot a video and calibrate it to obtain the camera intrinsic parameters; Use a handheld gripper tool to record a continuous operation video.
3. The robot operation data collection method based on SLAM according to claim 1, characterized in that: The second step comprises: The ORB feature extractor is used to extract the feature points of the current input frame image in the video. Track feature points and estimate the camera’s position in the 3D environment map. Use feature points and IMU data to optimize and update the camera pose and 3D environment map. Get the camera's trajectory point.
4. The robot operation data collection method based on SLAM according to claim 3 is characterized in that: The ORB feature extractor extracts the ORB feature points P of the current input frame image cur and descriptor D cur , and save; The tracking feature points and estimating the camera's position and posture in the three-dimensional environment map are specifically as follows: checking whether the current input frame is the first frame, and if it is the first frame, initializing the camera's position and posture to the initial position If it is not the first frame, get the ORB feature point P from the previous frame pre and descriptor D pre , use the FLANN matcher to match the descriptors of the current frame and the previous frame, filter the matching results, select the best matching point pair and extract the matched 3D points from the map and the 2D points from the current frame image, then obtain the camera intrinsic parameter matrix, use the EPnP algorithm to calculate the camera's pose, including the rotation vector and translation vector, and finally convert the rotation vector and translation vector into a homogeneous coordinate transformation matrix, that is, the camera's pose coordinates based on the SLAM coordinate system 5. The robot operation data collection method based on SLAM according to claim 4, characterized in that: The method of using feature points and IMU data to optimize and update the camera pose and three-dimensional environment map is specifically as follows: using the feature points of the current frame [P cur ,D cur ] and IMU data [A cur ,W cur ]Update the local map and use local bundle adjustment to optimize the local map; look for closed loops in the map and detect closed loops by identifying the similarity of feature points. If a closed loop is found, use pose graph optimization for global optimization to reduce cumulative errors; if feature points drift or tracking is lost, relocalize and rematch features to correct the pose.
6. The robot operation data collection method based on SLAM according to claim 1, characterized in that: The step three comprises: Use OpenCV's ArUco library to detect the ArUco logo from the current frame of the captured video, identify its four corner points and ID, and filter out interference and misidentification by the average distance of the corner points from the camera and the ID; The camera uses the ArUco library's landmark pose detection algorithm to identify the poses of the left and right gripper ArUco landmarks based on the current camera coordinate system. And calculate the mean of the two to obtain the homogeneous transformation matrix T from the camera coordinate system to the handheld gripper tool coordinate system cam→tcp Calculate the absolute value of the difference between the two X-axis values to obtain the gripper width F width ; Use the EPnP algorithm to calculate the desktop ArUco marker pose based on the SLAM mapping coordinate system And calculate the homogeneous transformation matrix T from the world coordinate system with the origin as the desktop ArUco mark to the SLAM coordinate system tag→slam , calculate the trajectory of the handheld gripper tool coordinate system based on the world coordinate system According to the coordinate transformation formula: T tcp =T tag→slam ×T cam ×T cam→tcp .
7. The robot operation data collection method based on SLAM according to claim 1, characterized in that: The handheld clamp tool is designed by imitating a solid clamp design and ergonomic design. The clamp body is made of PLA material, and the clamp fingers are made of TPU material.
Citation Information
Patent Citations
Apparatus and method for flexible pick of orange picking robot
CN101273688A
Robot kitchen comprising robot, storage device and container
CN108778634A
Vision-based teleoperation of dexterous robotic system
CN112540671A
Visual perception robot autonomous grabbing skill learning system and method
CN115631401A
Electric power secondary equipment mechanical arm positioning method based on ArUco code
CN116852352A
Cited By
Method for acquiring operation data of tail end of mechanical arm through data acquisition equipment
CN118952289A
Method for acquiring operation data of end of robot arm by data acquisition device
CN118952289B
Robot strawberry picking anthropomorphic operation data collection equipment and data processing method thereof
CN119260769A
Teleoperation mechanical arm system based on non-electric handheld clamping jaw
CN119458316A
Data acquisition system, terminal and method for end effector of humanoid robot
CN119458415A
