Balancing ball balance system simulation model based on ROS system and construction method thereof

By establishing a parallel structure using URDF and Gazebo tags, and combining OpenCV and ROS system node programming, the problem that existing simulation models of ball-and-board balance systems cannot accurately reflect the actual controller effect is solved, and a high-fidelity, easy-to-deploy simulation platform is realized.

CN120930375APending Publication Date: 2025-11-11SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511333693.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing simulation models of cricket ball balancing systems cannot accurately reflect the effect of actual controllers, cannot adjust control parameters in real time, and cannot simulate the parallel structure of cricket ball systems.

Method used

A non-parallel structure is established using the URDF standard, parallel connections are achieved using Gazebo tags, camera images are acquired using OpenCV, and node-based programming of the ROS system is adopted. The model is divided into simulation, vision, control, and visualization nodes, and the startup process is simplified through launch files.

Benefits of technology

This improves the reusability of the model and the accuracy of the simulation results, decouples the control algorithm and the simulation model, reduces parameter debugging time, and improves simulation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930375A_ABST
    Figure CN120930375A_ABST
Patent Text Reader

Abstract

The invention discloses a cricket balance system simulation model based on an ROS system and a construction method of the cricket balance system simulation model, and belongs to the technical field of cricket balance systems. Comprising the following steps: establishing a non-parallel structure of a cricket-ball balance system simulation model by adopting a modeling method of a URDF (Uniform Resource Description Framework) standard; a Gazebo label is used for connecting a steering engine connecting rod and a flat plate part, so that parallel connection of non-parallel structures is realized; the visual part of the simulation model obtains a camera picture by setting OpenCV; a ROS system nodal programming method is adopted, a simulation model is divided into simulation nodes, visual nodes, control nodes and visual nodes, and communication among the nodes is carried out through data interfaces; and a launch file is used to simplify the starting process of the cricket balance system simulation model. Wherein the established non-parallel structure can give play to the advantage of the URDF format as the default support format of the ROS system; and on the basis, an SDF format is inserted, so that the simulation models of the cricket-ball balance system are connected in parallel, the effect of an actual controller can be better reflected, and the model reusability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of cricket and ball balancing systems, specifically relating to a simulation model of a cricket and ball balancing system based on the ROS system and its construction method. Background Technology

[0002] The ball-and-board balancing system is a typical high-order, nonlinear, and strongly coupled electromechanical system, widely used in control theory verification, robot motion control, and intelligent teaching experiments. In recent years, universities and research institutions both domestically and internationally have conducted extensive research on the modeling, control algorithms, and experimental verification of this type of system.

[0003] Existing research on cricket ball balance systems mainly involves building physical systems for experimental testing or using simulation models for experimental simulation. However, compared to simulation platforms, physical systems are limited by equipment, such as camera performance and processor performance.

[0004] Most simulation models of cricket ball balance systems are limited to MATLAB simulations of mathematical models, or simulations based on Unity on existing simulation platforms. Most existing simulation schemes are simulations of mathematical models, which cannot accurately reflect the effect of the actual controller, collect simulation data well, adjust control parameters in real time, etc., and do not actually simulate the parallel structure of the cricket ball system.

[0005] To address this, a simulation model of a plate-ball balance system based on the ROS system and its construction method are proposed. Summary of the Invention

[0006] To address the shortcomings of existing technologies, the present invention aims to provide a simulation model of a plate-ball balance system based on the ROS system and its construction method, thereby solving the problems in the existing technologies.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] A method for constructing a simulation model of a ball-and-board balancing system based on ROS includes the following steps:

[0009] The non-parallel structure of the PCB ball balance system simulation model was established using the URDF standard modeling method;

[0010] Using Gazebo tags, connect the servo linkage and the flat plate section to make the non-parallel structure parallel;

[0011] The visual component of the cricket balance system simulation model acquires camera images using OpenCV.

[0012] The ROS system node-based programming method is adopted to divide the cricket ball balance system simulation model into simulation nodes, vision nodes, control nodes and visualization nodes, and data interfaces are used for communication between nodes.

[0013] Use launch files to simplify the startup process of the cricket ball balance system simulation model.

