The Control System and Application Based on ROS Elevating Fire-Fighting Robot

Nowadays, fire accident is happening frequently which brings serious damages to people’s lives and properties; at present, fire-fighting robot is unable to perform targeted fire-fighting and combustion source at high places has brought difficulties to fire control and fighting; therefore, fire-fighting and assistance are facing unprecedented challenges. In view of this, the paper researched and developed an automatic control system for elevating fire-fighting robot, so as to solve the key difficulties and problems for fire control and fighting of fire-fighting robots. The research target consists of three aspects, firstly, the system has realized the elevating fire control and fighting function; secondly, we have designed an automatic control system for elevating fire-fighting robot based on ROS structure; thirdly, the paper has established the automatic control strategy play for raise arm of the elevating fire-fighting robot featured with stable and controllable operation, so as to solve the problem of unsteadiness in the elevating process and speed up application and popularization of fire-fighting and disaster rescue of the fire-fighting robot.


Introduction
With rapid economic development in recent years, fire accident has been happening frequently. For example, the fire disaster happened in the warehouse of Mengniu at , Anhui Ma'anshan, explosion of logistics warehouse at Tianjin port and other extra serious accidents [1][2][3] ; the aforementioned fire disasters are featured with rapid fire spreading, complicated conditions on site and information loss, which may bring great difficulties to fire prevention and directly threaten personal safety of fire-fighting personnel; therefore, fire-fighting and assistance are facing unprecedented challenges.
In order to solve the aforementioned problems, the fire-fighting robot integrated with fire control science and technology and robot motion control technology was developed. The fire-fighting robot is capable of assisting firemen to have the information at the scene of fire, guide the work of fire control and take the place of firemen to go into the scene of fire disaster with high temperature, oxygen deficit, poisonous gas and other dangers for putting out fire, searching, rescuing and etc. [4][5][6] U.S., Italy and other developed countries have carried out researches on fire-fighting robots at earlier period of time. HAZBOTII1 robot researched and manufactured by U.S. NASA JPL Robotics for exploring real-time conditions of the scene of fire and WALK-MAN anthropomorphic fire-fighting robot researched and developed by Italy have all played significant roles in exploration, putting out fire and disaster rescue [7] ; however, the aforementioned fire-fighting robots have the problem of insufficient moving mobility and cannot be flexibly dispatched at the scene of fire at the very first time. Compared with foreign countries, research and development on fire-fighting robots in China started relatively late, but has gained rapid 2 development in recent years. Zhejiang University conducted the research on low-cost dual-wheel driven self-balancing fire-fighting robot [8] featured with small structure and low driving load; however, limited quantity of fire-fighting equipment can be carried on the aforementioned fire-fighting robot, which makes it unable to efficiently put out fire in large areas; Nanchang University developed the research on crawler-type fire-fighting robots [9] which greatly improve obstacle climbing ability on complicated landform; however, as the fire cannon is installed on bodywork, it will be very difficult to put out combustion source on high places. In view of this, the paper researched and developed an automatic control system for elevating fire-fighting robot, so as to solve the key difficulties and problems of automatic control on fire protection of fire-fighting robots. The research target consists of three aspects, firstly, the system has realized the elevating fire control and fighting function; secondly, we have designed an automatic control system for elevating fire-fighting robot based on ROS structure; thirdly, the paper has established the automatic control strategy play for raise arm of the elevating fire-fighting robot featured with stable and controllable operation, so as to solve the problem of unsteadiness in the elevating process and speed up application and popularization of fire-fighting and disaster rescue of the fire-fighting robot.
Content organization of the paper is as follows: Chapter 1 introduced robot hardware system design, Chapter 2 introduced the integrated control system based on ROS, Chapter 3 introduced the operation procedure of parameterized configuration, Chapter 4 introduced raise arm control method, Chapter 5 introduced elevating fire-fighting robot control system test, Chapter 6 made the conclusion on the research and provided outlook on future work.

