Drake
drake::systems::sensors Namespace Reference

Classes

class  Accelerometer
 Sensor to represent an ideal accelerometer sensor. More...
 
class  BeamModel
 Implements the "Beam Models of Range Finders" from section 6.3 of Probabilistic Robotics (2006), by Thrun, Burgard, and Fox. More...
 
class  CameraInfo
 Simple class for characterizing the Drake camera model. More...
 
struct  Color
 Holds r, g, b values to represent a color pixel. More...
 
class  ColorPalette
 Creates and holds a palette of colors for visualizing different objects in a scene (the intent is for a different color to be applied to each identified object). More...
 
class  Gyroscope
 Sensor to represent an ideal gyroscopic sensor. More...
 
class  Image
 Simple data format for Image. More...
 
class  ImageToLcmImageArrayT
 An ImageToLcmImageArrayT takes as input an ImageRgba8U, ImageDepth32F and ImageLabel16I. More...
 
struct  ImageTraits
 Traits class for Image, specialized by PixelType. More...
 
struct  ImageTraits< PixelType::kBgr8U >
 
struct  ImageTraits< PixelType::kBgra8U >
 
struct  ImageTraits< PixelType::kDepth16U >
 
struct  ImageTraits< PixelType::kDepth32F >
 
struct  ImageTraits< PixelType::kExpr >
 
struct  ImageTraits< PixelType::kGrey8U >
 
struct  ImageTraits< PixelType::kLabel16I >
 
struct  ImageTraits< PixelType::kRgb8U >
 
struct  ImageTraits< PixelType::kRgba8U >
 
class  ImageWriter
 A system for periodically writing images to the file system. More...
 
class  LcmImageArrayToImages
 An LcmImageArrayToImages takes as input an AbstractValue containing a Value<lcmt_image_array> LCM message that defines an array of images (lcmt_image). More...
 
struct  LcmImageTraits
 
struct  LcmImageTraits< PixelType::kBgr8U >
 
struct  LcmImageTraits< PixelType::kBgra8U >
 
struct  LcmImageTraits< PixelType::kDepth16U >
 
struct  LcmImageTraits< PixelType::kDepth32F >
 
struct  LcmImageTraits< PixelType::kGrey8U >
 
struct  LcmImageTraits< PixelType::kLabel16I >
 
struct  LcmImageTraits< PixelType::kRgb8U >
 
struct  LcmImageTraits< PixelType::kRgba8U >
 
struct  LcmPixelTraits
 
struct  LcmPixelTraits< PixelFormat::kBgr >
 
struct  LcmPixelTraits< PixelFormat::kBgra >
 
struct  LcmPixelTraits< PixelFormat::kDepth >
 
struct  LcmPixelTraits< PixelFormat::kGrey >
 
struct  LcmPixelTraits< PixelFormat::kLabel >
 
struct  LcmPixelTraits< PixelFormat::kRgb >
 
struct  LcmPixelTraits< PixelFormat::kRgba >
 
class  OptitrackLcmFrameSender
 The system has one abstract-valued input port and one abstract-valued output port. More...
 
class  RgbdSensor
 A meta-sensor that houses RGB, depth, and label cameras, producing their corresponding images based on the contents of the geometry::SceneGraph. More...
 
class  RgbdSensorDiscrete
 Wraps a continuous RgbdSensor with a zero-order hold to create a discrete sensor. More...
 
class  RotaryEncoders
 Simple model to capture the quantization and calibration offset effects of a rotary encoder. More...
 

Typedefs

using ColorI = Color< int >
 Defines a color based on its three primary additive colors: red, green, and blue. More...
 
using ColorD = Color< double >
 Defines a color based on its three primary additive colors: red, green, and blue. More...
 
using ImageRgb8U = Image< PixelType::kRgb8U >
 The type for RGB image where the each channel has the type of uint8_t. More...
 
using ImageBgr8U = Image< PixelType::kBgr8U >
 The type for BGR image where the each channel has the type of uint8_t. More...
 
using ImageRgba8U = Image< PixelType::kRgba8U >
 The type for RGBA image where the each channel has the type of uint8_t. More...
 
using ImageBgra8U = Image< PixelType::kBgra8U >
 The type for BGRA image where the each channel has the type of uint8_t. More...
 
using ImageDepth32F = Image< PixelType::kDepth32F >
 The type for depth image where the channel has the type of float. More...
 
using ImageDepth16U = Image< PixelType::kDepth16U >
 The type for depth image where the channel has the type of uint16_t. More...
 
using ImageLabel16I = Image< PixelType::kLabel16I >
 The type for label image where the channel has the type of int16_t. More...
 
using ImageGrey8U = Image< PixelType::kGrey8U >
 The type for greyscale image where the channel has the type of uint8_t. More...
 
