forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perception: Add PointCloudToLcm system (RobotLocomotion#14990)
Add new lcmt_point_cloud message type for it to encode into.
- Loading branch information
1 parent
cbdb6e7
commit 8dbf356
Showing
9 changed files
with
646 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package drake; | ||
|
||
// Generic point cloud with runtime typing. | ||
// | ||
// Modeled after PCL and ROS conventions: | ||
// https://pointclouds.org/documentation/structpcl_1_1_p_c_l_point_cloud2.html | ||
// https://docs.ros.org/en/api/sensor_msgs/html/msg/PointCloud2.html | ||
// | ||
struct lcmt_point_cloud { | ||
// Timestamp in microseconds. | ||
int64_t utime; | ||
|
||
// The name of a frame this data is associated with. | ||
string frame_name; | ||
|
||
// If the cloud is structured, this is the 2D width. | ||
// If the cloud is unstructured, this is the number of points in the cloud. | ||
int64_t width; | ||
|
||
// If the cloud is structured, this is the 2D height. | ||
// If the cloud is unstructured, this is set to 1. | ||
int64_t height; | ||
|
||
// Descriptions of the fields. | ||
int32_t num_fields; | ||
lcmt_point_cloud_field fields[num_fields]; | ||
|
||
// Bitfield of flags describing this. See the "IS_..." constants below. | ||
int64_t flags; | ||
|
||
// Number of bytes between each successive point. This is always at least the | ||
// sum of all field sizes, but may be larger if the data has internal padding. | ||
int32_t point_step; | ||
|
||
// Number of bytes between each successive row. | ||
int64_t row_step; | ||
|
||
// Optional filler bytes to allow the raw point data to be aligned in memory. | ||
int16_t filler_size; | ||
byte filler[filler_size]; | ||
|
||
// The raw point data. | ||
int64_t data_size; | ||
byte data[data_size]; | ||
|
||
// === Constants for the flags bits === | ||
|
||
// Set iff data is big-endian. | ||
const int64_t IS_BIGENDIAN = 1; | ||
|
||
// Set iff data contains only finite values. (ROS sometimes uses "is_dense" | ||
// to refer to this concept, but not all implementations agree on whether | ||
// "dense" means "strictly finite" or "provides full width x height matrix | ||
// with possibly infinite values", so we use a less ambiguous term here.) | ||
const int64_t IS_STRICTLY_FINITE = 2; | ||
} |
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,32 @@ | ||
package drake; | ||
|
||
// Describes one field (i.e., channel) within an lcmt_point_cloud. | ||
// | ||
// Modeled after PCL and ROS conventions: | ||
// https://pointclouds.org/documentation/structpcl_1_1_p_c_l_point_field.html | ||
// https://docs.ros.org/en/api/sensor_msgs/html/msg/PointField.html | ||
// http://wiki.ros.org/pcl/Overview#Common_PointCloud2_field_names | ||
// | ||
struct lcmt_point_cloud_field { | ||
// Field name. | ||
string name; | ||
|
||
// Location of this field after the start of each point's data. | ||
int32_t byte_offset; | ||
|
||
// Element type, per the constants shown below. | ||
int8_t datatype; | ||
|
||
// Number of elements per field. | ||
int32_t count; | ||
|
||
// Allowed values for datatype. | ||
const int8_t INT8 = 1; | ||
const int8_t UINT8 = 2; | ||
const int8_t INT16 = 3; | ||
const int8_t UINT16 = 4; | ||
const int8_t INT32 = 5; | ||
const int8_t UINT32 = 6; | ||
const int8_t FLOAT32 = 7; | ||
const int8_t FLOAT64 = 8; | ||
} |
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.