Ontology Design
Elevating fire-fighting robot mainly consists of four-wheel chassis, raise arm and fire water monitor. The four-wheel chassis is applied for moving and transporting the raise arm and fire cannon to the scene of fire, and the raise arm is for elevating the fire cannon to the height of combustion source to put out fire.
The researched and developed elevating fire-fighting robot system scheme design is shown in Figure  1. The four-wheel chassis is applied for transporting the fire-fighting robot at high places to the scene of fire. It adopts four motor-driven wheel-type frame chassis and is featured with easy control, relatively high driving speed, excellent traction adhesiveness, ground clearance driving trafficability and etc. The raise arm adopts 5-dof hydraulic raise arm, is installed on the four-wheel chassis, and is applied for elevating the fire cannon to appropriate height and posture from the combustion source, so as to facilitate extinguishing fire. The fire cannon is installed on tail end of the raise arm and applied for ejecting fire protection materials. The R&D system also consists of sensors, fire main winch and other auxiliary equipment for cooperatively putting out fire.

System Design
Robot brain of the system scheme adopts TX2 as the master control hardware of the robot and Ubuntu18.04+ROS Melodic system platform as the operating system, and is featured with efficient interconnection of information bus, closed-loop simulation verification system, man-machine interaction module, fire-fighting and extinguishing control algorithm, sensor data processing algorithm and etc. The visual system consists of binocular camera, panorama camera and other cameras and is connected with the robot brain via Ethernet communication. The binocular camera is installed on the fire cannon and for recognizing combustion source position, and the panorama camera is installed in front of and at rear of the four-wheel chassis and is used for acquiring panorama information of the scene of fire and providing more environmental information for firemen. Point cloud system consists of x86resolving industrial personal computer, 16-line radar and imu, among which, x86resolving industrial personal computer is responsible for integrating various radar and IMU data, is connected with robot brain via Ethernet communication and applied for establishing 3D environmental data, navigation and obstacle avoidance. Robot cerebella adopts STM32H743ZIT6 series of STMicroelectronics Company [10][11] .Robot cerebella may access various types of sensors and realize hardware synchronization of positioning, navigating and evading obstacle sensor data. IMU posture perception and robot cerebella adopt serial communication for perceiving four-wheel chassis posture. Temperature sensor and robot cerebella adopt serial communication for perceiving temperature information of the elevating fire-fighting robot body. Ultrasonic data and robot cerebella adopt IO input for perceiving close obstacles of the four-wheel chassis. Communications among four-wheel chassis driving system, raise arms, fire cannon and robot cerebella adopt CAN bus. The four-wheel chassis driving mechanism consists of four motors for controlling movement of the four-wheel chassis. The raise arm adopts hydraulic driving mode and may control fire cannon to align with combustion source via rotating the chassis, tower arm, and fore-arm as well as forward and backward motions of the telescopic arm. The fire cannon is installed on terminal of the raise arm and may adjust water spraying and putting out fire by means of rotation and pitching. The mobile terminal may realize remote instruction sending to control the fire-fighting robot, display firefighting robot status and sense information.

Communication Design
The robot system mainly adopts Ethernet communication mode and is featured with rapid communication configuration, excellent expansibility and etc. Communication frame design can be classified into centralized control system and distributed node. The centralized control system serves as the robot operating system (ROS). The four-wheel chassis driving system, raise arm joint control unit, fire cannon control unit, status system, ultrasonic system, visual system, point cloud system and other hardware units are abstracted to nodes. After constructing the hardware mapping network, hardware interface layer of the developed control system may provide safe object-oriented interviews, so as to perform communication or monitoring with underlying hardware.

