Drive Manager

Safety enforcement and command smoothing.

The Drive Manager is the final gatekeeper before commands reach your robot’s low-level interfaces. Its primary job is to ensure that every command falls within the robot’s physical limits, satisfies smoothness constraints, and does not lead to a collision.

It acts as a safety shield, intercepting velocity commands from the Controller and applying Emergency Stops or Slowdowns based on immediate sensor data.

Safety Layers

The Drive Manager implements a multi-stage safety pipeline:

  • Emergency Stop — Critical Zone. Checks proximity sensors directly. If an obstacle enters the configured safety distance and angle, the robot stops immediately.

  • Dynamic Slowdown — Warning Zone. If an obstacle enters the slowdown zone, the robot’s velocity is proportionally reduced.

  • Control Limiting — Kinematic Constraints. Clamps incoming velocity and acceleration commands to the robot’s physical limits.

  • Control Smoothing — Jerk Control. Applies smoothing filters to incoming commands to prevent jerky movements and wheel slip.

  • Robot Unblocking — Moves the robot forward, backwards or rotates in place if the space is free to move the robot away from a blocking point. This action can be configured to be triggered with an external event.

Emergency Zone & Slowdown Zone

Emergency Zone & Slowdown Zone

Emergency Zone & Slowdown Zone

Note

Critical and Slowdown Zone checking is implemented in C++ in kompass-core for fast emergency behaviors. The core implementation supports both GPU and CPU (defaults to GPU if available).

Built-in Actions

The Drive Manager provides built-in behaviors for direct control and recovery. These can be triggered via Events:

Action

Function

move_forward

Moves the robot forward for max_distance meters, if the forward direction is clear of obstacles.

move_backward

Moves the robot backwards for max_distance meters, if the backward direction is clear of obstacles.

rotate_in_place

Rotates the robot in place for max_rotation radians, if the given safety margin around the robot is clear of obstacles.

move_to_unblock

Recovery behavior. Automatically attempts to move forward, backward, or rotate to free the robot from a collision state or blockage.

Note

All movement actions require LaserScan information to determine if the movement direction is collision-free.

Available Run Types

Timed

Sends incoming command periodically to the robot.

Inputs

Key Name

Allowed Types

Number

Default

command

geometry_msgs.msg.Twist

1

Topic(name="/control", msg_type="Twist")

multi_command

kompass_interfaces.msg.TwistArray

1

Topic(name="/control_list", msg_type="TwistArray")

sensor_data

sensor_msgs.msg.LaserScan, std_msgs.msg.Float64, std_msgs.msg.Float32

1 + (10 optional)

Topic(name="/scan", msg_type="LaserScan")

location

nav_msgs.msg.Odometry, geometry_msgs.msg.PoseStamped, geometry_msgs.msg.Pose

1

Topic(name="/odom", msg_type="Odometry")

Outputs

Key Name

Allowed Types

Number

Default

robot_command

geometry_msgs.msg.Twist

1

Topic(name="/cmd_vel", msg_type="Twist")

emergency_stop

std_msgs.msg.Bool

1

Topic(name="/emergency_stop", msg_type="Bool")

Usage Example

from kompass.components import DriveManager, DriveManagerConfig
from kompass.ros import Topic

# Setup custom configuration
# closed_loop: send commands to the robot in closed loop (checks feedback from robot state)
# critical_zone_distance: for emergency stop (m)
my_config = DriveManagerConfig(
    closed_loop=True,
    critical_zone_distance=0.1,    # Stop if obstacle < 10cm
    slowdown_zone_distance=0.3,    # Slow down if obstacle < 30cm
    critical_zone_angle=90.0       # Check 90 degrees cone in front
)

# Instantiate
driver = DriveManager(component_name="driver", config=my_config)

# Remap Outputs
driver.outputs(robot_command=Topic(name='/my_robot_cmd', msg_type='Twist'))