[0014] A visual recognition scheme was integrated into the simulation model. The specific steps for acquiring camera images using OpenCV are as follows: during initialization, the upper left and lower right coordinates of the tablet are set. Then, irrelevant environments are excluded. Next, by scanning the pixels, it is determined whether the length occupied by white pixels in each row is the preset radius of the ball. If the condition is met, the x-axis and y-axis coordinates of the ball are obtained.

[0015] Furthermore, the simulation node is responsible for loading the robot model and environment, receiving joint information of the cricket balance system from the control node, acquiring images of the ball on the flat plate through a camera, and transmitting them to the vision node.

[0016] Furthermore, the vision node receives image data from the simulation node in the form of an image stream, and obtains the camera image through OpenCV to obtain the position of the ball.

[0017] Furthermore, the control node adopts PID control, which calculates the error signal by subtracting the target position from the ball position, and then obtains the adjustment value of the ball system posture through PID control.

[0018] Furthermore, the visualization node adopts a dynamic parameter approach, allowing the node to change the controllable parameters of the PID and the target position of the ball in real time during operation, create a file containing the above parameters, and upload it to the dynamic parameter server to achieve real-time parameter adjustment.

[0019] A simulation model of a ball-board balance system based on ROS is constructed using the method described above.

[0020] A device for constructing a simulation model of a cricket and ball balance system based on ROS, comprising:

[0021] Structure building module: The non-parallel structure of the PCB ball balance system simulation model is built using the URDF standard modeling method;

[0022] Parallel Structure Module: Using Gazebo tags, the servo linkage and the flat plate section are connected to enable the non-parallel structure to be connected in parallel.

[0023] Visual recognition module: The visual part of the cricket balance system simulation model acquires camera images by setting OpenCV;

[0024] Node partitioning module: The ROS system node-based programming method is adopted to divide the cricket ball balance system simulation model into simulation nodes, vision nodes, control nodes and visualization nodes, and data interfaces are used for communication between nodes;

[0025] Launch Setup Module: Uses launch files to simplify the startup process of the cricket ball balance system simulation model.

[0026] A computer storage medium storing a readable program, which, when run, instructs a computing device to execute the above-described method for constructing a simulation model of a clapper and ball balance system based on a ROS system.

[0027] An electronic device includes: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0028] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above-described method for constructing a simulation model of a plate and ball balance system based on the ROS system.

[0029] The beneficial effects of this invention are:

[0030] 1. The non-parallel structure of the clapper ball balance system simulation model is established using the URDF standard modeling method. This leverages the advantage of URDF format as the default supported format of the ROS system, such as the ability to use ROS system format conversion commands and structural analysis commands. On this basis, the SDF format is inserted to enable the clapper ball balance system simulation model to achieve parallel connection, which better reflects the effect of the actual controller and improves the reusability of the model.

[0031] 2. The simulation model integrates a visual recognition algorithm, which can simultaneously reflect the impact of the visual recognition algorithm and the control algorithm on the results in the simulation, making the simulation results closer to reality.

[0032] 3. By adopting a node-based programming approach, the simulation model and simulation environment are integrated into a single node, thereby decoupling the control algorithm from the simulation model. The control method does not need to be abstracted into a mathematical model, and the simulation and real-world environments can be reused.

[0033] 4. A parameter server was used in the programming of the control nodes, which can dynamically adjust the simulation control parameters, reduce the time required for parameter debugging, and improve simulation efficiency. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a flowchart of the modeling, simulation, and control process for the ball-and-board balancing system of this invention.

[0036] Figure 2 This is a node information communication diagram of the ROS system of this invention;

[0037] Figure 3 This is a schematic diagram of the joint connections in the Gazebo simulation model of the ball-and-board balancing system of this invention. Detailed Implementation

[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] Example 1

[0040] The cricket ball balancing system is a two-dimensional mechanical system, mainly consisting of a flat plate with two mutually perpendicular axes of rotation and an unconstrained ball placed on the plate. Specifically, it can be divided into a support structure, a control structure, and the ball as the control target. The support structure includes a base plate, a support column at the center of the base plate, and the flat plate controlling the ball. The control structure includes two servo mechanisms with perpendicular motion directions, connected to the flat plate via linkages to adjust the plate's position and thus control the ball's motion. The entire device is a complex, dual-input, dual-output nonlinear system with the motion of the flat plate's two-axis actuators as input and the coordinates of the ball's two axes as output.

