Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Deploy to production

How-to · Level 3: Production and tuning

Needs first: Configure an image

Use this page to take an image from a workspace to the machine or board it runs on, verify it from ROS 2, and check it is ready to ship.

The order is the same on every target: build the image, put it where it runs, then verify ROS 2 communication. On a host or an emulator nros run does the last two; on hardware nros flash --monitor does.

Before you start

  • A workspace whose images build, and the boards provisioned (nros setup at the workspace root).
  • For a zenoh image, ROS 2’s router; see ROS 2 and the zenoh router.

Steps

  1. Build every image the workspace declares:

    nros build --all
    

    After each image, nros build prints the artifact and the board’s own next command. Where each target family’s artifact lands is in Build outputs.

  2. Check how the image will run. --dry-run --why prints the run plan, and where each fact came from, without running anything:

    nros run host_node_bringup:linux --dry-run --why
    
    image = "host_node_bringup:linux"
    verb = "run"
    
    [runner]
    package = "nros_runner_native"
    name = "native"
    
    [console]
    kind = "stdio"
    
    [link]
    kind = "tcp"
    locator = "tcp/127.0.0.1:7447"
    rmw = "zenoh"
    host_peer = "zenoh-router"
    
  3. Run a host or emulator image, with a smoke test. nros run builds it if it is stale, starts the router its link needs, streams the console, and with --expect exits successfully when the line appears:

    nros run host_node_bringup:linux --expect 'Publishing:'
    
  4. Flash a real board, and watch its console on the same port:

    nros flash <bringup>:<image> --monitor --expect 'Publishing:'
    

    nros flash runs the board’s human steps (a jumper, a reset), flashes through the board’s flash method, and watches the console. nros monitor attaches to a board that is already running. A board with no flash method stays on the vendor’s own tools.

  5. Verify from ROS 2. With the router running and ROS 2 sourced:

    export RMW_IMPLEMENTATION=rmw_zenoh_cpp
    ros2 topic list
    ros2 topic echo /chatter std_msgs/msg/String --qos-reliability best_effort
    

    If discovery works but samples do not arrive, check the domain ID, the router endpoint, QoS reliability and the board’s network.

  6. Check readiness for production, below, on your own board.

Check readiness for production

The in-tree tests run reference boards, mostly under emulation, where cycle counters read zero and wall-clock percentiles track the host’s load. What you ship has to be measured on your silicon, at its clock and load. Count the boxes per group; a group missing two or more is not ready.

Timing, measured on the board

  • End-to-end P99 latency, publisher to callback, within your budget.
  • Worst-case stack depth per sched task (Analyze timing), and the platform’s stack-overflow detection on (FreeRTOS configCHECK_FOR_STACK_OVERFLOW, Zephyr stack sentinels, NuttX CONFIG_DEBUG_STACK).
  • Timer overruns under sustained load (timer overrun policy).
  • Heap use over 24 hours at nominal load, and no allocation on a hot path.

Platform and network

  • Multicast discovery fires on your RTOS and driver, if you use Cyclone DDS.
  • The platform clock extends a narrow hardware counter to a monotonic 64-bit value (a 32-bit millisecond count wraps at 49.7 days).
  • The image recovers from 5% packet loss, a 30-second partition, and a restart of the router or agent.
  • Critical sections are short.

Middleware and interop

  • The release pinned with nros pin, so the backend versions are the tested ones (nros toolchain list --available prints them), and a plan to move the pin: only the newest release is supported, and fixes are not backported (Release support).
  • nros doctor --report output filed with the build: the release, each board’s support status and every pinned tool, dated.
  • The release image built with the release profile, and its digest recorded. The same pin, lock and ROS 2 packages give the same bytes from any project directory, as long as nano-ros itself is installed at the same path (a container gives you both); nros build defaults to the debug profile (Build profiles).
  • Every QoS policy you use is supported by your backend; an unsupported one is reported at entity creation.
  • A stock ROS 2 node receives what the image publishes, with each custom message, and QoS profiles match.
  • Every nano-ros RTOS in your fleet sees every other.

Safety and operations

  • A timeout on every blocking call; nano-ros has no wait-forever form.
  • The E2E CRC attached, if you use the safety-e2e feature (Safety).
  • A hardware watchdog wired; the executor reports overruns but pets none.
  • A log sink chosen (Log and observe a board), time synchronization, and a bootloader and update strategy, none of which nano-ros ships.
  • The licenses accepted: nano-ros is MIT OR Apache-2.0, and each component an image compiles in carries its own (Third-party code). nano-ros has no commercial support entity, so plan for in-house expertise.

Example

A workspace with a host image and a board image, built, smoke-tested, then flashed:

nros build --all
nros run host_node_bringup:linux --expect 'Publishing:'
nros flash <bringup>:<image> --monitor --expect 'Publishing:'

Run an image: nros run

nros run builds the image if it is stale, starts what its link needs, and streams the console, for host images and emulators. --expect '<line>' exits successfully when that line appears. On a real board it refuses and names the flashing step instead; Flash a real board covers nros flash, nros monitor and nros bench.

Run plans

Before it runs anything, nros run resolves a run plan: which launcher, which console and which link, and where each fact came from. The facts come from five levels, highest first: the command line, the image, your machine’s bench file, the board’s descriptor, and the runner’s defaults. --dry-run --why prints the plan without running it, as in step 2. Each platform page under Platforms reads its board’s plan.

If it doesn’t work

  • nros run refuses and names a flashing step. The image’s board is hardware. Use nros flash --monitor.
  • The image starts but never prints. A zenoh image blocks opening its session until it reaches the router. Check the router runs, on the endpoint in the run plan’s [link].
  • nros flash cannot find the board. Run nros bench scan with the board attached, or pass --port.

See also

Design background