mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
RealSense2: added error message for L515 if resolution is not 640x480 30 fps (#629)
This commit is contained in:
@@ -656,31 +656,33 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
auto video_profile = profile.as<rs2::video_stream_profile>();
|
auto video_profile = profile.as<rs2::video_stream_profile>();
|
||||||
if(!stereo)
|
if(!stereo)
|
||||||
{
|
{
|
||||||
if(isL500_
|
if(isL500_)
|
||||||
&& (video_profile.width() == 640 &&
|
|
||||||
video_profile.height() == 480 &&
|
|
||||||
video_profile.fps() == 30))
|
|
||||||
{
|
{
|
||||||
if( i==0 // rgb
|
if(video_profile.width() == 640 &&
|
||||||
&& video_profile.format() == RS2_FORMAT_RGB8 && video_profile.stream_type() == RS2_STREAM_COLOR)
|
video_profile.height() == 480 &&
|
||||||
|
video_profile.fps() == 30)
|
||||||
{
|
{
|
||||||
auto intrinsic = video_profile.get_intrinsics();
|
if( i==0 // rgb
|
||||||
profilesPerSensor[i].push_back(profile);
|
&& video_profile.format() == RS2_FORMAT_RGB8 && video_profile.stream_type() == RS2_STREAM_COLOR)
|
||||||
rgbBuffer_ = cv::Mat(cv::Size(video_profile.width(), video_profile.height()), CV_8UC3, cv::Scalar(0, 0, 0));
|
{
|
||||||
model_ = CameraModel(camera_name, intrinsic.fx, intrinsic.fy, intrinsic.ppx, intrinsic.ppy, this->getLocalTransform(), 0, cv::Size(intrinsic.width, intrinsic.height));
|
auto intrinsic = video_profile.get_intrinsics();
|
||||||
rgbStreamProfile = profile;
|
profilesPerSensor[i].push_back(profile);
|
||||||
*rgbIntrinsics_ = intrinsic;
|
rgbBuffer_ = cv::Mat(cv::Size(video_profile.width(), video_profile.height()), CV_8UC3, cv::Scalar(0, 0, 0));
|
||||||
added = true;
|
model_ = CameraModel(camera_name, intrinsic.fx, intrinsic.fy, intrinsic.ppx, intrinsic.ppy, this->getLocalTransform(), 0, cv::Size(intrinsic.width, intrinsic.height));
|
||||||
}
|
rgbStreamProfile = profile;
|
||||||
else if( i==1 // depth
|
*rgbIntrinsics_ = intrinsic;
|
||||||
&& video_profile.format() == RS2_FORMAT_Z16 && video_profile.stream_type() == RS2_STREAM_DEPTH)
|
added = true;
|
||||||
{
|
}
|
||||||
auto intrinsic = video_profile.get_intrinsics();
|
else if( i==1 // depth
|
||||||
profilesPerSensor[i].push_back(profile);
|
&& video_profile.format() == RS2_FORMAT_Z16 && video_profile.stream_type() == RS2_STREAM_DEPTH)
|
||||||
depthBuffer_ = cv::Mat(cv::Size(video_profile.width(), video_profile.height()), CV_16UC1, cv::Scalar(0));
|
{
|
||||||
depthStreamProfile = profile;
|
auto intrinsic = video_profile.get_intrinsics();
|
||||||
*depthIntrinsics_ = intrinsic;
|
profilesPerSensor[i].push_back(profile);
|
||||||
added = true;
|
depthBuffer_ = cv::Mat(cv::Size(video_profile.width(), video_profile.height()), CV_16UC1, cv::Scalar(0));
|
||||||
|
depthStreamProfile = profile;
|
||||||
|
*depthIntrinsics_ = intrinsic;
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//D400 series:
|
//D400 series:
|
||||||
@@ -820,6 +822,10 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
video_profile.stream_name().c_str(),
|
video_profile.stream_name().c_str(),
|
||||||
video_profile.stream_type());
|
video_profile.stream_type());
|
||||||
}
|
}
|
||||||
|
if(isL500_)
|
||||||
|
{
|
||||||
|
UERROR("L500 sensor is detected, note that only 640x480:30FPS configuration is currently supported.");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user