using ImageExpr = Image< PixelType::kExpr >
 The type for symbolic image where the channel has the type of symbolic::Expression. More...
 

Enumerations

enum  PixelType {
  kRgb8U = 0, kBgr8U, kRgba8U, kBgra8U,
  kGrey8U, kDepth16U, kDepth32F, kLabel16I,
  kExpr
}
 The enum class to be used for describing pixel type in Image class. More...
 
enum  PixelFormat {
  kRgb = 0, kBgr, kRgba, kBgra,
  kGrey, kDepth, kLabel, kExpr
}
 The enum class to be used to express semantic meaning of pixels. More...
 

Functions

template<typename T >
std::ostream & operator<< (std::ostream &out, const Color< T > &color)
 
Utility functions for writing common image types to disk.

Given a fully-specified path to the file to write and corresponding image data, these functions will attempt to write the image data to the file.

The functions assume that the path is valid and writable. These functions will attempt to write the image to the given file path. The file format will be that indicated by the function name, but the extension will be whatever is provided as input.

These function do not do validation on the provided file path (existence, writability, correspondence with image type, etc.) It relies on the caller to have done so.

void SaveToPng (const ImageRgba8U &image, const std::string &file_path)
 Writes the color (8-bit, RGBA) image data to disk. More...
 
void SaveToTiff (const ImageDepth32F &image, const std::string &file_path)
 Writes the depth (32-bit) image data to disk. More...
 

Typedef Documentation

◆ ColorD

using ColorD = Color<double>

Defines a color based on its three primary additive colors: red, green, and blue.

Each of these primary additive colors are in the range of [0, 1].

◆ ColorI

using ColorI = Color<int>

Defines a color based on its three primary additive colors: red, green, and blue.

Each of these primary additive colors are in the range of [0, 255].

◆ ImageBgr8U

The type for BGR image where the each channel has the type of uint8_t.

◆ ImageBgra8U

The type for BGRA image where the each channel has the type of uint8_t.

◆ ImageDepth16U

The type for depth image where the channel has the type of uint16_t.

◆ ImageDepth32F

The type for depth image where the channel has the type of float.

◆ ImageExpr

The type for symbolic image where the channel has the type of symbolic::Expression.

◆ ImageGrey8U

The type for greyscale image where the channel has the type of uint8_t.

◆ ImageLabel16I

The type for label image where the channel has the type of int16_t.

◆ ImageRgb8U

The type for RGB image where the each channel has the type of uint8_t.

◆ ImageRgba8U

The type for RGBA image where the each channel has the type of uint8_t.

Enumeration Type Documentation

◆ PixelFormat

enum PixelFormat
strong

The enum class to be used to express semantic meaning of pixels.

This also expresses the order of channels in a pixel if the pixel has multiple channels.

Enumerator
kRgb 

The pixel format used for all the RGB images.

kBgr 

The pixel format used for all the BGR images.

kRgba 

The pixel format used for all the RGBA images.

kBgra 

The pixel format used for all the BGRA images.

kGrey 

The pixel format used for all the greyscale images.

kDepth 

The pixel format used for all the depth images.

kLabel 

The pixel format used for all the labe images.

kExpr 

The pixel format used for all the symbolic images.

◆ PixelType

enum PixelType
strong

The enum class to be used for describing pixel type in Image class.

The naming rule for the enum members is: k + (pixel format) + (bit per a channel) + (data type for channels). For the type for channels, one of the following capital letters is used.

  • I: int
  • U: unsigned int
  • F: float
Enumerator
kRgb8U 

The pixel format used by ImageRgb8U.

kBgr8U 

The pixel format used by ImageBgr8U.

kRgba8U 

The pixel format used by ImageRgba8U.

kBgra8U 

The pixel format used by ImageBgra8U.

kGrey8U 

The pixel format used by ImageGrey8U.

kDepth16U 

The pixel format used by ImageDepth16U.

kDepth32F 

The pixel format used by ImageDepth32F.

kLabel16I 

The pixel format used by ImageLabel16I.

kExpr 

The pixel format representing symbolic::Expression.

Function Documentation

◆ operator<<()

std::ostream& drake::systems::sensors::operator<< ( std::ostream &  out,
const Color< T > &  color 
)

◆ SaveToPng()

void SaveToPng ( const ImageRgba8U image,
const std::string &  file_path 
)

Writes the color (8-bit, RGBA) image data to disk.

Writes the grey scale (8-bit) image data to disk.

Writes the depth (16-bit) image data to disk.

Writes the label (16-bit) image data to disk.

◆ SaveToTiff()

void drake::systems::sensors::SaveToTiff ( const ImageDepth32F image,
const std::string &  file_path 
)

Writes the depth (32-bit) image data to disk.

Png files do not support channels larger than 16-bits and its support for floating point values is also limited at best. So, depth images can only be written as tiffs.