camera

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: AGPL-3.0 Imports: 25 Imported by: 0

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

View Source
const (
	UnspecifiedStream = StreamType("")
	ColorStream       = StreamType("color")
	DepthStream       = StreamType("depth")
	BothStream        = StreamType("both")
)

The allowed types of streams that can come from an ImageSource.

View Source
const SubtypeName = resource.SubtypeName("camera")

SubtypeName is a constant that identifies the camera resource subtype string.

Variables

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 Named

func Named(name string) resource.Name

Named is a helper for getting the named cameras's typed resource name.

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

NamesFromRobot is a helper for getting all camera names from the given Robot.

func NewServer

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"`
	Width            int                                `json:"width"`
	Height           int                                `json:"height"`
	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)
}

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 FromRobot

func FromRobot(r robot.Robot, name string) (Camera, error)

FromRobot is a helper for getting the named Camera from the given Robot.

func New

func New(imgSrc gostream.ImageSource, proj rimage.Projector) (Camera, error)

New creates a Camera either with or without a projector.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL