AppVeyor: updated realsense2 sdk to 2.40. CameraRealSense2: When GlobalTimeSync option is off, don't wait 35 ms for imu (and fails), just take the latest one directly (https://github.com/introlab/rtabmap/issues/614#issuecomment-732244439).

This commit is contained in:
matlabbe
2020-11-23 11:36:27 -05:00
parent 80199f23b5
commit 7859313beb
2 changed files with 21 additions and 15 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ install:
- ECHO "Installed yaml-cpp:" - ECHO "Installed yaml-cpp:"
- ps: "ls \"C:/Program Files/yaml-cpp\"" - ps: "ls \"C:/Program Files/yaml-cpp\""
# RealSense2 # RealSense2
- ps: wget 'https://github.com/IntelRealSense/librealsense/releases/download/v2.39.0/Intel.RealSense.SDK-WIN10-2.39.0.2337.exe' -outfile realsense2.exe - ps: wget 'https://github.com/IntelRealSense/librealsense/releases/download/v2.40.0/Intel.RealSense.SDK-WIN10-2.40.0.2482.exe' -outfile realsense2.exe
- cmd: realsense2.exe /VERYSILENT - cmd: realsense2.exe /VERYSILENT
- ECHO "Installed RealSense2:" - ECHO "Installed RealSense2:"
- ps: "ls \"C:/Program Files (x86)/Intel RealSense SDK 2.0\"" - ps: "ls \"C:/Program Files (x86)/Intel RealSense SDK 2.0\""
+8 -2
View File
@@ -299,6 +299,8 @@ void CameraRealSense2::getPoseAndIMU(
cv::Vec3d acc; cv::Vec3d acc;
{ {
imuMutex_.lock(); imuMutex_.lock();
if(globalTimeSync_)
{
int waitTry = 0; int waitTry = 0;
while(maxWaitTimeMs > 0 && accBuffer_.rbegin()->first < stamp && waitTry < maxWaitTimeMs) while(maxWaitTimeMs > 0 && accBuffer_.rbegin()->first < stamp && waitTry < maxWaitTimeMs)
{ {
@@ -307,7 +309,8 @@ void CameraRealSense2::getPoseAndIMU(
uSleep(1); uSleep(1);
imuMutex_.lock(); imuMutex_.lock();
} }
if(accBuffer_.rbegin()->first < stamp) }
if(globalTimeSync_ && accBuffer_.rbegin()->first < stamp)
{ {
if(maxWaitTimeMs>0) if(maxWaitTimeMs>0)
{ {
@@ -380,6 +383,8 @@ void CameraRealSense2::getPoseAndIMU(
cv::Vec3d gyro; cv::Vec3d gyro;
{ {
imuMutex_.lock(); imuMutex_.lock();
if(globalTimeSync_)
{
int waitTry = 0; int waitTry = 0;
while(maxWaitTimeMs>0 && gyroBuffer_.rbegin()->first < stamp && waitTry < maxWaitTimeMs) while(maxWaitTimeMs>0 && gyroBuffer_.rbegin()->first < stamp && waitTry < maxWaitTimeMs)
{ {
@@ -388,7 +393,8 @@ void CameraRealSense2::getPoseAndIMU(
uSleep(1); uSleep(1);
imuMutex_.lock(); imuMutex_.lock();
} }
if(gyroBuffer_.rbegin()->first < stamp) }
if(globalTimeSync_ && gyroBuffer_.rbegin()->first < stamp)
{ {
if(maxWaitTimeMs>0) if(maxWaitTimeMs>0)
{ {