Documentation ¶
Overview ¶
Package fake implements a fake camera which always returns the same image with a user specified resolution.
Index ¶
- Variables
- func NewCamera(ctx context.Context, _ resource.Dependencies, conf resource.Config, ...) (camera.Camera, error)
- type Camera
- func (c *Camera) Close(ctx context.Context) error
- func (c *Camera) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
- func (c *Camera) Read(ctx context.Context) (image.Image, func(), error)
- func (c *Camera) SubscribeRTP(ctx context.Context, bufferSize int, packetsCB rtppassthrough.PacketCallback) (rtppassthrough.Subscription, error)
- func (c *Camera) Unsubscribe(ctx context.Context, id rtppassthrough.SubscriptionID) error
- type Config
- type StaticSource
- func (ss *StaticSource) Close(ctx context.Context) error
- func (ss *StaticSource) Images(ctx context.Context) ([]camera.NamedImage, resource.ResponseMetadata, error)
- func (ss *StaticSource) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
- func (ss *StaticSource) Read(ctx context.Context) (image.Image, func(), error)
Constants ¶
This section is empty.
Variables ¶
var ( // Model is the model of the fake buildin camera. Model = resource.DefaultModelFamily.WithModel("fake") // ErrRTPPassthroughNotEnabled indicates that rtp_passthrough is not enabled. ErrRTPPassthroughNotEnabled = errors.New("rtp_passthrough not enabled") )
Functions ¶
Types ¶
type Camera ¶
type Camera struct { resource.Named resource.AlwaysRebuild Model *transform.PinholeCameraModel Width int Height int Animated bool RTPPassthrough bool // contains filtered or unexported fields }
Camera is a fake camera that always returns the same image.
func (*Camera) NextPointCloud ¶
func (c *Camera) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
NextPointCloud always returns a pointcloud of a yellow to blue gradient, with the depth determined by the intensity of blue.
func (*Camera) SubscribeRTP ¶ added in v0.27.0
func (c *Camera) SubscribeRTP( ctx context.Context, bufferSize int, packetsCB rtppassthrough.PacketCallback, ) (rtppassthrough.Subscription, error)
SubscribeRTP begins a subscription to receive RTP packets.
func (*Camera) Unsubscribe ¶ added in v0.27.0
func (c *Camera) Unsubscribe(ctx context.Context, id rtppassthrough.SubscriptionID) error
Unsubscribe terminates the subscription.
type Config ¶ added in v0.2.36
type Config struct { Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` Animated bool `json:"animated,omitempty"` RTPPassthrough bool `json:"rtp_passthrough,omitempty"` }
Config are the attributes of the fake camera config.
type StaticSource ¶ added in v0.41.0
StaticSource is a fixed, stored image. Used primarily for testing.
func (*StaticSource) Close ¶ added in v0.41.0
func (ss *StaticSource) Close(ctx context.Context) error
Close does nothing.
func (*StaticSource) Images ¶ added in v0.41.0
func (ss *StaticSource) Images(ctx context.Context) ([]camera.NamedImage, resource.ResponseMetadata, error)
Images returns the saved color and depth image if they are present.
func (*StaticSource) NextPointCloud ¶ added in v0.41.0
func (ss *StaticSource) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)
NextPointCloud returns the point cloud from projecting the rgb and depth image using the intrinsic parameters.