[0041] A method for constructing a simulation model of a ball-and-board balancing system based on ROS includes the following steps:

[0042] S1, a non-parallel structure of the simulation model of the clapper ball balance system is established using the URDF standard modeling method;

[0043] The specific process of establishing a non-parallel structure using the URDF standard includes:

[0044] 1) Create the base according to the general method of URDF modeling format. <geometry>The label is set to box4,4,0.5; <origin>The labels are set to 0,0,-0.25 to ensure that the origin is on the upper surface of the base.

[0045] 2) Establish a supporting column structure. <geometry>The labels are set to cylinder 0.38, 0.05; <origin>The label is set to 0,0,0, and it is connected to the base in the form of a fixed joint.

[0046] 3) Establish a flat plate structure. <geometry>The label is set to box 1.6,1.6,0.12; <origin>The label is set to 0,0,0.38, and the base is connected in the form of a free joint.

[0047] 4) Establish the servo mechanism structure. The servo mechanism can be abstracted as two connected links, with the lower link on the x-axis. <geometry>Set the boxes to 0,7,0.2,0.2. <origin>The label is set to 0.4,0,0, and it is connected to the base via a limit joint. Upper connecting rod. <geometry>The values ​​are set to 0.2, 0.2, 0.7, and connected to the lower link in a continuous joint configuration. The y-axis link is placed symmetrically.

[0048] 5) Establish a small ball structure, and separately build a model of the controlled small ball. <geometry>Set to sphere, 0.2.

[0049] S2, using the Gazebo tag, connects the servo linkage and the flat plate section, enabling the non-parallel mechanism to be connected in parallel;

[0050] The specific process of using Gazebo tags for structural connections includes:

[0051] Construct a closed-loop joint using Gazebo tags. This joint connects the upper link and the plate, and its joint orientation is 0,0,0.12,0,0,0.

[0052] S3, the visual part of the cricket ball balance system simulation model acquires camera images by setting OpenCV (an open-source computer vision library);

[0053] The specific steps for acquiring camera footage using OpenCV are as follows: During initialization, set the top-left and bottom-right coordinates of the tablet. In subsequent processing, exclude irrelevant environments. Then, scan the pixels and determine if the length occupied by white pixels in each row is equal to the preset radius of the ball. If the condition is met, obtain the x-axis and y-axis coordinates of the ball. Record the error between the ball's current coordinates and the preset coordinates as the input for position control.

[0054] S4, in terms of the overall structure of the cricket ball balance system simulation model, adopts the node-based programming method of the ROS system, which divides the cricket ball balance system simulation model into simulation nodes, vision nodes, control nodes and visualization nodes, and uses data interfaces for communication between nodes.

[0055] The specific process of node partitioning using the node-based programming method of the ROS system includes:

[0056] 1) For the actuators and sensors in the simulation model, namely the connecting joints of the lower link and base and the camera part described in S1, configure the corresponding interfaces. Configure the joints for position control and set the damping coefficient to 0.4. Set the camera part to an image size of 640*480, store it as 8-bit RGB, and set the shooting frame rate to [missing information].

[0057] 30Hz. The simulation part is packaged separately as a Gazebo node and published in the ROS system, with input topic / joint_states and output topic / camera / image_raw.

[0058] 2) The vision component is set up as a separate node, accepting image data from / camera / image_raw. (This is achieved through...)

[0059] OpenCV captures the camera feed. During initialization, the top-left and bottom-right coordinates of the tablet are set. In subsequent processing, irrelevant environments are excluded. Then, by scanning pixels, it's determined whether the length of white pixels in each row matches the preset radius of the ball. If the condition is met, the x-axis and y-axis coordinates of the ball are obtained. These coordinates are then posted as the topic / red_ball_px.

[0060] 3) The control section is set as a node, receiving data from / red_ball_px, calculating the error between the ball's current coordinates and the preset coordinates as the input for position control. It calculates the controller change using a PID algorithm and outputs it to the topic / servo1_position_controller.

[0061] like Figure 1 As shown, the modeling and simulation control process of the cricket ball balance system is as follows:

