NVRC Client API

This is a reference page for the NVRC client API used with the Isaac RC client sample app.

The nvrcPipeline class wraps the low-level nvrc pipeline and channels.

Overview

Function

Description

nvrcPipeline()

The constructor that creates the nvrc pipeline and connects to the control server

getFrame()

Gets the latest new frame.

operator `bool()`_

queryConfig()

Queries the server for its capabilities.

sendJsEvent()

Sends a joystick event to the server.

start()

Signals the server to start streaming.

`stop()`_

Signals the server to stop streaming.

Public Member Functions

nvrcPipeline()

Copy
Copied!
            

nvidia::jrt::api::nvrcPipeline::nvrcPipeline ( std::string host, uint16_t port = 48010, std::string workspacePath = "", std::string graphPath = "" )

The constructor that creates the nvrc pipeline and connects to the control server.

Parameters

  • host: The IP address of the nvrc server

  • port: The port of the nvrc server (video channel). Setting this parameter to anything other than the default is currently not supported.

Copy
Copied!
            

nvidia::jrt::api::nvrcPipeline::nvrcPipeline ( )

The default constructor.

Copy
Copied!
            

nvidia::jrt::api::nvrcPipeline::~nvrcPipeline ( )

The destructor.

getFrame()

Copy
Copied!
            

nvrcStatus nvidia::jrt::api::nvrcPipeline::getFrame ( nxw::nvrcFrame & frame, bool wait = false )

Gets the latest new frame.

Parameters

  • [out] frame: The frame to fill

  • [in] wait: Specifies whether to block or not.

Returns

  • nvrcStatus status

operator bool()

Copy
Copied!
            

nvidia::jrt::api::nvrcPipeline::operator bool ( ) const


queryConfig()

Copy
Copied!
            

nvidia::jrt::api::nvrcPipeline::queryConfig ( nxw::nvrcConfig & config )

Queries the server for its capabilities.

Parameters

  • [out] config: The default server config

Returns

  • nvrcStatus status

sendJsEvent()

Copy
Copied!
            

void nvidia::jrt::api::nvrcPipeline::sendJsEvent ( const nxw::nvrcJsEvent & event )

Sends a joystick event to the server.

Parameters

  • [in] event: The event to send

start()

Copy
Copied!
            

nvrcStatus nvidia::jrt::api::nvrcPipeline::start ( const nxw::nvrcConfig & config )

Signals the server to start streaming.

Parameters

  • [in] :code`config`: The selected config for the server/client to use

Returns

  • nvrcStatus status

stop()

Copy
Copied!
            

nvrcStatus nvidia::jrt::api::nvrcPipeline::stop ( )

Signals the server to stop streaming.

Returns

  • nvrcStatus status

Overview

Classes

Class

Description

class FIFO

A first-in first-out thread-safe queue, with type T elements, using type LOCK for synchronization.

struct nvrc2DPoints

A collection of 2D points represented in memory as [x1, y1, x2, y2, …, xcount, ycount].

struct nvrcConfig

Defines the expectations the client should have about the data coming from the server, or the demands the client makes of the data the server sends.

struct nvrcFrame

All the video and data from a single timestamp.

struct nvrcJsEvent

A joystick event, with the state of axes and buttons on the controller.

struct nvrcProjection

Defines the projection and crop for an image.

struct nvrcServerControlMsg

A message containing a config for the recipient to either accept or modify somehow and return. This message by itself is sent by the server to inform the client of the server capabilities.

struct nvrcServerControlResp

A control message sent by the client to inform the server of its needs.

class SharedDataBuffer

A wrapper around an nvrcData buffer with an id for internal use. On destruction, internal FIFOs that hold this will automatically free up the slot used.

class SharedImageBuffer

A wrapper around an nvrcVideoFrameGroup and its projections. On destruction, the FIFO given in the constructor will free up the slot used by this buffer.

Typedefs

Typedef

Description

nvrcDataType

The type of data held in the data buffer. For now, only generic data is supported.

nvrcFrame

All the video and data from a single timestamp.

nvrcConfig

Defines the expectations the client should have about the data coming from the server, or the demands the client makes of the data the server sends.

nvrcServerControlMsgType

Whether the control message is telling the recipient to start, stop, or reconfigure.

nvrcServerControlMsg

