16.Isaac SDK Integration
Integrating Uli SDK with Nvidia Isaac SDK brings the power of the Isaac GEM into networks of the edge devices. Uli SDK provides standard message and service infrastructure for the Isaac codelets. The diagram below shows an UI app that using Isaac codelets in the network:
16.1 Isaac Codelets and Uli Comp Apps Interaction
UliMobility is an Isaac codelet that interacts with the comp app library uli_sdk/apps/mobility_, which hosts mobility.PrimitiveDriver and mobility.VelocityStateSensor services.
The diagram below shows the details of the interaction:
The drive commands are sent down from the mobility_clients.PrimitiveDriverClient service in the apps::ocu to the mobility.PrimitiveDrive service in apps::mobility. The UliMobility codelet gets the drive commands from the mobility.PrimitiveDrive service and then forwards to Isaac kaya_drive.subgraph, eventually, to Isaac DynamixDriver to drive the motors of the Uli-Kaya robot.
The UliMobility codelet updates the mobility.VelocityStateSensor service with the mobility state of the Uli-Kaya robot. When queried, the mobility.VelocityStateSensor service sends the mobility state back to the client.
The UliMobility codelet does the followings in its codelet functions:
start() – launches the comp app library, apps/mobility:mobility_.
stop() – shuts down the comp app library, apps/mobility:mobility_.
tick() – two things:
- gets the mobility command from the mobility.PrimitiveDriver service.
- sets the mobility state to the mobility.VelocityState service.
For detail of the codes, refer to isaac_addon/apps/uli_kaya/uli_mobility.h and .cpp files.
16.2 Link with Uli SDK Comp App
The UliMobility codelet needs to link with the apps::mobility comp app library. In the BUILD file, add the comp app library to the deps. Note, the build target of the comp app library ending with “_”.
Below shows the bazel function, isaac_cc_module, creates the uli_mobility build target:
name = “uli_mobility”,
srcs = [
hdrs = [
copts = [
deps = [
Two other Uli SDK libraries are also included in the deps, the boost_property_tree and mobility/messages. They provide functions to convert the JSON strings and the data structures used in the comp app library.
The mobility/messages includes the definition of the data structure, refer to the file mobility_messages_defs.h, and the FromPTree and ToPTree functions of the data. The boost_propert_tree provides functionality for converting PTree from/to JSON.
The BUILD file in the mobility/messages includes importdirs attribute to include utils/message_utils in the build. The importdirs attribute adds the generated code path to the include path. ISAAC does not have notion of importdirs that we have to add copts to include the generated code path to the include path.
The Build and Deploy processes are the same as other Isaac apps. Use the following commands to build and deploy to the Jetson device with IP address 192.168.50.121 with remote user “ovt”
$ cd ~/nvidia/isaac_sdk/sdk
$ ../engine/engine/build/deploy.sh -d jetpack45 -p //apps/uli_kaya:mobility-pkg -h 192.168.50.121 –remote_user ovt
You can also just build the app only by the command below:
$ cd ~/nvidia/isaac_sdk/sdk
$ bazel build apps/uli_kaya:mobility