Skip to content

Commit a8bf7e5

Browse files
committed
Fixed Qt5 plugins release. Zed driver: sdded 2 seconds delay before sending grab error.
1 parent 69e1973 commit a8bf7e5

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

app/src/CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,24 @@ IF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
138138
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
139139
# Exclude debug libraries
140140
IF(QT_PLUGINS_DIR)
141-
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
141+
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
142142
DESTINATION ${plugin_dest_dir}/plugins
143143
COMPONENT runtime
144144
REGEX ".*d4.dll" EXCLUDE
145145
REGEX ".*d4.a" EXCLUDE)
146-
ENDIF(QT_PLUGINS_DIR)
146+
ELSE()
147+
#Qt5
148+
foreach(plugin ${Qt5Gui_PLUGINS})
149+
get_target_property(plugin_loc ${plugin} LOCATION)
150+
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
151+
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
152+
list(GET loc_list 1 plugin_type)
153+
#MESSAGE(STATUS "Qt5 plugin "${plugin_loc}" installed in "${plugin_dest_dir}/plugins${plugin_type}"")
154+
INSTALL(FILES ${plugin_loc}
155+
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
156+
COMPONENT runtime)
157+
endforeach()
158+
ENDIF()
147159

148160
# install a qt.conf file
149161
# this inserts some cmake code into the install script to write the file

corelib/src/CameraStereo.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,14 @@ SensorData CameraStereoZed::captureImage()
893893
#ifdef RTABMAP_ZED
894894
if(zed_)
895895
{
896+
UTimer timer;
896897
bool res = zed_->grab((sl::zed::SENSING_MODE)sensingMode_, quality_ > 0, quality_ > 0, false);
898+
while (src_ == CameraVideo::kUsbDevice && res && timer.elapsed() < 2.0)
899+
{
900+
// maybe there is a latency with the USB, try again in 10 ms (for the next 2 seconds)
901+
uSleep(10);
902+
res = zed_->grab((sl::zed::SENSING_MODE)sensingMode_, quality_ > 0, quality_ > 0, false);
903+
}
897904
if(!res)
898905
{
899906
// get left image
@@ -922,7 +929,7 @@ SensorData CameraStereoZed::captureImage()
922929
}
923930
else if(src_ == CameraVideo::kUsbDevice)
924931
{
925-
UERROR("CameraStereoZed: Failed to grab images!");
932+
UERROR("CameraStereoZed: Failed to grab images after 2 seconds!");
926933
}
927934
else
928935
{

0 commit comments

Comments
 (0)