Skip to content

Latest commit

 

History

History
49 lines (42 loc) · 1.71 KB

File metadata and controls

49 lines (42 loc) · 1.71 KB

Ping Custom Op

This example builds on top of the ping_simple example to demonstrate how to create your own custom operator.

There are three operators involved in this example (tx -> mx -> rx):

  1. a transmitter, set to transmit a sequence of integes from 1-10 to it's 'out' port
  2. a middle operator that prints the received values, multiplies by a scalar and transmits the modified values
  3. a receiver that prints the received values to the terminal

Visit the SDK User Guide for step-by-step documentation of this example.

C++ Run instructions

  • using deb package install or NGC container:
    /opt/nvidia/holoscan/examples/ping_custom_op/cpp/ping_custom_op
  • source (dev container):
    ./run launch # optional: append `install` for install tree
    ./examples/ping_custom_op/cpp/ping_custom_op
  • source (local env):
    ${BUILD_OR_INSTALL_DIR}/examples/ping_custom_op/cpp/ping_custom_op

Python Run instructions

  • using python wheel:
    # [Prerequisite] Download example .py file below to `APP_DIR`
    # [Optional] Start the virtualenv where holoscan is installed
    python3 <APP_DIR>/ping_custom_op.py
  • from NGC container:
    python3 /opt/nvidia/holoscan/examples/ping_custom_op/python/ping_custom_op.py
  • source (dev container):
    ./run launch # optional: append `install` for install tree
    python3 ./examples/ping_custom_op/python/ping_custom_op.py
  • source (local env):
    export PYTHONPATH=${BUILD_OR_INSTALL_DIR}/python/lib
    python3 ${BUILD_OR_INSTALL_DIR}/examples/ping_custom_op/python/ping_custom_op.py