Skip to content

Commit

Permalink
Add (some) alternative field types to support new Autoware format (#315)
Browse files Browse the repository at this point in the history
* Add fields with alternative types

* Handle new fields

* Rename ROS field name for ring_id (ring -> channel)

* Fix switch
  • Loading branch information
msz-rai authored Jul 19, 2024
1 parent 826f1e5 commit a1a6c55
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 38 deletions.
20 changes: 19 additions & 1 deletion include/rgl/api/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,15 @@ typedef enum : int32_t
typedef enum : int32_t
{
RGL_FIELD_XYZ_VEC3_F32 = 1,
/**
* Strength of the returned signal captured by the LiDAR sensor.
* It is simulated using intensity textures assigned to entities (see `rgl_entity_set_intensity_texture`).
*/
RGL_FIELD_INTENSITY_F32,
/**
* Same as RGL_FIELD_INTENSITY_F32, but uint8_t type.
*/
RGL_FIELD_INTENSITY_U8,
RGL_FIELD_IS_HIT_I32,
RGL_FIELD_IS_GROUND_I32,
RGL_FIELD_RAY_IDX_U32,
Expand All @@ -343,7 +351,16 @@ typedef enum : int32_t
RGL_FIELD_ELEVATION_F32,
RGL_FIELD_RING_ID_U16,
RGL_FIELD_RETURN_TYPE_U8,
/**
* Seconds have passed since the time of the sensor trigger when this point was measured.
* If velocity distortion is disabled, the time stamp for all points will be zero.
*/
RGL_FIELD_TIME_STAMP_F64,
/**
* Nanoseconds have passed since the time of the sensor trigger when this point was measured.
* If velocity distortion is disabled, the time stamp for all points will be zero.
*/
RGL_FIELD_TIME_STAMP_U32,

/**
* Velocity of the hit point on the entity.
Expand Down Expand Up @@ -755,7 +772,8 @@ RGL_API rgl_status_t rgl_node_raytrace_configure_mask(rgl_node_t node, const int
* @param horizontal_beam_divergence Horizontal beam divergence in radians.
* @param vertical_beam_divergence Vertical beam divergence in radians.
*/
RGL_API rgl_status_t rgl_node_raytrace_configure_beam_divergence(rgl_node_t node, float horizontal_beam_divergence, float vertical_beam_divergence);
RGL_API rgl_status_t rgl_node_raytrace_configure_beam_divergence(rgl_node_t node, float horizontal_beam_divergence,
float vertical_beam_divergence);

/**
* Creates or modifies FormatPointsNode.
Expand Down
26 changes: 23 additions & 3 deletions src/RGLFields.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ typedef unsigned char TextureTexelFormat;
#define RAY_IDX_U32 RGL_FIELD_RAY_IDX_U32
#define ENTITY_ID_I32 RGL_FIELD_ENTITY_ID_I32
#define INTENSITY_F32 RGL_FIELD_INTENSITY_F32
#define INTENSITY_U8 RGL_FIELD_INTENSITY_U8
#define LASER_RETRO_F32 RGL_FIELD_LASER_RETRO_F32
#define RING_ID_U16 RGL_FIELD_RING_ID_U16
#define AZIMUTH_F32 RGL_FIELD_AZIMUTH_F32
#define ELEVATION_F32 RGL_FIELD_ELEVATION_F32
#define DISTANCE_F32 RGL_FIELD_DISTANCE_F32
#define RETURN_TYPE_U8 RGL_FIELD_RETURN_TYPE_U8
#define TIME_STAMP_F64 RGL_FIELD_TIME_STAMP_F64
#define TIME_STAMP_U32 RGL_FIELD_TIME_STAMP_U32
#define ABSOLUTE_VELOCITY_VEC3_F32 RGL_FIELD_ABSOLUTE_VELOCITY_VEC3_F32
#define RELATIVE_VELOCITY_VEC3_F32 RGL_FIELD_RELATIVE_VELOCITY_VEC3_F32
#define RADIAL_SPEED_F32 RGL_FIELD_RADIAL_SPEED_F32
Expand All @@ -70,13 +72,15 @@ inline const std::set<rgl_field_t>& getAllRealFields()
RAY_IDX_U32,
ENTITY_ID_I32,
INTENSITY_F32,
INTENSITY_U8,
LASER_RETRO_F32,
RING_ID_U16,
AZIMUTH_F32,
ELEVATION_F32,
DISTANCE_F32,
RETURN_TYPE_U8,
TIME_STAMP_F64,
TIME_STAMP_U32,
ABSOLUTE_VELOCITY_VEC3_F32,
RELATIVE_VELOCITY_VEC3_F32,
RADIAL_SPEED_F32,
Expand Down Expand Up @@ -117,6 +121,7 @@ FIELD(XYZ_VEC3_F32, Vec3f);
FIELD(RAY_IDX_U32, uint32_t); // PCL uses uint32_t
FIELD(ENTITY_ID_I32, int32_t);
FIELD(INTENSITY_F32, float);
FIELD(INTENSITY_U8, uint8_t);
FIELD(LASER_RETRO_F32, float);
FIELD(IS_HIT_I32, int32_t); // Signed may be faster
FIELD(IS_GROUND_I32, int32_t); // Signed may be faster
Expand All @@ -126,6 +131,7 @@ FIELD(ELEVATION_F32, float);
FIELD(RING_ID_U16, uint16_t);
FIELD(RETURN_TYPE_U8, uint8_t);
FIELD(TIME_STAMP_F64, double);
FIELD(TIME_STAMP_U32, uint32_t);
FIELD(PADDING_8, uint8_t);
FIELD(PADDING_16, uint16_t);
FIELD(PADDING_32, uint32_t);
Expand All @@ -149,13 +155,15 @@ inline std::size_t getFieldSize(rgl_field_t type)
case IS_HIT_I32: return Field<IS_HIT_I32>::size;
case IS_GROUND_I32: return Field<IS_GROUND_I32>::size;
case INTENSITY_F32: return Field<INTENSITY_F32>::size;
case INTENSITY_U8: return Field<INTENSITY_U8>::size;
case LASER_RETRO_F32: return Field<LASER_RETRO_F32>::size;
case RING_ID_U16: return Field<RING_ID_U16>::size;
case AZIMUTH_F32: return Field<AZIMUTH_F32>::size;
case ELEVATION_F32: return Field<ELEVATION_F32>::size;
case DISTANCE_F32: return Field<DISTANCE_F32>::size;
case RETURN_TYPE_U8: return Field<RETURN_TYPE_U8>::size;
case TIME_STAMP_F64: return Field<TIME_STAMP_F64>::size;
case TIME_STAMP_U32: return Field<TIME_STAMP_U32>::size;
case ABSOLUTE_VELOCITY_VEC3_F32: return Field<ABSOLUTE_VELOCITY_VEC3_F32>::size;
case RELATIVE_VELOCITY_VEC3_F32: return Field<RELATIVE_VELOCITY_VEC3_F32>::size;
case RADIAL_SPEED_F32: return Field<RADIAL_SPEED_F32>::size;
Expand Down Expand Up @@ -206,13 +214,15 @@ inline std::shared_ptr<IAnyArray> createArray(rgl_field_t type, Args&&... args)
case RAY_IDX_U32: return Subclass<Field<RAY_IDX_U32>::type>::create(std::forward<Args>(args)...);
case ENTITY_ID_I32: return Subclass<Field<ENTITY_ID_I32>::type>::create(std::forward<Args>(args)...);
case INTENSITY_F32: return Subclass<Field<INTENSITY_F32>::type>::create(std::forward<Args>(args)...);
case INTENSITY_U8: return Subclass<Field<INTENSITY_U8>::type>::create(std::forward<Args>(args)...);
case LASER_RETRO_F32: return Subclass<Field<LASER_RETRO_F32>::type>::create(std::forward<Args>(args)...);
case RING_ID_U16: return Subclass<Field<RING_ID_U16>::type>::create(std::forward<Args>(args)...);
case AZIMUTH_F32: return Subclass<Field<AZIMUTH_F32>::type>::create(std::forward<Args>(args)...);
case ELEVATION_F32: return Subclass<Field<ELEVATION_F32>::type>::create(std::forward<Args>(args)...);
case DISTANCE_F32: return Subclass<Field<DISTANCE_F32>::type>::create(std::forward<Args>(args)...);
case RETURN_TYPE_U8: return Subclass<Field<RETURN_TYPE_U8>::type>::create(std::forward<Args>(args)...);
case TIME_STAMP_F64: return Subclass<Field<TIME_STAMP_F64>::type>::create(std::forward<Args>(args)...);
case TIME_STAMP_U32: return Subclass<Field<TIME_STAMP_U32>::type>::create(std::forward<Args>(args)...);
case IS_HIT_I32: return Subclass<Field<IS_HIT_I32>::type>::create(std::forward<Args>(args)...);
case IS_GROUND_I32: return Subclass<Field<IS_GROUND_I32>::type>::create(std::forward<Args>(args)...);
case ABSOLUTE_VELOCITY_VEC3_F32:
Expand Down Expand Up @@ -240,13 +250,15 @@ inline std::string toString(rgl_field_t type)
case RAY_IDX_U32: return "RAY_IDX_U32";
case ENTITY_ID_I32: return "ENTITY_ID_I32";
case INTENSITY_F32: return "INTENSITY_F32";
case INTENSITY_U8: return "INTENSITY_U8";
case LASER_RETRO_F32: return "LASER_RETRO_F32";
case RING_ID_U16: return "RING_ID_U16";
case AZIMUTH_F32: return "AZIMUTH_F32";
case ELEVATION_F32: return "ELEVATION_F32";
case DISTANCE_F32: return "DISTANCE_F32";
case RETURN_TYPE_U8: return "RETURN_TYPE_U8";
case TIME_STAMP_F64: return "TIME_STAMP_F64";
case TIME_STAMP_U32: return "TIME_STAMP_U32";
case ABSOLUTE_VELOCITY_VEC3_F32: return "ABSOLUTE_VELOCITY_VEC3_F32";
case RELATIVE_VELOCITY_VEC3_F32: return "RELATIVE_VELOCITY_VEC3_F32";
case RADIAL_SPEED_F32: return "RADIAL_SPEED_F32";
Expand Down Expand Up @@ -278,13 +290,15 @@ inline std::vector<uint8_t> toRos2Fields(rgl_field_t type)
case RAY_IDX_U32: return {sensor_msgs::msg::PointField::UINT32};
case ENTITY_ID_I32: return {sensor_msgs::msg::PointField::INT32};
case INTENSITY_F32: return {sensor_msgs::msg::PointField::FLOAT32};
case INTENSITY_U8: return {sensor_msgs::msg::PointField::UINT8};
case LASER_RETRO_F32: return {sensor_msgs::msg::PointField::FLOAT32};
case RING_ID_U16: return {sensor_msgs::msg::PointField::UINT16};
case AZIMUTH_F32: return {sensor_msgs::msg::PointField::FLOAT32};
case ELEVATION_F32: return {sensor_msgs::msg::PointField::FLOAT32};
case DISTANCE_F32: return {sensor_msgs::msg::PointField::FLOAT32};
case RETURN_TYPE_U8: return {sensor_msgs::msg::PointField::UINT8};
case TIME_STAMP_F64: return {sensor_msgs::msg::PointField::FLOAT64};
case TIME_STAMP_U32: return {sensor_msgs::msg::PointField::UINT32};
case ABSOLUTE_VELOCITY_VEC3_F32:
return {sensor_msgs::msg::PointField::FLOAT32, sensor_msgs::msg::PointField::FLOAT32,
sensor_msgs::msg::PointField::FLOAT32};
Expand Down Expand Up @@ -318,20 +332,25 @@ inline std::vector<uint8_t> toRos2Fields(rgl_field_t type)

inline std::vector<std::string> toRos2Names(rgl_field_t type)
{
// clang-format off
switch (type) {
case XYZ_VEC3_F32: return {"x", "y", "z"};
case IS_HIT_I32: return {"is_hit"};
case IS_GROUND_I32: return {"is_ground"};
case ENTITY_ID_I32: return {"entity_id"};
case RAY_IDX_U32: return {"ray_idx"};
case INTENSITY_F32: return {"intensity"};
case INTENSITY_F32:
case INTENSITY_U8:
return {"intensity"};
case LASER_RETRO_F32: return {"laser_retro"};
case RING_ID_U16: return {"ring"};
case RING_ID_U16: return {"channel"};
case AZIMUTH_F32: return {"azimuth"};
case ELEVATION_F32: return {"elevation"};
case DISTANCE_F32: return {"distance"};
case RETURN_TYPE_U8: return {"return_type"};
case TIME_STAMP_F64: return {"time_stamp"};
case TIME_STAMP_F64:
case TIME_STAMP_U32:
return {"time_stamp"};
case ABSOLUTE_VELOCITY_VEC3_F32: return {"abs_vx", "abs_vy", "abs_vz"};
case RELATIVE_VELOCITY_VEC3_F32: return {"rel_vx", "rel_vy", "rel_vz"};
case RADIAL_SPEED_F32: return {"radial_speed"};
Expand All @@ -346,6 +365,7 @@ inline std::vector<std::string> toRos2Names(rgl_field_t type)
case PADDING_16: return {};
case PADDING_32: return {};
}
// clang-format on
throw std::invalid_argument(fmt::format("toRos2Names: unknown RGL field {}", type));
}

Expand Down
7 changes: 4 additions & 3 deletions src/gpu/RaytraceRequestContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ struct RaytraceRequestContext
const int8_t* rayMask;

OptixTraversableHandle scene;
double sceneTime;
float sceneDeltaTime;

// Output
Expand All @@ -54,9 +53,11 @@ struct RaytraceRequestContext
Field<RAY_IDX_U32>::type* rayIdx;
Field<RING_ID_U16>::type* ringIdx;
Field<DISTANCE_F32>::type* distance;
Field<INTENSITY_F32>::type* intensity;
Field<INTENSITY_F32>::type* intensityF32;
Field<INTENSITY_U8>::type* intensityU8;
Field<LASER_RETRO_F32>::type* laserRetro;
Field<TIME_STAMP_F64>::type* timestamp;
Field<TIME_STAMP_F64>::type* timestampF64;
Field<TIME_STAMP_U32>::type* timestampU32;
Field<ENTITY_ID_I32>::type* entityId;
Field<ABSOLUTE_VELOCITY_VEC3_F32>::type* pointAbsVelocity;
Field<RELATIVE_VELOCITY_VEC3_F32>::type* pointRelVelocity;
Expand Down
42 changes: 30 additions & 12 deletions src/gpu/optixPrograms.cu
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ __device__ void saveRayResult(const Vec3f& xyz, float distance, float intensity,
float laserRetro);
__device__ void saveNonHitRayResult(float nonHitDistance);
__device__ void shootSamplingRay(const Mat3x4f& ray, float maxRange, unsigned sampleBeamIdx);
__device__ Mat3x4f makeBeamSampleRayTransform(float hHalfDivergenceRad, float vHalfDivergenceRad, unsigned layerIdx, unsigned vertexIdx);
__device__ Mat3x4f makeBeamSampleRayTransform(float hHalfDivergenceRad, float vHalfDivergenceRad, unsigned layerIdx,
unsigned vertexIdx);

extern "C" __global__ void __raygen__()
{
Expand Down Expand Up @@ -72,6 +73,16 @@ extern "C" __global__ void __raygen__()
ctx.elevation[rayIdx] = rayLocal.toRotationXOrderZXYLeftHandRad();
}

if (ctx.timestampF64 != nullptr) {
ctx.timestampF64[rayIdx] = ctx.doApplyDistortion ? ctx.rayTimeOffsetsMs[rayIdx] * 1e-3f : 0; // in seconds
}
if (ctx.timestampU32 != nullptr) {
ctx.timestampU32[rayIdx] = ctx.doApplyDistortion ?
static_cast<uint32_t>(ctx.rayTimeOffsetsMs[rayIdx] * 1e6f) // in nanoseconds
:
0;
}

if (ctx.doApplyDistortion) {
// Velocities are in the local frame. Need to operate on rays in local frame.
// Ray time offsets are in milliseconds, velocities are in unit per seconds.
Expand All @@ -90,7 +101,8 @@ extern "C" __global__ void __raygen__()
// Shoot multi-return sampling rays
for (int layerIdx = 0; layerIdx < MULTI_RETURN_BEAM_LAYERS; ++layerIdx) {
for (int vertexIdx = 0; vertexIdx < MULTI_RETURN_BEAM_VERTICES; vertexIdx++) {
Mat3x4f sampleRay = ray * makeBeamSampleRayTransform(ctx.hBeamHalfDivergenceRad, ctx.vBeamHalfDivergenceRad, layerIdx, vertexIdx);
Mat3x4f sampleRay = ray * makeBeamSampleRayTransform(ctx.hBeamHalfDivergenceRad, ctx.vBeamHalfDivergenceRad,
layerIdx, vertexIdx);
// Sampling rays indexes start from 1, 0 is reserved for the primary ray
const unsigned beamSampleRayIdx = 1 + layerIdx * MULTI_RETURN_BEAM_VERTICES + vertexIdx;
shootSamplingRay(sampleRay, maxRange, beamSampleRayIdx);
Expand Down Expand Up @@ -146,8 +158,10 @@ extern "C" __global__ void __closesthit__()
if (!ctx.doApplyDistortion) {
return hitWorldRaytraced;
}
Mat3x4f sampleRayTf = beamSampleRayIdx == 0 ? Mat3x4f::identity() :
makeBeamSampleRayTransform(ctx.hBeamHalfDivergenceRad, ctx.vBeamHalfDivergenceRad, circleIdx, vertexIdx);
Mat3x4f sampleRayTf = beamSampleRayIdx == 0 ?
Mat3x4f::identity() :
makeBeamSampleRayTransform(ctx.hBeamHalfDivergenceRad, ctx.vBeamHalfDivergenceRad, circleIdx,
vertexIdx);
Mat3x4f undistortedRay = ctx.raysWorld[beamIdx] * sampleRayTf;
Vec3f undistortedOrigin = undistortedRay * Vec3f{0, 0, 0};
Vec3f undistortedDir = undistortedRay * Vec3f{0, 0, 1} - undistortedOrigin;
Expand Down Expand Up @@ -175,7 +189,7 @@ extern "C" __global__ void __closesthit__()
const float incidentAngle = acosf(fabs(wNormal.dot(rayDir)));

float intensity = 0;
bool isIntensityRequested = ctx.intensity != nullptr;
bool isIntensityRequested = ctx.intensityF32 != nullptr || ctx.intensityU8 != nullptr;
if (isIntensityRequested && entityData.textureCoords != nullptr && entityData.texture != 0) {
assert(triangleIndices.x() < entityData.textureCoordsCount);
assert(triangleIndices.y() < entityData.textureCoordsCount);
Expand Down Expand Up @@ -258,14 +272,17 @@ __device__ void shootSamplingRay(const Mat3x4f& ray, float maxRange, unsigned in
optixTrace(ctx.scene, origin, dir, 0.0f, maxRange, 0.0f, OptixVisibilityMask(255), flags, 0, 1, 0, beamSampleRayIdx);
}

__device__ Mat3x4f makeBeamSampleRayTransform(float hHalfDivergenceRad, float vHalfDivergenceRad, unsigned int layerIdx, unsigned int vertexIdx)
__device__ Mat3x4f makeBeamSampleRayTransform(float hHalfDivergenceRad, float vHalfDivergenceRad, unsigned int layerIdx,
unsigned int vertexIdx)
{
if (ctx.hBeamHalfDivergenceRad == 0.0f && ctx.vBeamHalfDivergenceRad == 0.0f) {
return Mat3x4f::identity();
}

const float hCurrentHalfDivergenceRad = hHalfDivergenceRad * (1.0f - static_cast<float>(layerIdx) / MULTI_RETURN_BEAM_LAYERS);
const float vCurrentHalfDivergenceRad = vHalfDivergenceRad * (1.0f - static_cast<float>(layerIdx) / MULTI_RETURN_BEAM_LAYERS);
const float hCurrentHalfDivergenceRad = hHalfDivergenceRad *
(1.0f - static_cast<float>(layerIdx) / MULTI_RETURN_BEAM_LAYERS);
const float vCurrentHalfDivergenceRad = vHalfDivergenceRad *
(1.0f - static_cast<float>(layerIdx) / MULTI_RETURN_BEAM_LAYERS);

const float angleStep = 2.0f * static_cast<float>(M_PI) / MULTI_RETURN_BEAM_VERTICES;

Expand Down Expand Up @@ -309,11 +326,12 @@ __device__ void saveRayResult(const Vec3f& xyz, float distance, float intensity,
if (ctx.distance != nullptr) {
ctx.distance[beamIdx] = distance;
}
if (ctx.intensity != nullptr) {
ctx.intensity[beamIdx] = intensity;
if (ctx.intensityF32 != nullptr) {
ctx.intensityF32[beamIdx] = intensity;
}
if (ctx.timestamp != nullptr) {
ctx.timestamp[beamIdx] = ctx.sceneTime;
if (ctx.intensityU8 != nullptr) {
// intensity < 0 not possible
ctx.intensityU8[beamIdx] = intensity < UINT8_MAX ? static_cast<uint8_t>(std::round(intensity)) : UINT8_MAX;
}
if (ctx.entityId != nullptr) {
ctx.entityId[beamIdx] = isFinite ? objectID : RGL_ENTITY_INVALID_ID;
Expand Down
9 changes: 5 additions & 4 deletions src/graph/RaytraceNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void RaytraceNode::enqueueExecImpl()

// Note: requestCtx is a HostPinnedArray just for convenience (Host meme accessible from GPU), may be optimized.
requestCtxHst->resize(1, true, false);

requestCtxHst->at(0) = RaytraceRequestContext{
.sensorLinearVelocityXYZ = sensorLinearVelocityXYZ,
.sensorAngularVelocityRPY = sensorAngularVelocityRPY,
Expand All @@ -106,16 +107,17 @@ void RaytraceNode::enqueueExecImpl()
.rayTimeOffsetsCount = timeOffsets.has_value() ? (*timeOffsets)->getCount() : 0,
.rayMask = (rayMask != nullptr) ? rayMask->getReadPtr() : nullptr,
.scene = sceneAS,
.sceneTime = Scene::instance().getTime().value_or(Time::zero()).asSeconds(),
.sceneDeltaTime = static_cast<float>(Scene::instance().getDeltaTime().value_or(Time::zero()).asSeconds()),
.xyz = getPtrTo<XYZ_VEC3_F32>(),
.isHit = getPtrTo<IS_HIT_I32>(),
.rayIdx = getPtrTo<RAY_IDX_U32>(),
.ringIdx = getPtrTo<RING_ID_U16>(),
.distance = getPtrTo<DISTANCE_F32>(),
.intensity = getPtrTo<INTENSITY_F32>(),
.intensityF32 = getPtrTo<INTENSITY_F32>(),
.intensityU8 = getPtrTo<INTENSITY_U8>(),
.laserRetro = getPtrTo<LASER_RETRO_F32>(),
.timestamp = getPtrTo<TIME_STAMP_F64>(),
.timestampF64 = getPtrTo<TIME_STAMP_F64>(),
.timestampU32 = getPtrTo<TIME_STAMP_U32>(),
.entityId = getPtrTo<ENTITY_ID_I32>(),
.pointAbsVelocity = getPtrTo<ABSOLUTE_VELOCITY_VEC3_F32>(),
.pointRelVelocity = getPtrTo<RELATIVE_VELOCITY_VEC3_F32>(),
Expand All @@ -128,7 +130,6 @@ void RaytraceNode::enqueueExecImpl()
.vBeamHalfDivergenceRad = vBeamHalfDivergenceRad,
.mrSamples = mrSamples.getPointers(),
};

requestCtxDev->copyFrom(requestCtxHst);
CUdeviceptr pipelineArgsPtr = requestCtxDev->getDeviceReadPtr();
std::size_t pipelineArgsSize = requestCtxDev->getSizeOf() * requestCtxDev->getCount();
Expand Down
10 changes: 8 additions & 2 deletions test/include/helpers/fieldGenerators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ static std::function<Field<XYZ_VEC3_F32>::type(int)> genCoord = [](int i) {
return Vec3f(static_cast<float>(i) / (static_cast<float>(i) + 1), static_cast<float>(i) / (static_cast<float>(i) + 2),
static_cast<float>(i) / (static_cast<float>(i) + 3));
};
static std::function<Field<INTENSITY_F32>::type(int)> genIntensity = [](int i) {
static std::function<Field<INTENSITY_F32>::type(int)> genIntensityF32 = [](int i) {
return static_cast<float>(i) / (static_cast<float>(i + 1));
};
static std::function<Field<INTENSITY_U8>::type(int)> genIntensityU8 = [](int i) {
return i % std::numeric_limits<Field<INTENSITY_U8>::type>::max();
};
static std::function<Field<LASER_RETRO_F32>::type(int)> genLaserRetro = [](int i) {
return static_cast<float>(i) / (static_cast<float>(i + 1));
};
Expand All @@ -45,7 +48,10 @@ static std::function<Field<ELEVATION_F32>::type(int)> genElevation = [](int i) {
static std::function<Field<DISTANCE_F32>::type(int)> genDistance = [](int i) {
return static_cast<float>(i) / (static_cast<float>(i + 1));
};
static std::function<Field<TIME_STAMP_F64>::type(int)> genTimeStamp = [](int i) {
static std::function<Field<TIME_STAMP_F64>::type(int)> genTimeStampF64 = [](int i) {
return static_cast<float>(i) / (static_cast<float>(i + 1));
};
static std::function<Field<TIME_STAMP_U32>::type(int)> genTimeStampU32 = [](int i) {
return static_cast<float>(i) / (static_cast<float>(i + 1));
};
static std::function<Field<RAY_IDX_U32>::type(int)> genRayIdx = [](int i) { return i; };
Expand Down
Loading

0 comments on commit a1a6c55

Please sign in to comment.