Overview
Generally speaking, operation procedure of the fire-fighting robot is: Firstly, make maps of the work environment via instrument and have it imported into the fire-fighting robot system; or, in case of controlling the fire-fighting robot to move at the work environment, acquire 3D information via point cloud system and make maps; if the fire alerting system detects fire disaster at operating environment, system will send initial orientation of the combustion source to fire-fighting robot; after receiving the instructions, the fire-fighting robot will perform route planning and arrive at the scene of fire; the binocular camera starts to recognize combustion source position and robot brain controls fire cannon to align with combustion source for putting out fire [12][13][14] .
For the automatic control of elevating fire-fighting robot, the system shall be equipped with: (1) Mobile function: The fire-fighting robot moves from garage to the scene of fire and cooperative operation of the four-wheel chassis motor shall be ensured.
(2) Communication function: Receive initial orientation of the fire disaster from the fire alerting system; the robot brain is responsible for issuing various hardware control instructions; pass back robot status to robot brain and data to ultrasonic system, point cloud system, visual system and four-wheel chassis driving system, perform data analysis and wait for next step of processing.
(3) Combustion source recognition and alignment function: After recognizing combustion source position by binocular vision, accurate control of the moving unit according to the coordinate position of the fire source.
(4) Fire extinguishing function: The fire water monitor valve is controlled by motor and the function of fire extinguishing is realized via spraying water from the fire water monitor.
We adopt modular design control system as the main concept to satisfy the aforementioned requirements. Based on the powerful ROS frame, we designed the control system on basis of task manager layer, motion control layer, base layer and interface layer. Block diagram of the four layers and key modules is shown in the figure 2.

Task and Other Management Layers motion control
Hardware IO Simulation IO

Base Layer Based on ROS Frame
As the base layer, ROS is the core of the control system, provides efficient framework support for realizing modularized function and integrated communication system for information management.
Therefore, while developing fire control and extinguishing control system, based on distributed parameterized design system, all node modules shall be considered as one group of feature pack and stored in shared environment. Data flow including system configurations, planning and control results, action messages and hardware unit status are managed by publish/subscribe mechanism based on theme and request/response mechanism based on service built in ROS. Data type is defined in standard element type or defined as array of element type in control_msgs package.

Task Management Layers
Fire control task management is mainly responsible for the process management of the task. Operation task flow parameter configuration transforms description file of fire control and extinguishing operation procedure into parameterized configuration, constructs step sequence flow structure to manage all fire control and extinguishing control nodes of the fire control and extinguishing task. Therefore, firstly a proposed parameterized model shall be invoked to acquire all fire control and extinguishing operation procedure features, refer to self-define fire extinguishing procedure parameterization specified in Section Three for detailed information. After parameterization, all transformed fire control and extinguishing operation control nodes will be timely buffered into tree structure for management.
Fire control task manager segments and distributes all fire control tasks to motion planner and controller. In fire control process, node data will be updated and managed in time flow. According to fire control operation flow, tasks will be distributed to various function modules for ordered, reasonable and effective fire control and extinguishing operation.

Motion Control Layer
Motion control layer serves as the core layer in automatic control system of fire control and extinguishing operation designed by us; therefore, the elevating fire-fighting robot shall be controlled and moved from garage to scene of fire for putting out fire; during the aforementioned process, the raise arm shall be controlled to elevate the fire cannon to appropriate height from the combustion source and the fire cannon shall be controlled to putt out fire.
The raise arm control plays extremely significant role in fire control and extinguishing operation. By means of overcoming the motion of upward and downward vibration, accurately elevate the fire cannon to appropriate position from the combustion source, so as to realize safe, efficient and rapid fire control and extinguishing. Therefore, the paper proposed an raise arm control method that will be introduced in Chapter 4 in details. In the matter of functions, we designed three-module structure including the elevation planner, hardware unit mechanism and elevation motion controller.  In order to realize the elevation planner for detecting elevation control method on basis of collision, we developed the motion planner package under ROS frame and applied comprehensive collision supervision. After the collision-free path is generated, the control system needs to tell the raise arm how to execute the planning result. MoveIt is a user-friendly platform for developing robot applications and integrated with latest progress planning, operation, kinematics and control [15] . Under MoveIt frame, packaging robot mechanism and packaging motion controller are developed to control operations of elevation and fire control.
Hardware unit mechanism consists of hardware resources and configurations of moveit, kinematics and robot status. Hardware resources mainly include the elevating fire-fighting robot model for describing robot status and relationships among various hardware modules. Various hardware modules of the elevating fire-fighting robot perform describer physical dimensions model in form of CAD file and describe relationships among various hardware modules of the elevating fire-fighting robot with the uniform robot description format provided by ROS, so as to acquire kinematic tree model of the elevating fire-fighting robot. ROS also provides MoveIt installation assistant plug-in [16] to integrate Movelt into the elevating fire-fighting robot system. The thirdparty kinematic plug-in / tool may help us to perform kinematic solution on the raise arm, so as to acquire better inverse kinematics performance [17] .Robot status consists of joint status and TF status. Robot joint status acquires joint angles via robot joint sensor and issues to topic joint_states. TF status acquires data via joint status joint joint_states and issues various joint connecting rods and 3D pose TF status of the elevating fire-fighting robot via kinematic tree model of the robot.

