Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/drift-tech/drift-releases/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Drift CLI includes intelligent process management that tracks all running simulations, ROS2 nodes, and background tasks. You can easily monitor what’s running, check process status, and manage multiple simulations simultaneously.
Drift automatically tracks processes it launches, giving you full visibility and control over your robotics environment.

Background process tracking

When you launch simulations or start ROS2 nodes through Drift, they run in the background while keeping the Drift CLI responsive. All background processes are automatically tracked and monitored.

What Drift tracks

Drift monitors:
  • Gazebo simulations — Running simulation instances
  • ROS2 nodes — Individual nodes started by launch files
  • Controller managers — Robot controller processes
  • Sensor pipelines — Camera, lidar, and other sensor processing
  • Navigation stacks — Path planning and localization nodes
  • Visualization tools — RViz and other display applications

Automatic tracking

All processes launched through Drift are automatically registered and monitored.

Health monitoring

Drift detects when processes crash or exit unexpectedly.

Resource awareness

Track CPU and memory usage of your simulation processes.

Clean shutdown

Gracefully terminate processes when needed, avoiding orphaned nodes.

Process lifecycle

  1. Launch: When you start a simulation
    drift> launch my robot
    
  2. Track: Drift registers all spawned processes
  3. Monitor: Continuous health checking in the background
  4. Report: Status available via /ps command
  5. Cleanup: Automatic cleanup on shutdown or manual termination
Drift ensures that when you exit, all child processes are properly terminated to avoid cluttering your system.

Using the /ps command

The /ps command is your window into all running processes managed by Drift.

Basic usage

drift> /ps
Displays a list of currently running processes:
Running Processes:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PID    Process Name              Status    Uptime
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12345  gazebo                    Running   5m 23s
12346  robot_state_publisher     Running   5m 20s
12347  controller_manager        Running   5m 18s
12348  rviz2                     Running   3m 42s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Process information

For each process, /ps shows:
  • PID: Process ID for system-level management
  • Process Name: Identifier for the running application or node
  • Status: Current state (Running, Stopped, Failed)
  • Uptime: How long the process has been running

Detailed process view

drift> show details for process 12345
Get comprehensive information:
  • Command-line arguments
  • Parent/child process relationships
  • CPU and memory usage
  • Output logs
  • Associated ROS2 topics and services
Use /ps regularly when debugging to ensure all expected nodes are running and healthy.

Managing multiple simulations

Drift makes it easy to run and manage multiple simulations or robots simultaneously.

Running multiple instances

drift> launch robot1 in warehouse world
drift> launch robot2 in factory world
Drift keeps both simulations organized:
  • Separate process groups
  • Unique namespaces for ROS2 topics
  • Independent Gazebo instances
  • Isolated logs and outputs

Switching between simulations

drift> /ps
[See both simulations running]

drift> switch to robot1 context
drift> what topics is this robot publishing?
Drift understands context and lets you interact with specific simulations.

Selective termination

drift> stop robot1 simulation
Terminate specific simulations while keeping others running:
  • Graceful node shutdown
  • Clean resource release
  • Automatic process cleanup

Mass management

drift> stop all simulations
drift> restart all nodes
drift> show status of all processes
Running multiple Gazebo instances simultaneously requires significant system resources. Monitor CPU and memory usage.

Process monitoring and debugging

Drift’s process management integrates with its debugging capabilities.

Detecting failures

drift> /ps

Running Processes:
PID    Process Name              Status    Uptime
12345  gazebo                    Running   10m 5s
12347  controller_manager        Failed    -
Drift alerts you to failed processes and can help diagnose why:
drift> why did controller_manager fail?
Drift analyzes:
  • Process exit codes
  • Error messages in logs
  • Missing dependencies
  • Configuration issues

Log access

drift> show logs for gazebo
drift> show errors from last 5 minutes
Quickly access process output without leaving Drift.

Real-time monitoring

drift> monitor my robot processes
Drift can provide live updates when:
  • Processes start or stop
  • Errors occur
  • Resource usage spikes
Use process monitoring during development to catch issues early, especially when testing new configurations.

Process control commands

Drift provides comprehensive process control:

Starting processes

drift> launch my robot
drift> start navigation stack
drift> run RViz with my config

Stopping processes

drift> stop gazebo
drift> kill all controller nodes
drift> terminate the simulation

Restarting processes

drift> restart the controller manager
drift> reload the robot state publisher

Pausing and resuming

drift> pause the simulation
drift> resume simulation
Pause Gazebo physics while keeping nodes running for debugging.

Advanced process features

Process groups

Drift organizes related processes into logical groups:
drift> launch my robot
[Creates process group: "my_robot"]
  - gazebo
  - robot_state_publisher
  - controller_manager
  - joint_state_publisher

drift> stop group my_robot
[Terminates all processes in the group]

Dependency handling

Drift understands process dependencies:
drift> stop robot_state_publisher

Warning: controller_manager depends on robot_state_publisher.
Stop dependent processes too? (y/n)

Auto-restart

drift> configure controller_manager to auto-restart on failure
Critical processes can be automatically restarted if they crash.

Resource limits

drift> limit gazebo to 4 CPU cores
drift> set memory limit for navigation stack to 2GB
Resource limiting helps prevent one simulation from consuming all system resources when running multiple instances.

Best practices

Use /ps regularly

Make checking process status part of your workflow:
drift> /ps
Before starting new tasks, verify what’s already running.

Clean up after testing

drift> stop all simulations
Terminate test processes to free resources.

Monitor during development

When developing new features:
drift> launch my robot
drift> /ps
[Verify all nodes started]
drift> add new sensor
drift> rebuild and restart
drift> /ps
[Confirm new nodes are running]

Use descriptive names

When launching multiple simulations:
drift> launch warehouse_robot in warehouse world
drift> launch factory_robot in factory world
Clear names make process management easier. Organize complex setups:
drift> create process group for my navigation test
drift> add navigation nodes to the group

Troubleshooting

Orphaned processes

If Drift exits unexpectedly:
drift> /ps
[Shows processes from previous session]

drift> clean up orphaned processes

Process won’t stop

drift> force stop gazebo
Drift can forcefully terminate stuck processes.

Missing processes

drift> why isn't controller_manager in /ps?
drift> search for running ROS2 nodes
Drift can help find processes started outside of Drift.

Getting started

To use Drift’s process management:
  1. Launch a simulation:
    drift> launch my robot
    
  2. Check running processes:
    drift> /ps
    
  3. Monitor and manage:
    drift> show details for gazebo
    drift> stop controller_manager
    
  4. Clean up when done:
    drift> stop all simulations
    
Drift handles all the complexity of process lifecycle management!

Build docs developers (and LLMs) love