Questions about Depth Camera Callbacks
Hey there, i am trying to build a plugin to work with the data i get from depth cameras, in the already existing plugins there are several events, that callbacks can be registered, "NewDepthFrame", "NewImageFrame", "NewRGBPointCloud".
They get different input data, "NewDepthFrame" and "NewRGBPointCloud" get a pointer to float data, while "NewImageFrage" gets a pointer to char data.
From what i pieced together by going through the source code and various examples:
NewImageFrame receives a pointer to what the camera sees as a 2D-Picture, size of the field in Bytes should be height*width
NewDepthFrame receives a pointer to the depth values. It seems to be the distance from the position of the sensor, the location of the actual points can be calculated using the HFOV, height, width etc. (as seen in https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_plugins/src/gazebo_ros_depth_camera.cpp#L368) Size in Bytes should be width * height * sizeof(float) aswell
NewRGBPointCloud receives a pointer to float values, that represent the x,y and z coordinates of a point and the an rgb value. The order of the points is The first byte represents r, the second one g, the third one b. Size of the field in bytes SHOULD be width*height * 4 * sizeof(float).
I tried connecting to the NewRGBPointCloud, but callback never executed. With NewDepthImageFrage it works fine.
Questions:
Are the assumptions about the different callbacks correct?
Are there any other measures that need to be taken to let the NewRGBPointCloud be triggered, that differ from the NewDepthFrame Callback ?
Asked by theo_shall_burn on 2020-08-06 04:08:23 UTC
Comments