Hardware Interface Layer
Hardware interface layer serves as the converter between the hardware unit and ROS base. The layer is the combination of bottom communication protocol, provides ROS with software interface so that applications may access and operate hardware. The layer can communicate with controller via Ethernet in our frame. The elevating fire-fighting robot driver communicates with ROS system via defining motion control messages. Tracks will flow to hardware controller by using the message type via supported communication protocol, then robot controller will buffer the aforementioned points, insert among them so as to drive robot motor to achieve desired posture.
In actual applications, communication protocol is forwarded to the communication type supported by target robot controller. At present, we have realized drive program by using MODBUS protocol in our hardware system and provides api.
After acquiring interface connection, we can construct two nodes, motion controller server and motion controller client side, so as to establish the normal form of request-response issued by motion instruction.

Simulation Interface Layer
ROS visual tool RVIZ provides a 3D viewer for operation scene and information display, which may convert the robot model established by codes into visual 3D model [18]. Send sensor data and status information in standard message format of our RVIS plug-in, so as to simulate real motions of the elevating fire-fighting robot. We can use real sensor data to perform credible interaction with robot model, so as to realize data mapping between real robot and simulated robot.

Parameterized Configuration Operation Procedure
In fire control and extinguishing operation, firemen shall plan fire control operation task procedure according to initial position of combustion source and environmental condition at the scene. Compared with traditional fire control and extinguishing in manual manner or similar methods, control and extinguish fire by robots is to establish environmental model with laser point cloud and adopt modern computer-aided technology to design fire control and extinguishing operation in visual, accurate and efficient manners. Above all, it makes autonomous fire control and extinguishing of robots possible.
Therefore, before autonomous fire control and extinguishing, it is suggested to acquire orientation of possible fire disaster according to sensing position of the fire alerting system, design fire control Fire control and extinguishing operation task procedure constituents operation task Job_File by operation step sequence Segment. Operation step sequence consists of system initialization, four-wheel chassis driving system operation, visual system operation, raise arm system operation and fire cannon system operation, and each operation constituents responsive actions; fire control and extinguishing operation task procedure file is described via class structure, such as operation task class Job_File{class Segment;}, operation step sequence class Segment{class move_system;class visual_system;class raiseArm_system;class fireCannon_system;}.Four-wheel chassis driving system operation class move_system{int Target_ID;class TargetPath;}. With regard to multiple initial positions of possible fire disaster orientations in the fire alerting system, it is suggested to set up multiple paths to arrive at initial position of the fire disaster orientation, and the target point path parameter structure is class TargetPath{class waypoints;}. Path consists of key path points and key path point parameter structure is class waypoints{double x;double y;double angle;}, among which, define garage origin coordinate system as {O}, bodywork coordinate system as {A}, x, y, angle represents corresponding bodywork positions taking garage as the original coordinate system, respectively, X direction position, Y direction position and rotating angle around Z axis; visual system operation class visual_system{ bool fire_recognize;}, fire_recognize instruction serves as combustion source recognition instruction;raise arm system operation class raiseArm_system{ bool raiseArm_plan;bool raiseArm_go ;}, raiseArm_plan instruction serves as the raise arm motion planning instruction, raiseArm_goinstruction executes for raise arm according to planned path points; fire cannon system operation class fireCannon_system{bool fireCannon_move;bool fireCannon_gush;}, fire cannon posture shall be adjusted according to combustion source position, fire cannon operation control instruction fireCannon_move shall be constructed, control water spraying of the fire cannon via establishing fire cannon water spraying control instruction fireCannon_gush.

