Class cwipc_activesource

Inheritance Relationships

Base Type

Class Documentation

class cwipc_activesource : public cwipc_source

A generator of pointclouds based on some capturer, abstract C++ interface.

This interface is provided by capturers and such that can return pointclouds. It is a subclass of cwipc_source with extra methods to obtain information on available tiles in the produced pointclouds, plus extensions for reloading the capturer, or positioning it, starting it, stopping it, etc.

Public Functions

inline virtual ~cwipc_activesource()
virtual bool reload_config(const char *configFile) = 0

Reload capturer based on a new configuration.

Only implemented for actual cameras (realsense, kinect). Closes the cameras and reopens them with a new configuration.

Parameters:

configFile – The pathname to the new camera configuration or an inline json configuration string.

Returns:

A boolean that is true if the reload was successful.

virtual size_t get_config(char *buffer, size_t size) = 0

Return current configuration as a JSON string.

For actual camera capturers this returns the current configuration in a buffer supplied by the caller.

Parameters:
  • buffer – Where the JSON will be stored. Pass NULL to get the size of the buffer needed.

  • size – Size of the buffer.

virtual bool start() = 0

Start the source.

Returns:

True if the source started successfully.

virtual void stop() = 0

Stop the source.

virtual bool seek(uint64_t timestamp) = 0

Performs a seek on the playback.

Parameters:

timestamp – The timestamp wanted

Returns:

A boolean that is true if the seek was successful.

virtual int maxtile() = 0

Return maximum number of possible tiles.

Pointclouds produced by this source will (even after tile-processing) never contain more tiles than this. Note that this number used to contain potential fused cameras but no longer: It is either 0 or 1 or nCamera+1.

virtual bool get_tileinfo(int tilenum, struct cwipc_tileinfo *tileinfo) = 0

Return information on a tile number.

Tile number 0 is a special case, representing the whole pointcloud.

Parameters:
  • tilenum – The tile on which to obtain information.

  • tileinfo – A pointer to a structure filled with information on the tile (if non-NULL).

Returns:

A boolean that is true if the tile exists.

inline virtual void request_metadata(const std::string &name)

Request specific metadata to be added to pointclouds.

Capturing metadata data (such as skeletons, or RGBD images) may be expensive, therefore you need to request the specific metadata you need.

If a subclass needs special handing for dynamic requests of metadata items it should override this method, call the base and then use is_metadata_requested() to see which data is currently wanted.

Parameters:

name – Name of the metadata wanted.

inline bool is_metadata_requested(const std::string &name)

Returns true is specific metadata has been requested.

Parameters:

name – Name of the metadata

Returns:

True or false

inline virtual bool auxiliary_operation(const std::string op, const void *inbuf, size_t insize, void *outbuf, size_t outsize)

Do an auxiliary operation.

Operations could be things like mapping 2D coordinates to 3D coordinates, or getting camera metadata.

Parameters:
  • op – The operation to perform

  • inbuf – Buffer with parameters to the operation

  • insize – Size of inbuf

  • outbuf – Buffer for results of the operation

  • outsize – Size of outbuf

Returns:

success indicator.