Documentation ¶
Overview ¶
Package camera defines a frame capturing device.
Index ¶
- Constants
- Variables
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewGetPropertiesError(cameraIdentifier string) error
- func NewServer(s subtype.Service) pb.CameraServiceServer
- func NewUnsupportedStreamError(s StreamType) error
- func ReadImage(ctx context.Context, src gostream.VideoSource) (image.Image, func(), error)
- func SimultaneousColorDepthNext(ctx context.Context, color, depth gostream.VideoStream) (image.Image, *rimage.DepthMap)
- func WrapWithReconfigurable(r interface{}) (resource.Reconfigurable, error)
- type AttrConfig
- type Camera
- func FromDependencies(deps registry.Dependencies, name string) (Camera, error)
- func FromRobot(r robot.Robot, name string) (Camera, error)
- func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Camera
- func NewFromReader(ctx context.Context, reader gostream.VideoReader, ...) (Camera, error)
- func NewFromSource(ctx context.Context, source gostream.VideoSource, ...) (Camera, error)
- type PointCloudSource
- type Properties
- type StreamType
Constants ¶
const ( UnspecifiedStream = StreamType("") ColorStream = StreamType("color") DepthStream = StreamType("depth") )
The allowed types of streams that can come from a VideoSource.
const SubtypeName = resource.SubtypeName("camera")
SubtypeName is a constant that identifies the camera resource subtype string.
Variables ¶
var Subtype = resource.NewSubtype( resource.ResourceNamespaceRDK, resource.ResourceTypeComponent, SubtypeName, )
Subtype is a constant that identifies the camera resource subtype.
Functions ¶
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all camera names from the given Robot.
func NewGetPropertiesError ¶ added in v0.0.9
NewGetPropertiesError returns an error specific to a failure in GetProperties.
func NewServer ¶
func NewServer(s subtype.Service) pb.CameraServiceServer
NewServer constructs an camera gRPC service server.
func NewUnsupportedStreamError ¶
func NewUnsupportedStreamError(s StreamType) error
NewUnsupportedStreamError is when the stream type is unknown.
func ReadImage ¶ added in v0.0.8
ReadImage reads an image from the given source that is immediately available.
func SimultaneousColorDepthNext ¶
func SimultaneousColorDepthNext(ctx context.Context, color, depth gostream.VideoStream) (image.Image, *rimage.DepthMap)
SimultaneousColorDepthNext will call Next on both the color and depth camera as simultaneously as possible.
func WrapWithReconfigurable ¶
func WrapWithReconfigurable(r interface{}) (resource.Reconfigurable, error)
WrapWithReconfigurable wraps a camera with a reconfigurable and locking interface.
Types ¶
type AttrConfig ¶
type AttrConfig struct { CameraParameters *transform.PinholeCameraIntrinsics `json:"camera_parameters"` Stream string `json:"stream"` Debug bool `json:"debug"` }
AttrConfig is exported to be used as an attribute map for settings common to all camera types.
func CommonCameraAttributes ¶
func CommonCameraAttributes(attributes config.AttributeMap) (*AttrConfig, error)
CommonCameraAttributes extracts the common camera attributes.
type Camera ¶
type Camera interface { generic.Generic // Stream returns a stream that makes a best effort to return consecutive images // that may have a MIME type hint dictated in the context via gostream.WithMIMETypeHint. Stream(ctx context.Context, errHandlers ...gostream.ErrorHandler) (gostream.VideoStream, error) // NextPointCloud returns the next immediately available point cloud, not necessarily one // a part of a sequence. In the future, there could be streaming of point clouds. NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error) // GetProperties returns properties that are intrinsic to the particular // implementation of a camera GetProperties(ctx context.Context) (Properties, error) Close(ctx context.Context) error // contains filtered or unexported methods }
A Camera represents anything that can capture frames.
func FromDependencies ¶
func FromDependencies(deps registry.Dependencies, name string) (Camera, error)
FromDependencies is a helper for getting the named camera from a collection of dependencies.
func NewClientFromConn ¶
func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Camera
NewClientFromConn constructs a new Client from connection passed in.
func NewFromReader ¶ added in v0.0.8
func NewFromReader( ctx context.Context, reader gostream.VideoReader, proj *transform.PinholeCameraIntrinsics, streamType StreamType, ) (Camera, error)
NewFromReader creates a Camera either with or without a projector. The stream type argument is for detecting whether or not the resulting camera supports return of pointcloud data in the absence of an implemented NextPointCloud function. If this is unknown or not applicable, a value of camera.Unspecified stream can be supplied.
func NewFromSource ¶ added in v0.0.8
func NewFromSource( ctx context.Context, source gostream.VideoSource, proj *transform.PinholeCameraIntrinsics, streamType StreamType, ) (Camera, error)
NewFromSource creates a Camera either with or without a projector. The stream type argument is for detecting whether or not the resulting camera supports return of pointcloud data in the absence of an implemented NextPointCloud function. If this is unknown or not applicable, a value of camera.Unspecified stream can be supplied.
type PointCloudSource ¶
type PointCloudSource interface {
NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
}
A PointCloudSource is a source that can generate pointclouds.
type Properties ¶ added in v0.0.9
type Properties struct { // SupportsPCD indicates that the Camera supports a valid // implementation of NextPointCloud SupportsPCD bool IntrinsicParams *transform.PinholeCameraIntrinsics }
Properties is a lookup for a camera's features and settings.
type StreamType ¶
type StreamType string
StreamType specifies what kind of image stream is coming from the camera.
Directories ¶
Path | Synopsis |
---|---|
Package fake implements a fake camera.
|
Package fake implements a fake camera. |
Package ffmpeg provides an implementation for an ffmpeg based camera
|
Package ffmpeg provides an implementation for an ffmpeg based camera |
Package register registers all relevant cameras and also subtype specific functions
|
Package register registers all relevant cameras and also subtype specific functions |
Package transformpipeline defines image sources that apply transforms on images, and can be composed into an image transformation pipeline.
|
Package transformpipeline defines image sources that apply transforms on images, and can be composed into an image transformation pipeline. |
Package velodyne implements a general velodyne LIDAR as a camera.
|
Package velodyne implements a general velodyne LIDAR as a camera. |
Package videosource defines various image sources typically registered as cameras in the API.
|
Package videosource defines various image sources typically registered as cameras in the API. |