Documentation ¶
Overview ¶
Package camera defines a frame capturing device.
Package camera contains a gRPC based camera client.
Package camera contains a gRPC based camera service server.
Index ¶
- Constants
- Variables
- func GetProjector(ctx context.Context, attrs *AttrConfig, parentSource Camera) (rimage.Projector, bool)
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewServer(s subtype.Service) pb.CameraServiceServer
- func NewUnsupportedStreamError(s StreamType) error
- func SimultaneousColorDepthNext(ctx context.Context, color, depth gostream.ImageSource) (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 New(imgSrc gostream.ImageSource, proj rimage.Projector) (Camera, error)
- func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Camera
- type FrameSource
- type PointCloudSource
- type StreamType
Constants ¶
const ( UnspecifiedStream = StreamType("") ColorStream = StreamType("color") DepthStream = StreamType("depth") )
The allowed types of streams that can come from an ImageSource.
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 GetProjector ¶
func GetProjector(ctx context.Context, attrs *AttrConfig, parentSource Camera) (rimage.Projector, bool)
GetProjector either gets the camera parameters from the config, or if the camera has a parent source, can copy over the projector from there. If the camera doesn't have a projector, will return false.
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all camera names from the given Robot.
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 SimultaneousColorDepthNext ¶
func SimultaneousColorDepthNext(ctx context.Context, color, depth gostream.ImageSource) (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"` Hide bool `json:"hide"` Debug bool `json:"debug"` Dump bool `json:"dump"` }
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 { gostream.ImageSource generic.Generic NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error) GetProperties(ctx context.Context) (rimage.Projector, error) GetFrame(ctx context.Context, mimeType string) ([]byte, string, int64, int64, error) }
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.
type FrameSource ¶ added in v0.0.7
type FrameSource interface {
GetFrame(ctx context.Context, mimeType string) ([]byte, string, int64, int64, error)
}
A FrameSource is a source that can generate frames.
type PointCloudSource ¶
type PointCloudSource interface {
NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
}
A PointCloudSource is a source that can generate pointclouds.
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 imagesource defines various image sources typically registered as cameras in the API.
|
Package imagesource defines various image sources typically registered as cameras in the API. |
Package imagetransform defines cameras that apply transforms for images in an image transformation pipeline.
|
Package imagetransform defines cameras that apply transforms for images in an image transformation pipeline. |
Package register registers all relevant cameras and also subtype specific functions
|
Package register registers all relevant cameras and also subtype specific functions |
Package velodyne implements a general velodyne LIDAR as a camera.
|
Package velodyne implements a general velodyne LIDAR as a camera. |