The Robotics Application Manager (RAM) is an advanced manager for executing robotic applications. It operates as a state machine, managing the lifecycle of robotic applications from initialization to termination.
Manager
The Manager
class is the core of RAM, orchestrating operations and managing transitions between various application states.
idle
: The initial state, waiting for a connection.connected
: Connected and ready to initiate processes.world_ready
: The world environment is set up and ready.visualization_ready
: Visualization tools are prepared and ready.application_running
: A robotic application is actively running.paused
: The application is paused.connect
: Moves from idle
to connected
.launch_world
: Initiates the world setup from connected
.prepare_visualization
: Prepares the visualization tools in world_ready
.run_application
: Starts the application in visualization_ready
or paused
.pause
: Pauses the running application.resume
: Resumes a paused application.terminate
: Stops the application and goes back to visualization_ready
.stop
: Completely stops the application.disconnect
: Disconnects from the current session and returns to idle
.on_connect(self, event)
: Manages the transition to the 'connected' state.on_launch_world(self, event)
: Prepares and launches the robotic world.on_prepare_visualization(self, event)
: Sets up visualization tools.on_run_application(self, event)
: Executes the robotic application.on_pause(self, msg)
: Pauses the running application.on_resume(self, msg)
: Resumes the paused application.on_terminate(self, event)
: Terminates the running application.on_disconnect(self, event)
: Handles disconnection and cleanup.Manager
and ManagerConsumer
ManagerConsumer
puts received messages into manager_queue
for Manager
to process.Manager
sends state updates or commands to the client through ManagerConsumer
.Manager
relies on ManagerConsumer
for client connection and disconnection handling.ManagerConsumer
communicates exceptions back to the client and Manager
.Manager
controls the start and stop of the ManagerConsumer
WebSocket server.Manager
and LauncherWorld
Manager
initializes LauncherWorld
with specific configurations, such as world type (e.g., gazebo
, drones
) and the launch file path.LauncherWorld
dynamically launches modules based on the world configuration and ROS version, as dictated by Manager
.Manager
is updated in response to the actions performed by LauncherWorld
. For example, once the world is ready, Manager
may transition to the world_ready
state.Manager
can instruct LauncherWorld
to terminate the world environment through its terminate
method. LauncherWorld
ensures a clean and orderly shutdown of all modules and resources involved in the world setup.Manager
handles exceptions and errors that may arise during the world setup or termination processes, ensuring robust operation.Manager
and LauncherVisualization
Manager
initializes LauncherVisualization
with a specific visualization configuration, which can include types like console
, gazebo_gra
, gazebo_rae
, etc.LauncherVisualization
dynamically launches visualization modules based on the configuration provided by Manager
.Manager
can update its state (e.g., to visualization_ready
) to reflect the readiness of the visualization environment.Manager
can instruct LauncherVisualization
to terminate the current visualization setup using its terminate
method.Manager
is equipped to manage exceptions and errors that might occur during the setup or termination of visualization tools.Manager
and application_process
Manager
initiates the application_process
when transitioning to the application_running
state.application_process
, Manager
configures the necessary parameters.Manager
monitors and controls the application_process
.Manager
is responsible for handling any errors or exceptions that occur during the execution of the application_process
.application_process
is closely synchronized with the state machine in Manager
.Manager
and Server
(Specific to RoboticsAcademy Applications)Server
is used exclusively for RoboticsAcademy applications that require real-time interaction with a web-based GUI.Server
handles incoming and outgoing messages.Server
allows for real-time feedback and interaction within the browser-based GUI.Manager
initializes and controls Server
based on the specific needs of the RoboticsAcademy application being executed.Manager
ensures robust error handling for Server
.Connecting to RAM:
idle
state.connect
transition and moving RAM to the connected
state.Launching the World:
launch_world
command.world_ready
state after successfully setting up the world environment.Setting Up Visualization:
prepare_visualization
command.visualization_ready
state, indicating that visualization tools are set up and ready.Running an Application:
application_running
state.Pausing and Resuming Application:
pause
and resume
commands to RAM to control the application's execution.paused
state when paused and returns to application_running
upon resumption.Stopping the Application:
stop
command to halt the application.visualization_ready
state, ready for new commands.Disconnecting:
idle
state, ready for a new session.