Drake
drake::systems::sensors Namespace Reference

Namespaces

 shaders
 
 test
 
 vtk_util
 

Classes

class  Accelerometer
 A simulated ideal accelerometer that measures the linear acceleration of a frame associated with a RigidBodyPlant. More...
 
class  AccelerometerExampleDiagram
 Implements the Diagram shown below, which demonstrates how an accelerometer can be used. More...
 
class  AccelerometerOutput
 Specializes BasicVector with accessors and setters that are useful for consumers of Accelerometer's output. More...
 
struct  AccelerometerOutputConstants
 
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 data structure for camera information that includes the image size and camera intrinsic parameters. 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  DepthSensor
 A simple model of an ideal depth sensor. More...
 
class  DepthSensorOutput
 Specializes BasicVector with specific getters and setters that are useful for consumers of DepthSensor's output. More...
 
class  DepthSensorSpecification
 Holds a DepthSensor's specification. More...
 
class  DepthSensorToLcmPointCloudMessage
 A DepthSensorToLcmPointCloudMessage takes as input a DepthSensorOutput and the pose of the depth sensor in the world (X_WS). More...
 
class  Gyroscope
 A simulated ideal gyroscope. More...
 
class  GyroscopeOutput
 Specializes BasicVector with accessors and setters that are useful for consumers of Gyroscope's output. More...
 
struct  GyroscopeOutputConstants
 Defines the semantics of each index in GyroscopeOutput's vector. 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. 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  InvalidDepth
 Set of constants used to represent invalid depth values. More...
 
class  Label
 Set of labels used for label image. More...
 
class  LcmImageArrayToImages
 An LcmImageArrayToImages takes as input an AbstractValue containing a Value<robotlocomotion::image_array_t> LCM message that defines an array of images (image_t). 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...
 
struct  RenderingConfig
 Common configurations of rendering systems. More...
 
class  RgbdCamera
 An RGB-D camera system that provides RGB, depth and label images using visual elements of RigidBodyTree. More...
 
class  RgbdCameraDiscrete
 Wraps a continuous RgbdCamera with zero order holds to have it function as a discrete sensor. More...
 
class  RgbdRenderer
 Abstract interface of RGB-D renderers, which render RGB, depth and label images using VisualElement. More...
 
class  RgbdRendererOSPRay
 An RgbdRenderer implementation using OSPRay via VTK. More...
 
class  RgbdRendererVTK
 An RgbdRenderer implementation using VTK. 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

std::ostream & operator<< (std::ostream &out, const DepthSensor &sensor)
 
bool operator== (const DepthSensorSpecification &lhs, const DepthSensorSpecification &rhs)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const Color< T > &color)
 
template<PixelType kPixelType>
void SaveToFileHelper (const Image< kPixelType > &image, const std::string &file_path)
 
template const InputPort< double > & ImageWriter::DeclareImageInputPort< PixelType::kRgba8U > (std::string port_name, std::string file_name_format, double publish_period, double start_time)
 
template const InputPort< double > & ImageWriter::DeclareImageInputPort< PixelType::kDepth32F > (std::string port_name, std::string file_name_format, double publish_period, double start_time)
 
template const InputPort< double > & ImageWriter::DeclareImageInputPort< PixelType::kLabel16I > (std::string port_name, std::string file_name_format, double publish_period, double start_time)
 
template void ImageWriter::WriteImage< PixelType::kRgba8U > (const Context< double > &context, int index) const
 
template void ImageWriter::WriteImage< PixelType::kDepth32F > (const Context< double > &context, int index) const
 
template void ImageWriter::WriteImage< PixelType::kLabel16I > (const Context< double > &context, int index) const
 
int main ()
 
 GTEST_TEST (OptitrackSenderTest, OptitrackLcmSenderTest)
 
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...
 

Variables

const int kNumMaxLabel = 256
 

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

◆ GTEST_TEST()

drake::systems::sensors::GTEST_TEST ( OptitrackSenderTest  ,
OptitrackLcmSenderTest   
)

◆ ImageWriter::DeclareImageInputPort< PixelType::kDepth32F >()

template const InputPort<double>& drake::systems::sensors::ImageWriter::DeclareImageInputPort< PixelType::kDepth32F > ( std::string  port_name,
std::string  file_name_format,
double  publish_period,
double  start_time 
)

◆ ImageWriter::DeclareImageInputPort< PixelType::kLabel16I >()

template const InputPort<double>& drake::systems::sensors::ImageWriter::DeclareImageInputPort< PixelType::kLabel16I > ( std::string  port_name,
std::string  file_name_format,
double  publish_period,
double  start_time 
)

◆ ImageWriter::DeclareImageInputPort< PixelType::kRgba8U >()

template const InputPort<double>& drake::systems::sensors::ImageWriter::DeclareImageInputPort< PixelType::kRgba8U > ( std::string  port_name,
std::string  file_name_format,
double  publish_period,
double  start_time 
)

◆ ImageWriter::WriteImage< PixelType::kDepth32F >()

template void drake::systems::sensors::ImageWriter::WriteImage< PixelType::kDepth32F > ( const Context< double > &  context,
int  index 
) const

◆ ImageWriter::WriteImage< PixelType::kLabel16I >()

template void drake::systems::sensors::ImageWriter::WriteImage< PixelType::kLabel16I > ( const Context< double > &  context,
int  index 
) const

◆ ImageWriter::WriteImage< PixelType::kRgba8U >()

template void drake::systems::sensors::ImageWriter::WriteImage< PixelType::kRgba8U > ( const Context< double > &  context,
int  index 
) const

◆ main()

int drake::systems::sensors::main ( )

◆ operator<<() [1/2]

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

◆ operator<<() [2/2]

std::ostream& drake::systems::sensors::operator<< ( std::ostream &  out,
const DepthSensor sensor 
)

◆ operator==()

bool drake::systems::sensors::operator== ( const DepthSensorSpecification lhs,
const DepthSensorSpecification rhs 
)
inline

◆ SaveToFileHelper()

void drake::systems::sensors::SaveToFileHelper ( const Image< kPixelType > &  image,
const std::string &  file_path 
)

◆ SaveToPng()

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

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

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

◆ SaveToTiff()

void 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.

Variable Documentation

◆ kNumMaxLabel

const int kNumMaxLabel = 256