chrono::ros::ipc::IPCChannel Class Reference

Description

Bidirectional IPC channel using shared memory ring buffers.

#include <ChROSIPCChannel.h>

Public Member Functions

 ~IPCChannel ()
 Destructor.
 
bool SendMessage (const Message &message)
 Send a message through the channel. More...
 
bool ReceiveMessage (Message &message)
 Receive a message from the channel (non-blocking) More...
 
bool IsReady () const
 Check if channel is ready for communication.
 
const std::string & GetName () const
 Get the channel name.
 

Static Public Member Functions

static std::unique_ptr< IPCChannelCreateMainChannel (const std::string &channel_name, size_t buffer_size=512 *1024 *1024)
 Create IPC channel for the main process (creates shared memory) More...
 
static std::unique_ptr< IPCChannelConnectToChannel (const std::string &channel_name)
 Connect to existing IPC channel from subprocess (opens existing shared memory) More...
 

Member Function Documentation

◆ ConnectToChannel()

std::unique_ptr< IPCChannel > chrono::ros::ipc::IPCChannel::ConnectToChannel ( const std::string &  channel_name)
static

Connect to existing IPC channel from subprocess (opens existing shared memory)

Parameters
channel_nameName of the IPC channel to connect to

◆ CreateMainChannel()

std::unique_ptr< IPCChannel > chrono::ros::ipc::IPCChannel::CreateMainChannel ( const std::string &  channel_name,
size_t  buffer_size = 512 * 1024 * 1024 
)
static

Create IPC channel for the main process (creates shared memory)

Parameters
channel_nameUnique name for this IPC channel
buffer_sizeSize of each ring buffer in bytes (default: 512MB for high-bandwidth sensor data) Note: Total shared memory is 2x this size (bidirectional buffers) 512MB allows ~145 full 1280x720 RGBA8 images or ~15 4K images per direction

◆ ReceiveMessage()

bool chrono::ros::ipc::IPCChannel::ReceiveMessage ( Message message)

Receive a message from the channel (non-blocking)

Parameters
messageOutput message buffer
Returns
true if message received, false if no message available

◆ SendMessage()

bool chrono::ros::ipc::IPCChannel::SendMessage ( const Message message)

Send a message through the channel.

Parameters
messageMessage to send
Returns
true if successful, false if channel is full

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_ros/ipc/ChROSIPCChannel.h
  • /builds/uwsbel/chrono/src/chrono_ros/ipc/ChROSIPCChannel.cpp