types.h
Type-defs
-
template<typename T>
using ouster::img_t = Eigen::Array<T, -1, -1, Eigen::RowMajor> For image operations.
- Template Parameters
T – The data type for the array.
-
using ouster::mat4d = Eigen::Matrix<double, 4, 4, Eigen::DontAlign>
Used for transformations.
-
using ouster::sensor::AzimuthWindow = std::pair<int, int>
Convenience type alias for azimuth windows, the window over which the sensor fires in millidegrees.
-
using ouster::sensor::ColumnWindow = std::pair<int, int>
Convenience type alias for column windows, the window over which the sensor fires in columns.
Helper Data
Lidar Mode
-
enum ouster::sensor::lidar_mode
Constants used for configuration. Refer to the sensor documentation for the meaning of each option.
Values:
-
enumerator MODE_UNSPEC
lidar mode: unspecified
-
enumerator MODE_512x10
lidar mode: 10 scans of 512 columns per second
-
enumerator MODE_512x20
lidar mode: 20 scans of 512 columns per second
-
enumerator MODE_1024x10
lidar mode: 10 scans of 1024 columns per second
-
enumerator MODE_1024x20
lidar mode: 20 scans of 1024 columsn per second
-
enumerator MODE_2048x10
lidar mode: 10 scans of 2048 columns per second
-
enumerator MODE_4096x5
lidar mode: 5 scans of 4096 columns per second. Only available on select sensors
-
enumerator MODE_UNSPEC
-
uint32_t ouster::sensor::n_cols_of_lidar_mode(lidar_mode mode)
Get number of columns in a scan for a lidar mode.
- Parameters
mode – [in] lidar_mode to get the number of columns for.
- Returns
number of columns per rotation for the mode.
-
int ouster::sensor::frequency_of_lidar_mode(lidar_mode mode)
Get the lidar rotation frequency from lidar mode.
- Parameters
mode – [in] Lidar mode to get the rotation frequency from.
- Returns
lidar rotation frequency in Hz.
-
std::string ouster::sensor::to_string(lidar_mode mode)
Get string representation of a lidar mode.
- Parameters
mode – [in] lidar_mode to get the string representation for.
- Returns
string representation of the lidar mode, or “UNKNOWN”.
-
lidar_mode ouster::sensor::lidar_mode_of_string(const std::string &s)
Get lidar mode from string.
- Parameters
s – [in] String to decode.
- Returns
lidar mode corresponding to the string, or 0 on error.
Timestamp Mode
-
enum ouster::sensor::timestamp_mode
Mode controlling timestamp method. Refer to the sensor documentation for the meaning of each option.
Values:
-
enumerator TIME_FROM_UNSPEC
Timestamp mode unspecified.
-
enumerator TIME_FROM_INTERNAL_OSC
Use the internal clock.
-
enumerator TIME_FROM_SYNC_PULSE_IN
A free running counter synced to the SYNC_PULSE_IN input counts seconds (# of pulses) and nanoseconds since sensor turn on.
-
enumerator TIME_FROM_PTP_1588
Synchronize with an external PTP master.
-
enumerator TIME_FROM_UNSPEC
-
std::string ouster::sensor::to_string(timestamp_mode mode)
Get string representation of a timestamp mode.
- Parameters
mode – [in] timestamp_mode to get the string representation for.
- Returns
string representation of the timestamp mode, or “UNKNOWN”.
-
timestamp_mode ouster::sensor::timestamp_mode_of_string(const std::string &s)
Get timestamp mode from string.
- Parameters
s – [in] String to decode into a timestamp mode.
- Returns
timestamp mode corresponding to the string, or 0 on error.
Operating Mode
-
enum ouster::sensor::OperatingMode
Mode controlling sensor operation. Refer to the sensor documentation for the meaning of each option.
Values:
-
enumerator OPERATING_NORMAL
Normal sensor operation.
-
enumerator OPERATING_STANDBY
Standby.
-
enumerator OPERATING_NORMAL
-
std::string ouster::sensor::to_string(OperatingMode mode)
Get string representation of an operating mode.
- Parameters
mode – [in] Operating mode to get the string representation from.
- Returns
string representation of the operating mode, or “UNKNOWN”.
-
optional<OperatingMode> ouster::sensor::operating_mode_of_string(const std::string &s)
Get operating mode from string.
- Parameters
s – String to get the operating mode from.
- Returns
operating mode corresponding to the string, or 0 on error.
Multipurpose IO Mode
-
enum ouster::sensor::MultipurposeIOMode
Mode controlling ways to input timesync information. Refer to the sensor documentation for the meaning of each option.
Values:
-
enumerator MULTIPURPOSE_OFF
Multipurpose IO is turned off (default)
-
enumerator MULTIPURPOSE_INPUT_NMEA_UART
Used in conjunction with timestamp_mode::TIME_FROM_SYNC_PULSE_IN to enable time pulses in on the multipurpose io input.
-
enumerator MULTIPURPOSE_OUTPUT_FROM_INTERNAL_OSC
Output a SYNC_PULSE_OUT signal synchronized with the internal clock.
-
enumerator MULTIPURPOSE_OUTPUT_FROM_SYNC_PULSE_IN
Output a SYNC_PULSE_OUT signal synchronized with a SYNC_PULSE_IN provided to the unit.
-
enumerator MULTIPURPOSE_OUTPUT_FROM_PTP_1588
Output a SYNC_PULSE_OUT signal synchronized with an external PTP IEEE 1588 master.
-
enumerator MULTIPURPOSE_OUTPUT_FROM_ENCODER_ANGLE
Output a SYNC_PULSE_OUT signal with a user defined rate in an integer number of degrees.
-
enumerator MULTIPURPOSE_OFF
-
std::string ouster::sensor::to_string(MultipurposeIOMode mode)
Get string representation of a multipurpose io mode.
- Parameters
mode – [in] Multipurpose io mode to get a string representation from.
- Returns
string representation of the multipurpose io mode, or “UNKNOWN”.
-
optional<MultipurposeIOMode> ouster::sensor::multipurpose_io_mode_of_string(const std::string &s)
Get multipurpose io mode from string.
- Parameters
s – [in] String to decode into a multipurpose io mode.
- Returns
multipurpose io mode corresponding to the string, or 0 on error.
Polarity
-
enum ouster::sensor::Polarity
Polarity represents polarity of NMEA UART and SYNC_PULSE inputs and outputs. See sensor docs for more details.
Values:
-
enumerator POLARITY_ACTIVE_LOW
ACTIVE_LOW.
-
enumerator POLARITY_ACTIVE_HIGH
ACTIVE_HIGH.
-
enumerator POLARITY_ACTIVE_LOW
NMEA Baud Rate
-
enum ouster::sensor::NMEABaudRate
Baud rate the sensor attempts for NMEA UART input $GPRMC messages See sensor docs for more details.
Values:
-
enumerator BAUD_9600
9600 bits per second UART baud rate
-
enumerator BAUD_115200
115200 bits per second UART baud rate
-
enumerator BAUD_9600
-
std::string ouster::sensor::to_string(NMEABaudRate rate)
Get string representation of a NMEA Baud Rate.
- Parameters
rate – [in] The NNEABaudRate to get the string representation of.
- Returns
string representation of the NMEA baud rate, or “UNKNOWN”.
-
optional<NMEABaudRate> ouster::sensor::nmea_baud_rate_of_string(const std::string &s)
Get nmea baud rate from string.
- Parameters
s – [in] The string to decode into a NMEA baud rate.
- Returns
nmea baud rate corresponding to the string, or 0 on error.
UDP Profile Lidar
-
enum ouster::sensor::UDPProfileLidar
Profile indicating packet format of lidar data.
Values:
-
enumerator PROFILE_LIDAR_UNKNOWN
-
enumerator PROFILE_LIDAR_LEGACY
Legacy lidar data
-
enumerator PROFILE_RNG19_RFL8_SIG16_NIR16_DUAL
Dual Returns data
-
enumerator PROFILE_RNG19_RFL8_SIG16_NIR16
Single Returns data
-
enumerator PROFILE_RNG15_RFL8_NIR8
Single Returns Low Data Rate
-
enumerator PROFILE_FIVE_WORD_PIXEL
Five Word Profile
-
enumerator PROFILE_FUSA_RNG15_RFL8_NIR8_DUAL
FuSa two-word pixel
-
enumerator PROFILE_LIDAR_UNKNOWN
-
std::string ouster::sensor::to_string(UDPProfileLidar profile)
Get string representation of a lidar profile.
- Parameters
profile – [in] The profile to get the string representation of.
- Returns
string representation of the lidar profile.
-
optional<UDPProfileLidar> ouster::sensor::udp_profile_lidar_of_string(const std::string &s)
Get lidar profile from string.
- Parameters
s – [in] The string to decode into a lidar profile.
- Returns
lidar profile corresponding to the string, or nullopt on error.
UDP Profile IMU
-
enum ouster::sensor::UDPProfileIMU
Profile indicating packet format of IMU data.
Values:
-
enumerator PROFILE_IMU_LEGACY
Legacy IMU data.
-
enumerator PROFILE_IMU_LEGACY
-
std::string ouster::sensor::to_string(UDPProfileIMU profile)
Get string representation of an IMU profile.
- Parameters
profile – [in] The profile to get the string representation of.
- Returns
string representation of the lidar profile.
-
optional<UDPProfileIMU> ouster::sensor::udp_profile_imu_of_string(const std::string &s)
Get imu profile from string
- Parameters
s – [in] The string to decode into an imu profile.
- Returns
imu profile corresponding to the string, or nullopt on error.
Chan Field
-
enum ouster::sensor::ChanFieldType
Types of channel fields.
Values:
-
enumerator VOID
-
enumerator UINT8
-
enumerator UINT16
-
enumerator UINT32
-
enumerator UINT64
-
enumerator VOID
-
enum ouster::sensor::ChanField
Tag to identitify a paricular value reported in the sensor channel data block.
Values:
-
enumerator RANGE
1st return range in mm
-
enumerator RANGE2
2nd return range in mm
-
enumerator INTENSITY
- Deprecated:
Use SIGNAL instead
-
enumerator SIGNAL
1st return signal in photons
-
enumerator SIGNAL2
2nd return signal in photons
-
enumerator REFLECTIVITY
1st return reflectivity, calibrated by range and sensor sensitivity in FW 2.1+. See sensor docs for more details
-
enumerator REFLECTIVITY2
2nd return reflectivity, calibrated by range and sensor sensitivity in FW 2.1+. See sensor docs for more details
-
enumerator AMBIENT
- Deprecated:
Use NEAR_IR instead
-
enumerator NEAR_IR
near_ir in photons
-
enumerator FLAGS
1st return flags
-
enumerator FLAGS2
2nd return flags
-
enumerator RAW_HEADERS
raw headers for packet/footer/column for dev use
-
enumerator RAW32_WORD5
raw word access to packet for dev use
-
enumerator RAW32_WORD6
raw word access to packet for dev use
-
enumerator RAW32_WORD7
raw word access to packet for dev use
-
enumerator RAW32_WORD8
raw word access to packet for dev use
-
enumerator RAW32_WORD9
raw word access to packet for dev use
-
enumerator CUSTOM0
custom user field
-
enumerator CUSTOM1
custom user field
-
enumerator CUSTOM2
custom user field
-
enumerator CUSTOM3
custom user field
-
enumerator CUSTOM4
custom user field
-
enumerator CUSTOM5
custom user field
-
enumerator CUSTOM6
custom user field
-
enumerator CUSTOM7
custom user field
-
enumerator CUSTOM8
custom user field
-
enumerator CUSTOM9
custom user field
-
enumerator RAW32_WORD1
raw word access to packet for dev use
-
enumerator RAW32_WORD2
raw word access to packet for dev use
-
enumerator RAW32_WORD3
raw word access to packet for dev use
-
enumerator RAW32_WORD4
raw word access to packet for dev use
-
enumerator CHAN_FIELD_MAX
max which allows us to introduce future fields
-
enumerator RANGE
Sensor Info
-
struct ouster::sensor::sensor_info
Stores parsed information from metadata and
Public Members
-
std::string name = {}
user-convenience client-side assignable name, corresponds to hostname in metadata.json if present
-
std::string sn = {}
sensor serial number corresponding to prod_sn in metadata.json
-
std::string fw_rev = {}
fw revision corresponding to build_rev in metadata.json
-
lidar_mode mode = {}
lidar mode of sensor
-
std::string prod_line = {}
prod line
-
data_format format = {}
data format of sensor
-
std::vector<double> beam_azimuth_angles = {}
beam azimuth angles for 3D projection
-
std::vector<double> beam_altitude_angles = {}
beam altitude angles for 3D projection
-
double lidar_origin_to_beam_origin_mm = {}
distance between lidar origin and beam origin in mm
-
mat4d lidar_to_sensor_transform = mat4d::Zero()
transform between lidar and sensor coordinate frames
-
mat4d extrinsic = mat4d::Zero()
user-convenience client-side assignable extrinsic matrix, currently is not read from metadata.json
-
uint32_t init_id = {}
initialization ID updated every reinit
-
uint16_t udp_port_lidar = {}
the lidar destination port
-
uint16_t udp_port_imu = {}
the imu destination port
-
std::string build_date = {}
build date from FW sensor_info
-
std::string image_rev = {}
image rev from FW sensor_info
-
std::string prod_pn = {}
prod pn
-
std::string status = {}
sensor status at time of pulling metadata
-
calibration_status cal = {}
sensor calibration
-
sensor_config config = {}
parsed sensor config if available from metadata
-
std::string name = {}
-
sensor_info ouster::sensor::default_sensor_info(lidar_mode mode)
Get a default sensor_info for the given lidar mode.
- Parameters
mode – [in] lidar mode to generate default sensor_info for.
- Returns
default sensor_info for the OS1-64.
-
sensor_info ouster::sensor::parse_metadata(const std::string &metadata, bool skip_beam_validation = false)
Parse metadata text blob from the sensor into a sensor_info struct.
String and vector fields will have size 0 if the parameter cannot be found or parsed, while lidar_mode will be set to 0 (invalid).
- Throws
runtime_error – if the text is not valid json
- Parameters
metadata – [in] a text blob returned by get_metadata from client.h.
skip_beam_validation – [in] whether to skip validation on metdata - not for use on recorded data or metadata from sensors
- Returns
a sensor_info struct populated with a subset of the metadata.
-
sensor_info ouster::sensor::metadata_from_json(const std::string &json_file, bool skip_beam_validation = false)
Parse metadata given path to a json file.
- Throws
runtime_error – if json file does not exist or is malformed.
- Parameters
json_file – [in] path to a json file containing sensor metadata.
skip_beam_validation – [in] whether to skip validation on metadata - not for use on recorded data or metadata from sensors
- Returns
a sensor_info struct populated with a subset of the metadata.
-
std::string ouster::sensor::convert_to_legacy(const std::string &metadata)
Convert non-legacy string representation of metadata to legacy.
- Parameters
metadata – [in] non-legacy string representation of metadata.
- Returns
legacy string representation of metadata.
-
bool ouster::sensor::operator==(const sensor_info &lhs, const sensor_info &rhs)
Equality for sensor_info.
- Parameters
lhs – [in] The first object to compare.
rhs – [in] The second object to compare.
- Returns
lhs == rhs
-
bool ouster::sensor::operator!=(const sensor_info &lhs, const sensor_info &rhs)
Not-Equality for sensor_info.
- Parameters
lhs – [in] The first object to compare.
rhs – [in] The second object to compare.
- Returns
lhs != rhs
-
std::string ouster::sensor::to_string(const sensor_info &info)
String representation of the sensor_info. All fields included. NOT equivalent or interchangeable with metadata from sensor.
- Parameters
info – [in] sensor_info struct
- Returns
a debug string in json format
Sensor Config
-
struct ouster::sensor::sensor_config
Struct for sensor configuration parameters.
Public Members
-
optional<std::string> udp_dest
The destination address for the lidar/imu data to be sent to
-
optional<int> udp_port_lidar
The destination port for the lidar data to be sent to
-
optional<int> udp_port_imu
The destination port for the imu data to be sent to
-
optional<timestamp_mode> ts_mode
The timestamp mode for the sensor to use. Refer to timestamp_mode for more details.
-
optional<lidar_mode> ld_mode
The lidar mode for the sensor to use. Refer to lidar_mode for more details.
-
optional<OperatingMode> operating_mode
The operating mode for the sensor to use. Refer to OperatingMode for more details.
-
optional<MultipurposeIOMode> multipurpose_io_mode
The multipurpose io mode for the sensor to use. Refer to MultipurposeIOMode for more details.
-
optional<AzimuthWindow> azimuth_window
The azimuth window for the sensor to use. Refer to AzimuthWindow for more details.
-
optional<double> signal_multiplier
Multiplier for signal strength of sensor. See the sensor docs for more details on usage.
-
optional<Polarity> nmea_in_polarity
The nmea polarity for the sensor to use. Refer to Polarity for more details.
-
optional<bool> nmea_ignore_valid_char
Whether NMEA UART input $GPRMC messages should be ignored. Refer to the sensor docs for more details.
-
optional<NMEABaudRate> nmea_baud_rate
The nmea baud rate for the sensor to use. Refer to Polarity> for more details.
-
optional<int> nmea_leap_seconds
Number of leap seconds added to UDP timestamp. See the sensor docs for more details.
-
optional<Polarity> sync_pulse_in_polarity
Polarity of SYNC_PULSE_IN input. See Polarity for more details.
-
optional<Polarity> sync_pulse_out_polarity
Polarity of SYNC_PULSE_OUT output. See Polarity for more details.
-
optional<int> sync_pulse_out_angle
Angle in degrees that sensor traverses between each SYNC_PULSE_OUT pulse. See senor docs for more details.
-
optional<int> sync_pulse_out_pulse_width
Width of SYNC_PULSE_OUT pulse in ms. See sensor docs for more details.
-
optional<int> sync_pulse_out_frequency
Frequency of SYNC_PULSE_OUT pulse in Hz. See sensor docs for more details.
-
optional<bool> phase_lock_enable
Whether phase locking is enabled. See sensor docs for more details.
-
optional<int> phase_lock_offset
Angle that sensors are locked to in millidegrees. See sensor docs for more details.
-
optional<int> columns_per_packet
Columns per packet. See sensor docs for more details.
-
optional<UDPProfileLidar> udp_profile_lidar
The lidar profile for the sensor to use. Refer to UDPProfileLidar for more details.
-
optional<UDPProfileIMU> udp_profile_imu
The imu profile for the sensor to use. Refer to UDPProfileIMU for more details.
-
optional<std::string> udp_dest
-
sensor_config ouster::sensor::parse_config(const std::string &config)
Parse config text blob from the sensor into a sensor_config struct.
All fields are optional, and will only be set if found.
- Throws
runtime_error – if the text is not valid json.
- Parameters
config – [in] a text blob given by get_config from client.h.
- Returns
a sensor_config struct populated with the sensor config. parameters.
-
bool ouster::sensor::operator==(const sensor_config &lhs, const sensor_config &rhs)
Equality for sensor config.
- Parameters
lhs – [in] The first object to compare.
rhs – [in] The second object to compare.
- Returns
lhs == rhs
-
bool ouster::sensor::operator!=(const sensor_config &lhs, const sensor_config &rhs)
Not-Equality for sensor config.
- Parameters
lhs – [in] The first object to compare.
rhs – [in] The second object to compare.
- Returns
lhs != rhs
-
std::string ouster::sensor::to_string(const sensor_config &config)
Get a string representation of sensor config. Only set fields will be represented.
- Parameters
config – [in] a struct of sensor config.
- Returns
a json sensor config string.
Data Format
-
struct ouster::sensor::data_format
Stores data format information.
Public Members
-
uint32_t pixels_per_column
pixels per column
-
uint32_t columns_per_packet
columns per packet
-
uint32_t columns_per_frame
columns per frame, should match with lidar mode
-
std::vector<int> pixel_shift_by_row
shift of pixels by row to enable destagger
-
ColumnWindow column_window
window of columns over which sensor fires
-
UDPProfileLidar udp_profile_lidar = {}
profile of lidar packet
-
UDPProfileIMU udp_profile_imu = {}
profile of imu packet
-
uint16_t fps
frames per second
-
uint32_t pixels_per_column
-
bool ouster::sensor::operator==(const data_format &lhs, const data_format &rhs)
Equality for data_format.
- Parameters
lhs – [in] The first object to compare.
rhs – [in] The second object to compare.
- Returns
lhs == rhs
-
bool ouster::sensor::operator!=(const data_format &lhs, const data_format &rhs)
Not-Equality for data_format.
- Parameters
lhs – [in] The first object to compare.
rhs – [in] The second object to compare.
- Returns
lhs != rhs
Packet Format
-
class ouster::sensor::packet_format
Table of accessors for extracting data from imu and lidar packets.
In the user guide, refer to section 9 for the lidar packet format and section 10 for imu packets.
For 0 <= n < columns_per_packet, nth_col(n, packet_buf) returns a pointer to the nth measurement block. For 0 <= m < pixels_per_column, nth_px(m, col_buf) returns the mth channel data block.
Use imu_la_{x,y,z} to access the acceleration in the corresponding direction. Use imu_av_{x,y,z} to read the angular velocity.
Subclassed by ouster::sensor::impl::packet_writer
Public Types
- FieldIter = decltype(field_types_)::const_iterator
iterator over field types of packet
Public Functions
-
uint16_t packet_type(const uint8_t *lidar_buf) const
Read the packet type packet header.
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the packet type.
-
uint32_t frame_id(const uint8_t *lidar_buf) const
Read the frame_id packet header.
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the frame id.
-
uint32_t init_id(const uint8_t *lidar_buf) const
Read the initialization id packet header.
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the init id.
-
uint64_t prod_sn(const uint8_t *lidar_buf) const
Read the packet serial number header.
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the serial number.
-
uint16_t countdown_thermal_shutdown(const uint8_t *lidar_buf) const
Read the packet thermal shutdown countdown
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the thermal shutdown countdown.
-
uint16_t countdown_shot_limiting(const uint8_t *lidar_buf) const
Read the packet shot limiting countdown
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the shot limiting countdown.
-
uint8_t thermal_shutdown(const uint8_t *lidar_buf) const
Read the packet thermal shutdown header.
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the thermal shutdown status
-
uint8_t shot_limiting(const uint8_t *lidar_buf) const
Read the packet shot limiting header.
- Parameters
lidar_buf – [in] the lidar buf.
- Returns
the shot limiting status
-
ChanFieldType field_type(ChanField f) const
Get the bit width of the specified channel field.
- Parameters
f – [in] the channel field to query.
- Returns
a type tag specifying the bitwidth of the requested field or ChannelFieldType::VOID if it is not supported by the packet format.
-
FieldIter begin() const
A const forward iterator over field / type pairs.
-
FieldIter end() const
A const forward iterator over field / type pairs.
Get pointer to the packet footer of a lidar buffer.
- Parameters
lidar_buf – [in] the lidar buffer.
- Returns
pointer to packet footer of lidar buffer, can be nullptr if packet format doesn’t have packet footer.
-
const uint8_t *nth_col(int n, const uint8_t *lidar_buf) const
Get pointer to nth column of a lidar buffer.
- Parameters
n – [in] which column.
lidar_buf – [in] the lidar buffer.
- Returns
pointer to nth column of lidar buffer.
-
uint64_t col_timestamp(const uint8_t *col_buf) const
Read column timestamp from column buffer.
- Parameters
col_buf – [in] the column buffer.
- Returns
column timestamp.
-
uint16_t col_measurement_id(const uint8_t *col_buf) const
Read measurement id from column buffer.
- Parameters
col_buf – [in] the column buffer.
- Returns
column measurement id.
-
uint32_t col_status(const uint8_t *col_buf) const
Read column status from column buffer.
- Parameters
col_buf – [in] the column buffer.
- Returns
column status.
-
uint32_t col_encoder(const uint8_t *col_buf) const
- Deprecated:
Encoder count is deprecated as it is redundant with measurement id, barring a multiplication factor which varies by lidar mode. Use col_measurement_id instead
-
uint16_t col_frame_id(const uint8_t *col_buf) const
- Deprecated:
Use frame_id instead
-
template<typename T, typename std::enable_if<std::is_unsigned<T>::value, T>::type = 0>
void col_field(const uint8_t *col_buf, ChanField f, T *dst, int dst_stride = 1) const Copy the specified channel field out of a packet measurement block.
- Template Parameters
T – T should be an unsigned integer type large enough to store values of the specified field. Otherwise, data will be truncated.
- Parameters
col_buf – [in] a measurement block pointer returned by
nth_col()
.f – [in] the channel field to copy.
dst – [out] destination array of size pixels_per_column * dst_stride.
dst_stride – [in] stride for writing to the destination array.
-
int block_parsable() const
Returns maximum available size of parsing block usable with block_field
if packet format does not allow for block parsing, returns 0
-
template<typename T, int BlockDim, typename std::enable_if<std::is_unsigned<T>::value, T>::type = 0>
void block_field(Eigen::Ref<img_t<T>> field, ChanField f, const uint8_t *lidar_buf) const Copy the specified channel field out of a packet measurement block. Faster traversal than col_field, but has to copy the entire packet all at once.
- Template Parameters
T – T should be an unsigned integer type large enough to store values of the specified field. Otherwise, data will be truncated.
- Parameters
field – [out] destination eigen array
f – [in] the channel field to copy.
lidar_buf – [in] the lidar buffer.
-
const uint8_t *nth_px(int n, const uint8_t *col_buf) const
Get pointer to nth pixel of a column buffer.
- Parameters
n – [in] which pixel.
col_buf – [in] the column buffer.
- Returns
pointer to nth pixel of a column buffer.
-
uint64_t imu_sys_ts(const uint8_t *imu_buf) const
Read sys ts from imu packet buffer.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
sys ts from imu pacet buffer.
-
uint64_t imu_accel_ts(const uint8_t *imu_buf) const
Read acceleration timestamp.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
acceleration ts from imu packet buffer.
-
uint64_t imu_gyro_ts(const uint8_t *imu_buf) const
Read gyro timestamp.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
gyro ts from imu packet buffer.
-
float imu_la_x(const uint8_t *imu_buf) const
Read acceleration in x.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
acceleration in x.
-
float imu_la_y(const uint8_t *imu_buf) const
Read acceleration in y.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
acceleration in y.
-
float imu_la_z(const uint8_t *imu_buf) const
Read acceleration in z.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
acceleration in z.
-
float imu_av_x(const uint8_t *imu_buf) const
Read angular velocity in x.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
angular velocity in x.
-
float imu_av_y(const uint8_t *imu_buf) const
Read angular velocity in y.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
angular velocity in y.
-
float imu_av_z(const uint8_t *imu_buf) const
Read angular velocity in z.
- Parameters
imu_buf – [in] the imu packet buffer.
- Returns
angular velocity in z.
Public Members
-
const UDPProfileLidar udp_profile_lidar
udp lidar profile of packet format
-
const size_t lidar_packet_size
lidar packet size
-
const size_t imu_packet_size
imu packet size
-
const int columns_per_packet
columns per lidar packet
-
const int pixels_per_column
pixels per column for lidar
-
struct Impl
Warning
doxygenfunction: Unable to resolve function “ouster::sensor::get_format” with arguments None in doxygen xml output for project “cpp_api” from directory: /ouster-sdk/sdk-extensions/docs/standard/multiversions/0.10.0/ouster-sdk/docs/_build/0.10.0/doctrees/xml. Potential matches:
- const packet_format &get_format(UDPProfileLidar udp_profile_lidar, size_t pixels_per_column, size_t columns_per_packet)
- const packet_format &get_format(const sensor_info &info)