-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SW-5466: Support Velodyne and other point types in ouster-ros driver (#…
…216) * Quick protoype of Velodyne point type * Add PointXYZIR point type + other major pcl point types * Include point meta functions and point transform by the ouster_ros namesapce * Wrap point meta functions with a namespace and use shorter names for the functions + * Add a seed test module for the point_cloud_compose methods + Add description for the point_cloud_compose methods + refactor code and add compile time checks. * Propagate error state, warn about potential incompatible profile, propagate error state * Add minimal documentation about the new `point_type` parameter.
- Loading branch information
Showing
25 changed files
with
1,912 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Copyright (c) 2018-2023, Ouster, Inc. | ||
* All rights reserved. | ||
* | ||
* @file common_point_types.h | ||
* @brief common PCL point datatype for use with ouster sensors | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <pcl/point_types.h> | ||
|
||
namespace ouster_ros { | ||
|
||
/* The following are pcl point representations that are common/standard point | ||
representation that we readily support. | ||
*/ | ||
|
||
/* | ||
* Same as Velodyne point cloud type | ||
* @remark XYZIR point type is not compatible with RNG15_RFL8_NIR8/LOW_DATA | ||
* udp lidar profile. | ||
*/ | ||
struct EIGEN_ALIGN16 _PointXYZIR { | ||
PCL_ADD_POINT4D; | ||
float intensity; | ||
uint16_t ring; | ||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ||
}; | ||
|
||
struct PointXYZIR : public _PointXYZIR { | ||
|
||
inline PointXYZIR(const _PointXYZIR& pt) | ||
{ | ||
x = pt.x; y = pt.y; z = pt.z; data[3] = 1.0f; | ||
intensity = pt.intensity; ring = pt.ring; | ||
} | ||
|
||
inline PointXYZIR() | ||
{ | ||
x = y = z = 0.0f; data[3] = 1.0f; | ||
intensity = 0.0f; ring = 0; | ||
} | ||
|
||
inline const auto as_tuple() const { | ||
return std::tie(x, y, z, intensity, ring); | ||
} | ||
|
||
inline auto as_tuple() { | ||
return std::tie(x, y, z, intensity, ring); | ||
} | ||
|
||
template<size_t I> | ||
inline auto& get() { | ||
return std::get<I>(as_tuple()); | ||
} | ||
}; | ||
|
||
} // namespace ouster_ros | ||
|
||
// clang-format off | ||
|
||
/* common point types */ | ||
POINT_CLOUD_REGISTER_POINT_STRUCT(ouster_ros::PointXYZIR, | ||
(float, x, x) | ||
(float, y, y) | ||
(float, z, z) | ||
(float, intensity, intensity) | ||
(std::uint16_t, ring, ring) | ||
) | ||
|
||
// clang-format on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.