C++¶
High level C++ API for prototyping (cepton_sdk.hpp
, cepton_sdk_api.hpp
). Methods are agnostic to live/replay mode.
-
bool
cepton_sdk::api
::
is_live
()¶ Returns whether capture replay is not open.
-
bool
cepton_sdk::api
::
is_end
()¶ Returns whether capture replay is at the end and enable loop is false.
-
int64_t
cepton_sdk::api
::
get_time
()¶ Returns live or capture replay time.
-
SensorError
cepton_sdk::api
::
wait
(float t_length = -1.0f)¶ Sleeps or resumes capture replay for duration.
If
t_length < 0
, then waits forever.
Errors¶
-
CEPTON_PROCESS_ERROR
(code)¶ Add context to error.
-
CEPTON_CHECK_ERROR
(code)¶ If error, raise.
-
CEPTON_LOG_ERROR
(code)¶ If error, print.
-
CEPTON_RETURN_ERROR
(code)¶ If error, return.
Setup¶
-
SensorError
cepton_sdk::api
::
initialize
(Options options = create_options(), const std::string &capture_path = "", bool enable_wait = false)¶ Initialize SDK and optionally starts capture replay.
If
enable_wait
is true, waits a few seconds to initialize sensors.
-
SensorError
cepton_sdk::api
::
open_replay
(const std::string &capture_path, bool enable_wait = false)¶ Opens capture replay.
If
enable_wait
is true, replays a few seconds to intialize sensors.
-
bool
cepton_sdk::api
::
has_control_flags
(Control mask)¶ Returns whether indicated control flags are set.
-
SensorError
cepton_sdk::api
::
enable_control_flags
(Control mask, bool tf)¶ Enables/disables indicated control flags.
-
class
cepton_sdk::api
::
SensorErrorCallback
: public cepton_sdk::util::Callback<SensorHandle, const SensorError&>¶ Callback for sensor errors.
Public Static Functions
-
void
global_on_callback
(SensorHandle handle, SensorErrorCode error_code, const char *error_msg, const void *const error_data, size_t error_data_size, void *const instance)¶
-
void
-
class
cepton_sdk::api
::
SensorImageFrameCallback
: public cepton_sdk::util::Callback<SensorHandle, std::size_t, const SensorImagePoint*>¶ Callback for image frames.
Must call
initialize
before use.Public Functions
-
~SensorImageFrameCallback
()¶ SensorImageFrameCallback class destructor.
-
SensorError
initialize
()¶ Initializes SensorImageFrameCallback object.
-
SensorError
deinitialize
()¶ Deinitializes SensorImageFrameCallback object.
-
bool
is_initialized
() const¶ Returns true if SensorImageFrameCallback is initialized.
-
Sensors¶
-
bool
cepton_sdk::api
::
has_sensor_by_serial_number
(uint64_t serial_number)¶ Returns whether SDK has sensor with serial number.
-
SensorError
cepton_sdk::api
::
get_sensor_information_by_serial_number
(uint64_t serial_number, SensorInformation &info)¶ Returns sensor information by serial number.
Returns error if sensor not found.
-
std::vector<uint64_t>
cepton_sdk::api
::
get_sensor_serial_numbers
()¶ Returns serial numbers for all sensors.