A message containing a config for the recipient to either accept or modify somehow and return. This message by itself is sent by the server to inform the client of the server capabilities.

nvrcServerControlResp

A control message sent by the client to inform the server of its needs.

nvrc2DPoints

A collection of 2D points represented in memory as [x1, y1, x2, y2, …, xcount, ycount].

nvrcProjection

Defines the projection and crop for an image.

SharedImageFIFO

Enumerations

Enum

Description

nvrcDataType

The type of data held in the data buffer. For now, only generic data is supported.

nvrcServerControlMsgType

Whether the control message is telling the recipient to start, stop, or reconfigure.

Classes

FIFO

A first-in first-out thread-safe queue with type T elements, using type LOCK for synchronization. Type T must support default initialization, and type LOCK must support the same function calls that std::mutex does.

Copy
Copied!
            

#include <FIFO.hpp>

Public Member Functions

pop()
Copy
Copied!
            

template<typename T , typename LOCK = std::mutex> T nvidia::jrt::nvrc::FIFO< T, LOCK >::pop ( bool block = true )

Removes and returns the element at the front of the queue.

Parameters

  • block: By default, pop() blocks while the queue is empty. If block is set to false and the queue is empty, pop() will instead return a default-initialized object of type T.

push()
Copy
Copied!
            

template<typename T , typename LOCK = std::mutex> void nvidia::jrt::nvrc::FIFO< T, LOCK >::push ( T && item )

Inserts an element at the back of the queue using move semantics.

Parameters

  • item: The item to insert

size()
Copy
Copied!
            

template<typename T , typename LOCK = std::mutex> size_t nvidia::jrt::nvrc::FIFO< T, LOCK >::size ( )

Returns the number of elements in the queue.

stop()
Copy
Copied!
            

template<typename T , typename LOCK = std::mutex> void nvidia::jrt::nvrc::FIFO< T, LOCK >::stop ( )

Frees all threads blocked in a pop call.

nvrc2DPoints

A collection of 2D points represented in memory as [x1, y1, x2, y2, …, xcount, ycount].

Copy
Copied!
            

#include <nvrcProjection.hpp>

Public Attributes
  • uint32_t streamIdx

  • float * ptr

  • uint32_t count

nvrcConfig

Defines the expectations that the client should have about the data coming from the server or the demands the client makes of the data the server sends.

Copy
Copied!
            

#include <nvrcConfig.hpp>

platformConfig
Copy
Copied!
            

std::string nvidia::jrt::nvrc::nvrcConfig::platformConfig

A config protocol that is defined and conformed to by a platform-specific server/client pair.

streamingParams

Copy
Copied!
            

nvrcStreamingParams nvidia::jrt::nvrc::nvrcConfig::streamingParams

nvrcFrame

All the video and data from a single timestamp.

Copy
Copied!
            

#include <nvrcBuffer.hpp>

dataType
Copy
Copied!
            

nvrcDataType nvidia::jrt::nvrc::nvrcFrame::dataType


genericData
Copy
Copied!
            

std::shared_ptr<SharedDataBuffer> nvidia::jrt::nvrc::nvrcFrame::genericData


imageGroup

Copy
Copied!
            

std::shared_ptr<SharedImageBuffer> nvidia::jrt::nvrc::nvrcFrame::imageGroup

nvrcJsEvent

A joystick event, with the state of axes and buttons on the controller.

Copy
Copied!
            

#include <nvrcBuffer.hpp>

axes
Copy
Copied!
            

std::array<float, 4> nvidia::jrt::nvrc::nvrcJsEvent::axes


buttons

Copy
Copied!
            

std::array<bool, 12> nvidia::jrt::nvrc::nvrcJsEvent::buttons

nvrcProjection

Defines the projection and crop for an image.

Copy
Copied!
            

#include <nvrcProjection.hpp>

bottom
Copy
Copied!
            

float nvidia::jrt::nvrc::nvrcProjection::bottom


left
Copy
Copied!
            

float nvidia::jrt::nvrc::nvrcProjection::left

FOV angles in radians from the center of the camera.

position
Copy
Copied!
            

float nvidia::jrt::nvrc::nvrcProjection::position[3]

A camera position relative to the vehicle origin.

right
Copy
Copied!
            

float nvidia::jrt::nvrc::nvrcProjection::right


rotation
Copy
Copied!
            

float nvidia::jrt::nvrc::nvrcProjection::rotation[4]

The camera-to-world rotation as a quaternion (w, x, y, z).

top

Copy
Copied!
            

float nvidia::jrt::nvrc::nvrcProjection::top

nvrcServerControlMsg

A message containing a config for the recipient to either accept or modify somehow and return. This message by itself is sent by the server to inform the client of the server capabilities.

Copy
Copied!
            

#include <nvrcConfig.hpp>

structnvidia_1_1jrt_1_1nvrc_1_1nvrcServerControlMsg__coll__graph.jpg

config
Copy
Copied!
            

nvrcConfig nvidia::jrt::nvrc::nvrcServerControlMsg::config


type

Copy
Copied!
            

nvrcServerControlMsgType nvidia::jrt::nvrc::nvrcServerControlMsg::type

nvrcServerControlResp

A control message sent by the client to inform the server of its needs.

#include <nvrcConfig.hpp>

structnvidia_1_1jrt_1_1nvrc_1_1nvrcServerControlResp__coll__graph.jpg

msg
Copy
Copied!
            

nvrcServerControlMsg nvidia::jrt::nvrc::nvrcServerControlResp::msg


status

Copy
Copied!
            

nvrcStatus nvidia::jrt::nvrc::nvrcServerControlResp::status

SharedDataBuffer

A wrapper around an nvrcData buffer with an ID for internal use. On destruction, internal FIFOs that hold this wrapper will automatically free up the occupied slot.

Copy
Copied!
            

#include <nvrcBuffer.hpp>

Public Member Functions

SharedDataBuffer()

Copy
Copied!
            

nvidia::jrt::nvrc::SharedDataBuffer::SharedDataBuffer ( nvrcData & data, uint32_t id )

Copy
Copied!
            

nvidia::jrt::nvrc::SharedDataBuffer::~SharedDataBuffer ( )


Public Attributes

m_data

Copy
Copied!
            

nvrcData nvidia::jrt::nvrc::SharedDataBuffer::m_data

m_id

Copy
Copied!
            

uint32_t nvidia::jrt::nvrc::SharedDataBuffer::m_id

SharedImageBuffer

A wrapper around an nvrcVideoFrameGroup and its projections. On destruction, the FIFO given in the constructor will free up the slot used by this buffer.

Copy
Copied!
            

#include <nvrcBuffer.hpp>

classnvidia_1_1jrt_1_1nvrc_1_1SharedImageBuffer__coll__graph.jpg

Public Member Functions

SharedImageBuffer()

Copy
Copied!
            

nvidia::jrt::nvrc::SharedImageBuffer::SharedImageBuffer ( nvrcVideoFrameGroup && group, std::weak_ptr< SharedImageFIFO > fifo )

Copy
Copied!
            

nvidia::jrt::nvrc::SharedImageBuffer::~SharedImageBuffer ( )


Public Attributes

m_group
Copy
Copied!
            

nvrcVideoFrameGroup nvidia::jrt::nvrc::SharedImageBuffer::m_group


m_projections
Copy
Copied!
            

nvrcProjection nvidia::jrt::nvrc::SharedImageBuffer::m_projections[NVRC_MAX_VIDEO_FRAME_GROUP_COUNT]

Projections correspond to the video frames in m_group, in the same order.

m_sharedImageFIFO

Copy
Copied!
            

std::weak_ptr<SharedImageFIFO> nvidia::jrt::nvrc::SharedImageBuffer::m_sharedImageFIFO

Enumerations

Copy
Copied!
            

enum nvidia::jrt::nvrc::nvrcDataType

The type of data held in the data buffer. For now, only generic data is supported.

Enumerator

  • NVRC_DATA_TYPE_GENERIC_DATA

Copy
Copied!
            

enum nvidia::jrt::nvrc::nvrcServerControlMsgType

Indicates whether the control message is instructing the recipient to start, stop, or reconfigure.

Enumerator

  • NVRC_SERVER_CONTROL_START

  • NVRC_SERVER_CONTROL_STOP

  • NVRC_SERVER_CONTROL_RECONFIGURE

© Copyright 2018-2020, NVIDIA Corporation. Last updated on Feb 1, 2023.