2. Getting Started

2.1. POSIX Platforms

These instructions may be used to quickly install, build, and run RTI nano-agent and nano-client on Linux and Darwin.

2.1.1. Install and Build

  1. Clone RTI nano-agent’s Git repository:

git clone --recurse-submodules https://github.com/rticommunity/nano-agent.git
  1. Export location of RTI Connext DDS and target build architecture (e.g. x64Linux4gcc7.3.0). These variabels may also be passed directly to CMake, and they will only be read from the environment if not specified on the command line:

    export CONNEXTDDS_DIR=/path/to/rti_connext_dds \
           CONNEXTDDS_ARCH=x64Linux4gcc7.3.0
    
  2. Enter RTI nano-agent, and create a build directory:

    cd nano-agent
    
    mkdir build
    
    cd build
    
  3. Configure build for RTI nano-agent using CMake. This will include RTI nano-client, and we also request the example applications to be included:

    cmake .. -DCMAKE_INSTALL_PREFIX=../install \
             -DENABLE_EXAMPLES=ON
    
  4. Build and install using the native build tool (make):

    cmake --build . --target install -- -j8
    

2.1.2. Run “sensor” example

  1. In a terminal, start nanoagentd with the sensor_agent.xml configuration file:

    cd nano-agent
    
    # -U : use UDPv4 transport
    # -a : automatically attach entities to sessions with autogenerated IDs
    # -c : load DDS entities from XML configuration
    install/bin/nanoagentd -U -a -c nano-client/resource/xml/examples/sensor_agent.xml
    
  2. In another terminal, run sensor-reader-udp:

    cd nano-agent
    
    install/bin/examples/sensor-reader-udp
    
  3. In another terminal, run sensor-writer-udp:

    cd nano-agent
    
    install/bin/examples/sensor-writer-udp
    

2.1.3. Run “shape” example

  1. In a terminal, start nanoagentd with the shape_agent.xml configuration file:

    cd nano-agent
    
    # -U : use UDPv4 transport
    # -a : automatically attach entities to sessions with autogenerated IDs
    # -c : load DDS entities from XML configuration
    install/bin/nanoagentd -U -a -c nano-client/resource/xml/examples/shape_agent.xml
    
  2. Start an instance of RTI Shapes Demo on Domain 0.

  3. Subscribe to all types of shapes in RTI Shapes Demo.

  4. In a terminal, run shape-writer-udp:

    cd nano-agent
    
    install/bin/examples/shape-writer-udp
    
  5. Start publishing any shape in RTI Shapes Demo.

  6. In a terminal, run shape-reader-udp:

    cd nano-agent
    
    install/bin/examples/shape-reader-udp
    

2.2. Windows

These instructions may be used to quickly install, build, and run RTI nano-agent and nano-client on Windows.

2.2.1. Install and Build

  1. Clone RTI nano-agent’s Git repository. E.g. using the Git BASH utility:

git clone --recurse-submodules https://github.com/rticommunity/nano-agent.git
  1. Open a Visual Studio Developer Command Prompt (or configure a prompt using Vcvarsall.bat, see Microsoft’s documentation).

  2. Export location of RTI Connext DDS and target build architecture (e.g. x64Win64VS2017). These variabels may also be passed directly to CMake, and they will only be read from the environment if not specified on the command line:

    set CONNEXTDDS_DIR=C:\path\to\rti_connext_dds
    
    set CONNEXTDDS_ARCH=x64Win64VS2017
    
  3. Enter RTI nano-agent, and create a build directory:

    cd nano-agent
    
    mkdir build
    
    cd build
    
  4. Configure build for RTI nano-agent using CMake. This will include RTI nano-client, and we also request the example applications to be included. You might need to specify the full path to the cmake.exe executable if it’s not already part of your %Path% variable.

    cmake.exe .. -DCMAKE_INSTALL_PREFIX=..\install \
                 -DENABLE_EXAMPLES=ON
    
  5. Build and install using the command line toolchain:

    cmake --build . --target install -- -j8
    

2.2.2. Run “sensor” example

  1. In a command prompt, start nanoagentd with the sensor_agent.xml configuration file:

    cd nano-agent
    
    install\bin\nanoagentd -U -a -c nano-client\resource\xml\examples\sensor_agent.xml
    
  2. In another command prompt, run sensor-reader-udp:

    cd nano-agent
    
    install\bin\examples\sensor-reader-udp
    
  3. In another command prompt, run sensor-writer-udp:

    cd nano-agent
    
    install\bin\examples\sensor-writer-udp
    

2.2.3. Run “shape” example

  1. In a command prompt, start nanoagentd with the shape_agent.xml configuration file:

    cd nano-agent
    
    install\bin\nanoagentd -U -a -c nano-client\resource\xml\examples\shape_agent.xml
    
  2. Start an instance of RTI Shapes Demo on Domain 0.

  3. Subscribe to all types of shapes in RTI Shapes Demo.

  4. In a command prompt, run shape-writer-udp:

    cd nano-agent
    
    install\bin\examples\shape-writer-udp
    
  5. Start publishing any shape in RTI Shapes Demo.

  6. In a terminal, run shape-reader-udp:

    cd nano-agent
    
    install\bin\examples\shape-reader-udp