Server Configuration
This reference describes all server-related configuration options for the ros2_medkit gateway.
Quick Start
The gateway can be configured via:
Command line:
--ros-args -p server.port:=9000Launch files:
parameters=[{'server.port': 9000}]YAML file: See
src/ros2_medkit_gateway/config/gateway_params.yaml
Network Settings
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Host to bind the REST server. Use |
|
int |
|
Port for REST API. Valid range: 1024-65535. |
Example:
# Expose on all interfaces (Docker/network)
ros2 run ros2_medkit_gateway gateway_node --ros-args \
-p server.host:=0.0.0.0 \
-p server.port:=8080
TLS/HTTPS Configuration
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
bool |
|
Enable HTTPS using OpenSSL. |
|
string |
|
Path to PEM-encoded certificate file. |
|
string |
|
Path to PEM-encoded private key file. Restrict permissions (chmod 600). |
|
string |
|
Path to CA certificate file (reserved for mutual TLS). |
|
string |
|
Minimum TLS version: |
Example:
ros2_medkit_gateway:
ros__parameters:
server:
tls:
enabled: true
cert_file: "/etc/ros2_medkit/certs/cert.pem"
key_file: "/etc/ros2_medkit/certs/key.pem"
min_version: "1.2"
See Configuring HTTPS/TLS for a complete HTTPS setup tutorial.
CORS Configuration
Cross-Origin Resource Sharing (CORS) settings for browser-based clients.
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
list |
|
List of allowed origins. Use |
|
list |
|
Allowed HTTP methods. |
|
list |
|
Allowed headers in requests. |
|
bool |
|
Allow credentials (cookies, auth headers). |
|
int |
|
Preflight response cache duration (24 hours). |
Example for development with sovd_web_ui:
ros2_medkit_gateway:
ros__parameters:
cors:
allowed_origins: ["http://localhost:5173"]
allowed_methods: ["GET", "PUT", "POST", "DELETE", "OPTIONS"]
allowed_headers: ["Content-Type", "Accept", "Authorization"]
allow_credentials: true
Data Access Settings
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
int |
|
Max concurrent topic samples. Higher values use more resources. Range: 1-50. |
|
float |
|
Timeout for sampling topics with active publishers. Range: 0.1-30.0. |
Performance Tuning
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
int |
|
Cache refresh interval. How often to discover ROS 2 nodes. Range: 100-60000 (0.1s-60s). |
Lower values provide faster updates but increase CPU usage.
Note
The gateway uses native rclcpp APIs for all ROS 2 interactions—no ROS 2 CLI dependencies. Topic discovery, sampling, publishing, service calls, and action operations are implemented in pure C++ using ros2_medkit_serialization.
Complete Example
ros2_medkit_gateway:
ros__parameters:
server:
host: "0.0.0.0"
port: 8080
tls:
enabled: false
refresh_interval_ms: 5000
max_parallel_topic_samples: 30
topic_sample_timeout_sec: 3.0
cors:
allowed_origins: ["http://localhost:5173", "https://dashboard.example.com"]
allowed_methods: ["GET", "PUT", "POST", "DELETE", "OPTIONS"]
allowed_headers: ["Content-Type", "Accept", "Authorization"]
allow_credentials: true
max_age_seconds: 86400
See Also
Configuring Authentication - JWT authentication setup
Configuring HTTPS/TLS - HTTPS configuration
Discovery Options Reference - Discovery and entity mapping options