RaiseArm Control Method
In case of stable elevation of the heavy-type elevating hydraulic arm equipped with water pipes and fire cannon, elevating planning task can be extremely arduous. In case of adopting coordinated control for controlling elevation of heavy water pipes and fire cannon, it requires driving system with relatively high power and more precise hydraulic control system to perform stable control on motion with large power and inertia, and will result in relatively high cost. Therefore, with regard to the raise arm of lowcost hydraulic control system, it is suggested to adopt the raise arm of non-coordinated manner to realize stable motion control in certain sequence of control joint elevating plan, so as to ensure lifting motion continuity of the terminal of the raise arm, and reduce vibration phenomenon caused by inertia effect.

Raise Arm Motion Unit Introduction
Raise arm is installed on the four-wheel chassis and is moved from garage to the scene of fire via the four-wheel chassis. The raise arm needs to be initially aligned with the scene of fire, elevate the fire cannon to appropriate height from the combustion source and control the fire cannon to put out fire. Therefore, in order to realize the aforementioned series of operations, the raise arm shall consist of chassis turntable, tower arm, linkage arm, main arm, telescopic arm and other kinematic units to complete the fire control and extinguishing operation. Jt . The fire cannon is installed on terminal of the telescopic arm and can be controlled by the hydraulic system to upwardly and downwardly rotate and driven by the motor to swing to left and right. Elevation plan of the raise arm consists of three parts, the first part is responsible for initially aligning with target point planning of fire control and extinguishing, controlling base turntable rotating to initially align the raise arm and fire cannon with the direction of combustion source; the second part is responsible for elevation planning strategy; the third part is responsible for declining planning strategy. Xt Yt Ht , Among which, Xt,Yt,Ht refer to coordinates of X axis, Y axis and Z axis, respectively. Taking right-hand rule as the foundation, headstock direction serves as the direction of X axis, the direction that is horizontal and vertical to the headstock serves as the direction of Y axis, and height serves as Z axis;

Raise Arm Elevation Planning Strategy
In case of Xt>0 , control the base turntable and the rotational angle relative to the bodywork are:

Control System Experiment and Test
The paper performed initial verification on elevating fire control, water spraying and fire extinguishing of the developed automatic control system of the elevating fire-fighting robot, and launched walking test, elevating test and fire control and extinguishing test.
With regard to the walking test, control the elevating fire-fighting robot in garage to walk to test scene of fire and detailed information about the walking test is shown in Figure 5. After test verification, the elevating fire-fighting robot is capable of walking from garage to test scene of fire, which may satisfy design requirements. With regard to the elevating test, We use the elevation planner to input different heights to carry out the elevating test, The experimental results show that the raise arm is controlled by the planning of elevating motion at different heights， and can be controlled smoothly to reach the corresponding height. The experimental photos of the elevating motion control of the raise arm at different heights are shown in Fig.6. The elevating motion control test of the raise arm in the developed simulator are shown in Fig.7. The visual 3D model is a transformation of the robot model built in code.  Figure 6 The elevating motion control test of the raise arm was carried out in different height states Figure 7 The elevating motion control test of the raise arm in the developed simulator.
With regard to the fire test, The raise fire-fighting robot carries out raise fire-fighting test on the transformer of the substation.The actual test results show that the fire robot can extinguish the fire source in a short time, and can achieve a good fire-fighting effect. As shown in Figure 8, photos of the fire extinguishing process of the transformer from raging fire to being raised by the fire-fighting robot. Figure 8 The raise fire robot carries out fire extinguishing test on the burning transformer.

Conclusion and Future Works
In this paper, we develop a raise fire-fighting robot based on ROS-integrated control system. We adopt modular design for hardware system and software system. This method has the advantages of flexible management and expandable function. In this elevating planning control system, a non-linkage method of raise arm elevating planning has been developed. The developed elevating fire-fighting robot and its control system have been verified in physical movement, elevating and fire-fighting tests. Our future work may include: (1) an automated fire extinguishing system that adapts to a more complex environment; (2) improve the robustness and accuracy of the motion control of the raise arm.