MsgConversion: fixed wrong right image output type. stereo_odometry: fixed rgbd_cameras param not initialized.

This commit is contained in:
matlabbe
2022-07-18 11:20:40 -04:00
parent ecf4d13984
commit 428091e4ca
3 changed files with 5 additions and 8 deletions
+2
View File
@@ -1267,6 +1267,8 @@ void CoreWrapper::commonMultiCameraCallbackImpl(
NODELET_ERROR("Could not convert rgb/depth msgs! Aborting rtabmap update...");
return;
}
UDEBUG("cameraModels=%ld stereoCameraModels=%ld", cameraModels.size(), stereoCameraModels.size());
UDEBUG("rgb=%dx%d(type=%d), depth/right=%dx%d(type=%d)", rgb.rows, rgb.cols, rgb.type(), depth.rows, depth.cols, depth.type());
if(stereoCameraModels.size() && stereoToDepth_)
{
+2 -7
View File
@@ -2025,18 +2025,13 @@ bool convertRGBDMsgs(
{
cv_bridge::CvImageConstPtr ptrImage = depthMsgs[i];
if( depthMsgs[i]->encoding.compare(sensor_msgs::image_encodings::TYPE_8UC1)==0 ||
depthMsgs[i]->encoding.compare(sensor_msgs::image_encodings::MONO8) == 0 ||
depthMsgs[i]->encoding.compare(sensor_msgs::image_encodings::BGR8) == 0)
depthMsgs[i]->encoding.compare(sensor_msgs::image_encodings::MONO8) == 0)
{
// do nothing
}
else if(depthMsgs[i]->encoding.compare(sensor_msgs::image_encodings::MONO16) == 0)
{
ptrImage = cv_bridge::cvtColor(depthMsgs[i], "mono8");
}
else
{
ptrImage = cv_bridge::cvtColor(depthMsgs[i], "bgr8");
ptrImage = cv_bridge::cvtColor(depthMsgs[i], "mono8");
}
// initialize
+1 -1
View File
@@ -96,7 +96,7 @@ private:
bool approxSync = false;
bool subscribeRGBD = false;
double approxSyncMaxInterval = 0.0;
int rgbdCameras;
int rgbdCameras = 1;
pnh.param("approx_sync", approxSync, approxSync);
pnh.param("approx_sync_max_interval", approxSyncMaxInterval, approxSyncMaxInterval);
pnh.param("queue_size", queueSize_, queueSize_);