**Acknowledgements**

*Service Robotics*

*3.5.4 System node diagram*

*System function node diagram.*

**Figure 29.**

**4. Conclusion**

the average picking time is less than 35 s.

state. Start a state machine visualization service *IntrospectionServe*r in the node, so that we can view the state transition diagram in *SMACH\_viewer* and can monitor the state transition in real time. The data details of each state are shown in **Figure 28**.

**Figure 29** shows that the running node diagram after all ROS nodes in the system is turned on. The node diagram is generated using the *rqt\_graph* command. Each rectangular box represents a topic. The oval box represents a node, and the arrowed lines represent the subscription relationship between each other. Visualization of the node diagram makes the system architecture intuitive.

Since most of the eye-hand coordination and motion control are concurrent, the fluency of multitasks is verified under two plant factories and three greenhouses with different fruit status and illumination variations. The experimental results show that if total number of targets within the visual field is not more than three,

The contribution of this research mainly orients around the software engineering for manipulating the complex robot behavior. Although service robot leverages ROS for rapid development, classical tasks such as eye-hand coordination and continuous operation in an open scenario have not been systematically addressed. In this chapter, we advocate that if the complex robot behavior can be structured, then they can be modeled as Finite State Machines (FSM), and a "Sense Plan Act" (SPA) process can be implemented with a formal software architecture. Meanwhile, we demonstrate that ViSP and SMACH in ROS are beneficial frameworks for developing a dual-arm robot for autonomously harvesting the fruits in plant factory, which embodies the complexity of multi-task planning and scheduling in natural scenes. The experimental results show that the software engineering paradigm effectively improves the system reliability and scalability of the dual-arm harvesting robot.

**130**

This work was supported by the National Natural Science Foundation of China (No. 51775333) and the Scientific Research Program of Shanghai Science and Technology Commission (No. 18391901000).
