Swarm-SLAM  1.0.0
C-SLAM Framework
point_cloud2 Namespace Reference

Functions

np.ndarray read_points (PointCloud2 cloud, Optional[List[str]] field_names=None, bool skip_nans=False, Optional[Iterable] uvs=None, bool reshape_organized_cloud=False)
 
np.ndarray read_points_numpy (PointCloud2 cloud, Optional[List[str]] field_names=None, bool skip_nans=False, Optional[Iterable] uvs=None, bool reshape_organized_cloud=False)
 
np.ndarray read_points_numpy_filtered (PointCloud2 cloud, bool skip_nans=False, Optional[Iterable] uvs=None, bool reshape_organized_cloud=False)
 
List[NamedTuple] read_points_list (PointCloud2 cloud, Optional[List[str]] field_names=None, bool skip_nans=False, Optional[Iterable] uvs=None)
 
np.dtype dtype_from_fields (Iterable[PointField] fields, Optional[int] point_step=None)
 
PointCloud2 create_cloud (Header header, Iterable[PointField] fields, Iterable points)
 
PointCloud2 create_cloud_xyz32 (Header header, Iterable points)
 

Variables

string DUMMY_FIELD_PREFIX = 'unnamed_field'
 

Function Documentation

◆ create_cloud()

PointCloud2 point_cloud2.create_cloud ( Header  header,
Iterable[PointField]  fields,
Iterable  points 
)
Create a sensor_msgs.msg.PointCloud2 message.

:param header: The point cloud header. (Type: std_msgs.msg.Header)
:param fields: The point cloud fields.
               (Type: iterable of sensor_msgs.msg.PointField)
:param points: The point cloud points. List of iterables, i.e. one iterable
               for each point, with the elements of each iterable being the
               values of the fields for that point (in the same order as
               the fields parameter)
:return: The point cloud as sensor_msgs.msg.PointCloud2

Definition at line 265 of file point_cloud2.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_cloud_xyz32()

PointCloud2 point_cloud2.create_cloud_xyz32 ( Header  header,
Iterable  points 
)
Create a sensor_msgs.msg.PointCloud2 message with (x, y, z) fields.

:param header: The point cloud header. (Type: std_msgs.msg.Header)
:param points: The point cloud points. (Type: Iterable)
:return: The point cloud as sensor_msgs.msg.PointCloud2.

Definition at line 335 of file point_cloud2.py.

Here is the call graph for this function:

◆ dtype_from_fields()

np.dtype point_cloud2.dtype_from_fields ( Iterable[PointField]  fields,
Optional[int]   point_step = None 
)
Convert a Iterable of sensor_msgs.msg.PointField messages to a np.dtype.

:param fields: The point cloud fields.
               (Type: iterable of sensor_msgs.msg.PointField)
:param point_step: Point step size in bytes. Calculated from the given fields by default.
                   (Type: optional of integer)
:returns: NumPy datatype

Definition at line 217 of file point_cloud2.py.

Here is the caller graph for this function:

◆ read_points()

np.ndarray point_cloud2.read_points ( PointCloud2  cloud,
Optional[List[str]]   field_names = None,
bool   skip_nans = False,
Optional[Iterable]   uvs = None,
bool   reshape_organized_cloud = False 
)
Read points from a sensor_msgs.PointCloud2 message.

:param cloud: The point cloud to read from sensor_msgs.PointCloud2.
:param field_names: The names of fields to read. If None, read all fields.
                    (Type: Iterable, Default: None)
:param skip_nans: If True, then don't return any point with a NaN value.
                  (Type: Bool, Default: False)
:param uvs: If specified, then only return the points at the given
    coordinates. (Type: Iterable, Default: None)
:param reshape_organized_cloud: Returns the array as an 2D organized point cloud if set.
:return: Structured NumPy array containing all points.

Definition at line 61 of file point_cloud2.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_points_list()

List[NamedTuple] point_cloud2.read_points_list ( PointCloud2  cloud,
Optional[List[str]]   field_names = None,
bool   skip_nans = False,
Optional[Iterable]   uvs = None 
)
Read points from a sensor_msgs.PointCloud2 message.

This function returns a list of namedtuples. It operates on top of the
read_points method. For more efficient access use read_points directly.

:param cloud: The point cloud to read from. (Type: sensor_msgs.PointCloud2)
:param field_names: The names of fields to read. If None, read all fields.
                    (Type: Iterable, Default: None)
:param skip_nans: If True, then don't return any point with a NaN value.
                  (Type: Bool, Default: False)
:param uvs: If specified, then only return the points at the given
            coordinates. (Type: Iterable, Default: None]
:return: List of namedtuples containing the values for each point

Definition at line 185 of file point_cloud2.py.

Here is the call graph for this function:

◆ read_points_numpy()

np.ndarray point_cloud2.read_points_numpy ( PointCloud2  cloud,
Optional[List[str]]   field_names = None,
bool   skip_nans = False,
Optional[Iterable]   uvs = None,
bool   reshape_organized_cloud = False 
)
Read equally typed fields from sensor_msgs.PointCloud2 message as a unstructured numpy array.

This method is better suited if one wants to perform math operations
on e.g. all x,y,z fields.
But it is limited to fields with the same dtype as unstructured numpy arrays
only contain one dtype.

:param cloud: The point cloud to read from sensor_msgs.PointCloud2.
:param field_names: The names of fields to read. If None, read all fields.
                    (Type: Iterable, Default: None)
:param skip_nans: If True, then don't return any point with a NaN value.
                  (Type: Bool, Default: False)
:param uvs: If specified, then only return the points at the given
    coordinates. (Type: Iterable, Default: None)
:param reshape_organized_cloud: Returns the array as an 2D organized point cloud if set.
:return: Numpy array containing all points.

Definition at line 126 of file point_cloud2.py.

Here is the call graph for this function:

◆ read_points_numpy_filtered()

np.ndarray point_cloud2.read_points_numpy_filtered ( PointCloud2  cloud,
bool   skip_nans = False,
Optional[Iterable]   uvs = None,
bool   reshape_organized_cloud = False 
)
Read equally typed fields from sensor_msgs.PointCloud2 message as a unstructured numpy array.

This method is better suited if one wants to perform math operations
on e.g. all x,y,z fields.
But it is limited to fields with the same dtype as unstructured numpy arrays
only contain one dtype.

:param cloud: The point cloud to read from sensor_msgs.PointCloud2.
:param field_names: The names of fields to read. If None, read all fields.
                    (Type: Iterable, Default: None)
:param skip_nans: If True, then don't return any point with a NaN value.
                  (Type: Bool, Default: False)
:param uvs: If specified, then only return the points at the given
    coordinates. (Type: Iterable, Default: None)
:param reshape_organized_cloud: Returns the array as an 2D organized point cloud if set.
:return: Numpy array containing all points.

Definition at line 157 of file point_cloud2.py.

Here is the call graph for this function:

Variable Documentation

◆ DUMMY_FIELD_PREFIX

string point_cloud2.DUMMY_FIELD_PREFIX = 'unnamed_field'

Definition at line 58 of file point_cloud2.py.