Lifecycle

RobotHub Applications have two main entry points.

onStart

This method is called when the application starts its life cycle (e.g. a command to start the application is issued).

Start command can be called in two ways.

1

Start button

By manually pressing the Start button in Perception Apps submenu or RobotHub Studio.

2

RobotHub API

By calling the appropriate RobotHub API.

onStop

The onStop method is called when the application ends its life cycle (e.g. a command to stop the application is issued).

Stop command can be called in three ways.

1

Stop button

By manually pressing the Stop button in Perception Apps submenu or RobotHub Studio.

2

RobotHub API

By calling the appropriate RobotHub API.

3

Exception thrown

After the application crashes more than three times in a row, the agent initiates a stop of the application.

Then the stop process is started and the onStop() method is called. If the process terminates within 3 seconds, the application shuts down and the python process continues to exist. If the termination takes longer than 3 seconds, the operating system shuts down the entire application and the python process is terminated.