Acquire point clouds of specific objects in the scene in order to save or stream them.
git clone https://github.com/fbottarel/point-cloud-read.git
cd point-cloud-read
mkdir build && cd build
cmake [-DUSE_PCL=ON] ../
make install
The user might want to use this module when they want to acquire point clouds of objects currently in the scene in front of the robot. point-cloud-read takes care of interfacing with the modules in IOL to determine whether the queried object is in the scene, where it is, and retrieve the point cloud from the robot's stereo vision system.
Once the module is running and connected (the code is comprehensive of a .xml application file for yarpmanager) it can be interacted with using the ports it opens:
/pointCloudRead/rpcexposes an rpc interface to trigger acquisitions. See below for details/pointCloudRead/pointCloud:ois ayarp::os::BufferedPortwhere the module publishes the acquired point clouds as<yarp::sig::PointCloud<yarp::sig::DataXYZRGBA>>
Typing help as rpc command returns a list of available commands, here briefly listed.
set_period periodInSecondssets the streaming period toperiodInSecondsseconds. DefaultperiodInSecondsis 1.0stream_start objectNamestarts the point cloud stream of an object recognized asobjectNamein the scene with periodperiodInSeconds. Empty point clouds are streamed if noobjectNameis found in the scenestream_stopstops the point cloud streamstream_one objectNametriggers a one-shot acquisition and streaming. If noobjectNameis found in the scene, the command failsdump_one objectName formatcommands the module to acquire a point cloud and dump it to a file in the.offor.pcdformat. The resulting file will beobjectName_point_cloud_XXX.[off|pcd], whereXXXis a zero-filled number that increases when more point clouds of the same object are dumped. Such file is easily readable with programs such as MeshLab. Note: the.pcdformat is available only if the support toPCLis enabled.get_point_cloud objectNamereturns ayarp::os::Bottlecontaining the point cloud of the required object as ayarp::sig::PointCloud<yarp::sig::DataXYZRGBA>.