ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
![]() | 1 | initial version |
Thank you very much for the response. I found a much simpler way to do it though. I just converted the array into a matrix and then published the matrix like this:
Mat matrixarray = Mat(11,20,CV_32FC1,deptharray); diff.PubDepthArray(matrixarray);
![]() | 2 | No.2 Revision |
Thank you very much for the response. I found a much simpler way to do it though. I just converted the array into a matrix and then published the matrix like this:
Mat matrixarray = Mat(11,20,CV_32FC1,deptharray);
Mat(11,20,CV_32FC1,deptharray);
diff.PubDepthArray(matrixarray);
where the method to publish the array looks like this:
void GetDiffImg::PubDepthArray(Mat depthArray){
cv_bridge::CvImage diffImgMsg;
diffImgMsg.encoding = sensor_msgs::image_encodings::TYPE_32FC1;
diffImgMsg.image = depthArray;
depthArrayPub.publish(diffImgMsg.toImageMsg());
![]() | 3 | No.3 Revision |
Thank you very much for the response. I found a much simpler way to do it though. I just converted the array into a matrix and then published the matrix like this:
Mat matrixarray = diff.PubDepthArray(matrixarray);
where the method to publish the array looks like this:
void GetDiffImg::PubDepthArray(Mat