[0062] The simulation node is responsible for loading the robot model and environment, receiving joint information of the cricket balance system from the control node, acquiring images of the ball on the flat plate through the model's camera, and transmitting them to the vision node.

[0063] The visual node receives image data from the simulation node in the form of an image stream. It acquires camera footage via OpenCV, and during initialization, sets the top-left and bottom-right coordinates of the tablet. In subsequent processing, irrelevant environmental conditions are excluded. Then, by scanning pixels, it determines whether the length of white pixels in each row matches the preset radius of the ball. If the condition is met, the x-axis and y-axis coordinates of the ball are obtained. The error between the ball's current coordinates and the preset coordinates is calculated as the input for position control.

[0064] The control node adopts PID control, which calculates the error signal by subtracting the target position from the ball position, and then uses PID control to obtain the adjustment value of the ball system posture.

[0065] The visualization node employs dynamic parameters, allowing the node to modify the controllable parameters of the PID controller and the target position of the ball in real time during operation. A cfg format file containing these parameters is created and uploaded to a dynamic parameter server. Using the interface provided by the parameter server, real-time parameter adjustments can be made within the RQt tool. Specifically, functions from the `dynamic_reconfigure.parameter_generator_catkin` library are called to upload the PID's proportional, integral, and derivative parameters, along with the target position of the ball, to the parameter server. In the real-time simulation results, these parameters are not read from the program but from the parameter server, enabling real-time parameter modification without requiring a program restart.

[0066] The ROS system node information communication process is as follows: Figure 2 As shown, communication between the simulation node and the vision node uses topic-based communication. The simulation node Gazebo publishes image stream information from the topic ` / camera / image_raw`, which is received by the vision node ` / red_ball_tracker`. Communication between the vision node and the control node also uses topic-based communication. The vision node ` / red_ball_tracker` publishes 64-bit floating-point information from the topic ` / red_ball_px`, which is received by the control node ` / ball_balance`. Data from the parameter server modifies the control node's parameters via shared pointers, enabling real-time parameter changes during the simulation.

[0067] S5 uses launch files to simplify the startup process of the cricket ball balance system simulation model;

[0068] The launch file loads nodes including Gazebo, joint_state_publisher, robot_description, and controller_spawner. The `arg` tag sets parameters for the Gazebo simulation, such as paused, use_sim_time, gui, headless, and debug, specifying details like the path and loading location of the model in Gazebo. This simplifies the startup process, eliminating the need for repeated parameter calibration for each load.

[0069] In summary, this embodiment establishes a non-parallel mechanism using the URDF standard, and then uses Gazebo tags to connect the servo linkage to the platform in a parallel structure. This allows the simulation to directly reproduce the mechanical characteristics of a real cricket ball balancing system, completely simulating the parallel structure within the system and more closely resembling the actual system. The vision component uses OpenCV to acquire camera images and is based on a ROS node-based architecture, divided into simulation, vision, control, and visualization nodes. These nodes communicate via standard data interfaces and are launched with a single click using a launch file. This allows for seamless migration of control algorithms between simulation and physical implementations, and the ROS parameter server enables online adjustment of control parameters such as PID control. This results in a high-fidelity, easily deployable simulation platform covering the entire process from modeling and perception to control.

[0070] Based on a similar inventive concept, embodiments of the present invention also provide a computer storage medium storing a readable program that, when run by a processor, can execute the above-described method for constructing a simulation model of a plate and ball balance system based on a ROS system.

[0071] Based on a similar inventive concept, this invention provides an electronic device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0072] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above-described method for constructing a simulation model of a plate and ball balance system based on the ROS system.

[0073] Based on a similar inventive concept, embodiments of the present invention also provide a computer program product, including computer instructions, which instruct a computing device to perform the operations corresponding to the above-described method for constructing a simulation model of a plate and ball balance system based on the ROS system.

[0074] Example 2

[0075] In this embodiment, a simulation model construction device for a plate and ball balance system based on ROS is proposed, specifically including:

[0076] Structure building module: The non-parallel structure of the PCB ball balance system simulation model is built using the URDF standard modeling method;

