Client for receiving frames from a Carbon LiDAR sensor.
More...
#include <carbon_client.hpp>
Client for receiving frames from a Carbon LiDAR sensor.
Example:
client.start();
if (client.tryReceiveFrame()) {
std::cout << client.latestFrame() << std::endl;
}
}
client.stop();
Client for receiving frames from a Carbon LiDAR sensor.
Definition carbon_client.hpp:38
static bool isTerminated()
Returns true if a termination signal has been received.
static void setupSignalHandling(int signal=SIGINT)
Set up OS signal handling for graceful termination.
Configuration for the Carbon LiDAR pipeline.
Definition carbon_config.hpp:29
CarbonConfig & setBindAddr(const std::string &v)
CarbonConfig & setGroupAddr(const std::string &v)
CarbonConfig & setInterfaceAddr(const std::string &v)
◆ CarbonClient() [1/3]
Construct a CarbonClient from a CarbonConfig. The config is cloned internally — it remains valid after this call.
- Parameters
-
- Exceptions
-
| std::runtime_error | if client creation fails. |
◆ ~CarbonClient()
| CarbonClient::~CarbonClient |
( |
| ) |
|
◆ CarbonClient() [2/3]
◆ CarbonClient() [3/3]
◆ isRunning()
| bool CarbonClient::isRunning |
( |
| ) |
const |
Returns true if the client is running and no shutdown has been requested.
◆ isTerminated()
| static bool CarbonClient::isTerminated |
( |
| ) |
|
|
static |
Returns true if a termination signal has been received.
◆ latestFrame() [1/2]
Access the latest received frame.
◆ latestFrame() [2/2]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ resetTerminationFlag()
| static void CarbonClient::resetTerminationFlag |
( |
| ) |
|
|
static |
Resets the termination flag.
◆ setupSignalHandling()
| static void CarbonClient::setupSignalHandling |
( |
int |
signal = SIGINT | ) |
|
|
static |
Set up OS signal handling for graceful termination.
- Parameters
-
| signal | Signal to handle (default: SIGINT) |
◆ signalHandler()
| static void CarbonClient::signalHandler |
( |
int |
| ) |
|
|
staticprivate |
◆ start()
| bool CarbonClient::start |
( |
| ) |
|
Start receiving and processing data.
- Returns
- true on success, false on failure.
◆ stop()
| void CarbonClient::stop |
( |
| ) |
|
Stop receiving and processing data. Safe to call multiple times. Can restart with start().
◆ tryReceiveFrame()
| bool CarbonClient::tryReceiveFrame |
( |
| ) |
|
Try to receive the latest frame if one is available.
- Returns
- true if a new frame was received.
◆ buffer_
| std::unique_ptr<uint8_t[]> CarbonClient::buffer_ |
|
private |
◆ handle_
| CarbonClientHandleC* CarbonClient::handle_ |
|
private |
◆ kBufferSize_
| constexpr size_t CarbonClient::kBufferSize_ = 8 * 1024 * 1024 |
|
staticconstexprprivate |
◆ latestFrame_
◆ terminated_
| volatile std::sig_atomic_t CarbonClient::terminated_ |
|
staticprivate |
The documentation for this class was generated from the following file: