mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-07 02:07:45 +08:00
MsgConversion: fixed wrong right image output type. stereo_odometry: fixed rgbd_cameras param not initialized.
This commit is contained in:
@@ -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_)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user