[0077] Parallel Structure Module: Using Gazebo tags, the servo linkage and the flat plate section are connected to enable the non-parallel structure to be connected in parallel.

[0078] The vision module: The vision part of the cricket balance system simulation model acquires camera images by setting OpenCV;

[0079] Node partitioning module: The ROS system node-based programming method is adopted to divide the cricket ball balance system simulation model into simulation nodes, vision nodes, control nodes and visualization nodes, and data interfaces are used for communication between nodes;

[0080] Launch Setup Module: Uses launch files to simplify the startup process of the cricket ball balance system simulation model.

[0081] The methods of the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses the code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for performing the methods shown herein.

[0082] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.< / geometry> < / geometry> < / origin> < / geometry> < / origin> < / geometry> < / origin> < / geometry> < / origin> < / geometry>

Claims

1. A method for constructing a simulation model of a ball-plate balance system based on ROS, characterized in that, Includes the following steps: The non-parallel structure of the PCB ball balance system simulation model was established using the URDF standard modeling method; Using Gazebo tags, connect the servo linkage and the flat plate section to make the non-parallel structure parallel; The visual component of the cricket balance system simulation model acquires camera images using OpenCV. The ROS system node-based programming method is adopted to divide the cricket ball balance system simulation model into simulation nodes, vision nodes, control nodes and visualization nodes, and data interfaces are used for communication between nodes. Use launch files to simplify the startup process of the cricket ball balance system simulation model.

2. The method for constructing a simulation model of a plate-ball balance system based on a ROS system according to claim 1, characterized in that, A visual recognition scheme was integrated into the simulation model. The specific steps for acquiring camera images using OpenCV are as follows: during initialization, the upper left and lower right coordinates of the tablet are set. Then, irrelevant environments are excluded. Next, by scanning the pixels, it is determined whether the length occupied by white pixels in each row is the preset radius of the ball. If the condition is met, the x-axis and y-axis coordinates of the ball are obtained.

3. The method for constructing a simulation model of a plate-ball balance system based on a ROS system according to claim 1, characterized in that, The simulation node is responsible for loading the robot model and environment, receiving joint information of the cricket ball balance system from the control node, acquiring images of the ball on the flat plate through a camera, and transmitting them to the vision node.

4. The method for constructing a simulation model of a plate-ball balance system based on a ROS system according to claim 2, characterized in that, The visual node receives image data from the simulation node in the form of an image stream, and uses OpenCV to obtain the camera image to determine the position of the ball.

5. The method for constructing a simulation model of a plate-ball balance system based on a ROS system according to claim 1, characterized in that, The control node adopts PID control, which calculates the error signal by subtracting the target position from the ball position, and then uses PID control to obtain the adjustment value of the ball system posture.

6. The method for constructing a simulation model of a plate-ball balance system based on a ROS system according to claim 1, characterized in that, The visualization node uses dynamic parameters, allowing the node to change the controllable parameters of the PID and the target position of the ball in real time during operation, create a file containing the above parameters, and upload it to the dynamic parameter server to achieve real-time parameter adjustment.

7. A simulation model of a ball-and-board balancing system based on ROS, characterized in that, It is constructed using the construction method described in any one of claims 1-6.

8. A device for constructing a simulation model of a clapper and ball balance system based on a ROS system, characterized in that, include: Structure building module: The non-parallel structure of the PCB ball balance system simulation model is built using the URDF standard modeling method; Parallel Structure Module: Using Gazebo tags, the servo linkage and the flat plate section are connected to enable the non-parallel structure to be connected in parallel. Visual recognition module: The visual part of the cricket balance system simulation model acquires camera images by setting OpenCV; Node partitioning module: The ROS system node-based programming method is adopted to divide the cricket ball balance system simulation model into simulation nodes, vision nodes, control nodes and visualization nodes, and data interfaces are used for communication between nodes; Launch Setup Module: Uses launch files to simplify the startup process of the cricket ball balance system simulation model.

9. A computer storage medium storing a readable program, characterized in that, When the program runs, it can instruct the computing device to execute the method for constructing a simulation model of a plate and ball balance system based on the ROS system as described in any one of claims 1-6.

10. An electronic device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the ROS-based plate and ball balance system simulation model construction method as described in any one of claims 1-6.