Introduction to NATS
NATS is a high-performance messaging system integrated into Wandelbots NOVA OS. It enables real-time communication between different components in your robot cell. As a lightweight and fast message broker, NATS handles data exchange, event notifications, and service coordination across your robotics infrastructure.
For more details about NATS capabilities, check out the official NATS documentation .
Key features
- High Performance: Handles millions of messages per second with minimal latency
- Flexible Messaging: Supports pub-sub, request-reply, and queuing patterns
- JetStream Persistence: Store and replay events with NATS JetStream for reliable delivery
- CloudEvents Compliant: Uses the industry-standard CloudEvents v1.0 specification for event structure
- Easy Integration: Client libraries available for multiple programming languages
Why NATS with Wandelbots NOVA?
Wandelbots NOVA uses NATS to provide:
- Real-time robot state streaming: Monitor robot controller states, motion group positions, joint values, and I/O signals as they change
- System and cell status updates: Get instant notifications about service status, system updates, and cell configurations
- Event-driven architectures: Build applications that react to system events like update starts and completions
- Collision detection data: Access collision setups and safety zone information for path planning
- I/O communication: Read and write input/output values for both BUS I/O services and robot controllers
Key concepts
The API documentation can be found here .
Subjects
Messages in NATS are published to and subscribed from subjects, which are logical channels that organize communication. NOVA uses a hierarchical naming convention with dot-separated tokens. Subject patterns look like this:
{instance}.v2.cells.{cell}
{instance}.v2.cells.{cell}.controllers.{controller}.state
{instance}.v2.cells.{cell}.controllers.{controller}.ios
{instance}.v2.cells.{cell}.bus-ios.ios
{instance}.v2.events.system.update.started
{instance}.v2.system.status
Typically, {instance}
would be nova
and {cell}
, {controller}
would be your configured identifiers.
Publish-Subscribe
This is the fundamental messaging pattern:
- Publishers send messages to subjects without knowing who receives them. For example, NOVA publishes robot state updates.
- Subscribers listen to subjects they care about and receive all published messages. Your application can subscribe to state updates.
- Wildcards let you subscribe to multiple subjects at once. For instance,
nova.v2.cells.*.status
subscribes to all cell statuses.
Request-Reply
This pattern handles synchronous communication:
- A client sends a request message with a
replyTo
header - A service processes the request and responds to the reply address
- The client receives and processes the reply
- NOVA uses this for operations like setting I/O values or selecting which I/Os to stream
JetStream persistence
NOVA uses NATS JetStream for persistent storage:
- system-state stream: Keeps the latest message per subject for cell configurations, controller states, and service status
- system-events stream: Stores up to 10,000 event messages (max 100MiB) for 30 days
Available data streams
NATS with NOVA OS gives you access to these real-time data streams:
Cell & System information
- Cell configurations: Robot controllers, applications, payloads, and cell descriptions
- System status: Status of all system services and cell resources
- Service health: Service severity levels (INFO, WARNING, ERROR) and current phases
- Core applications: Information about running applications in the cell
Robot controller data
- Controller state: System mode, operation mode, safety state, and velocity override
- Motion group state: Joint positions, velocities, torques, currents, flange pose, TCP pose
- Motion execution details: Jogging or trajectory execution status with time-to-end and current location
- Motion group descriptions: TCPs, mounting, safety zones, limits, DH parameters
- I/O values: Digital (boolean), analog (float), and integer I/O signals
BUS I/O service
- I/O status: Connection state and service messages
- I/O values: Input and output values from BUS communication protocols
- Set outputs: Write output values (also inputs for virtual services)
Collision world
- Collision setups: Colliders, link chains, tool shapes, and self-collision detection settings
Program data
- Program details: ID, execution ID, execution state, timestamps
- Program events: Start, stop, pause, resume
- Error reporting: Error codes
- Program logs: Log messages, timestamps
- Cycle details: Cycle times, error rates, cycle counts, task times, velocities
System events
- Update lifecycle: System update started and completed events with version information
- CloudEvents format: Follows CloudEvents v1.0 specifications for event structure
Get started
Ready to use NATS with Wandelbots NOVA? The next section guides you through the setup process. This includes configuration options, connection parameters, and basic usage examples.