Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

2.2 Robot Behavior

Authors
Affiliations
Delft University of Technology
Delft University of Technology
Updated: 26 Aug 2026

A common approach in robotics for navigation- and perception-heavy tasks is to use a global behavior tree that describes the robot’s actions in different situations. This architecture, as shown in Figure 1, is used here to describe and execute the cleaning strategy. The Py Trees for ROS python package is used to implement a behaviour tree due to its high level of documentation, aswell as native support in ROS 2.

Global behavior tree of the entire system

The behavior tree provides a hierarchical approach for coordinating navigation, perception, and cleaning actions. It also provides a clear structure for debugging. As seen in Figure 1, the robot first explores the environment, then pauses its coverage task whenever an object is detected, approaches the object, checks whether it is still visible, picks it up, and places it in the appropriate basket.

Input: Coverage segments P\mathcal{P}, planner type τ\tau
Output: Task result (success / cancelled / stopped)


  1. P\mathcal{P} \leftarrow sortByLength(P\mathcal{P}, descending)

  2. nPn \leftarrow |\mathcal{P}|,   i0\;i \leftarrow 0

  3. While P\mathcal{P} \neq \emptyset:

    1. PiP_i \leftarrow dequeue(P\mathcal{P}),   ii+1\;i \leftarrow i + 1

    2. nav2.goThroughPoses(toROSPath(PiP_i))

    3. Repeat until nav2.isTaskComplete():

      1. ff \leftarrow nav2.getFeedback()

      2. publishFeedback(ii, nn, ff.remainingPoses)

      3. If cancelRequested: nav2.cancelTask(), return CANCELLED

      4. If stopRequested: nav2.cancelTask(), return STOPPED

      5. If pauseRequested:

        1. nav2.cancelTask()

        2. PremP_{rem} \leftarrow computeRemainingSegment(PiP_i, getRobotPos())

        3. prepend PremP_{rem} to P\mathcal{P}     (resume from current pose)

        4. Repeat until ¬\negpauseRequested: spinOnce()

        5. nav2.goThroughPoses(toROSPath(PremP_{rem}))

    4. publishFeedback(ii, nn, 0)

  4. Return SUCCESS