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¶
Clone RTI nano-agent’s Git repository:
git clone --recurse-submodules https://github.com/rticommunity/nano-agent.git
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
Enter RTI nano-agent, and create a build directory:
cd nano-agent mkdir build cd build
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
Build and install using the native build tool (
make
):cmake --build . --target install -- -j8
2.1.2. Run “sensor” example¶
In a terminal, start
nanoagentd
with thesensor_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
In another terminal, run
sensor-reader-udp
:cd nano-agent install/bin/examples/sensor-reader-udp
In another terminal, run
sensor-writer-udp
:cd nano-agent install/bin/examples/sensor-writer-udp
2.1.3. Run “shape” example¶
In a terminal, start
nanoagentd
with theshape_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
Start an instance of RTI Shapes Demo on Domain 0.
Subscribe to all types of shapes in RTI Shapes Demo.
In a terminal, run
shape-writer-udp
:cd nano-agent install/bin/examples/shape-writer-udp
Start publishing any shape in RTI Shapes Demo.
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¶
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
Open a Visual Studio Developer Command Prompt (or configure a prompt using
Vcvarsall.bat
, see Microsoft’s documentation).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
Enter RTI nano-agent, and create a build directory:
cd nano-agent mkdir build cd build
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
Build and install using the command line toolchain:
cmake --build . --target install -- -j8
2.2.2. Run “sensor” example¶
In a command prompt, start
nanoagentd
with thesensor_agent.xml
configuration file:cd nano-agent install\bin\nanoagentd -U -a -c nano-client\resource\xml\examples\sensor_agent.xml
In another command prompt, run
sensor-reader-udp
:cd nano-agent install\bin\examples\sensor-reader-udp
In another command prompt, run
sensor-writer-udp
:cd nano-agent install\bin\examples\sensor-writer-udp
2.2.3. Run “shape” example¶
In a command prompt, start
nanoagentd
with theshape_agent.xml
configuration file:cd nano-agent install\bin\nanoagentd -U -a -c nano-client\resource\xml\examples\shape_agent.xml
Start an instance of RTI Shapes Demo on Domain 0.
Subscribe to all types of shapes in RTI Shapes Demo.
In a command prompt, run
shape-writer-udp
:cd nano-agent install\bin\examples\shape-writer-udp
Start publishing any shape in RTI Shapes Demo.
In a terminal, run
shape-reader-udp
:cd nano-agent install\bin\examples\shape-reader-udp