10 #include <gtest/gtest.h> 12 #include <mrpt/config.h> 15 #include <test_mrpt_common.h> 18 #if MRPT_HAS_FFMPEG && MRPT_HAS_OPENCV 19 TEST(RawlogGrabberApp, CGenericCamera_AVI)
21 TEST(RawlogGrabberApp, DISABLED_CGenericCamera_AVI)
27 mrpt::UNITTEST_BASEDIR +
28 "/share/mrpt/config_files/rawlog-grabber/camera_ffmpeg_video_file.ini"s;
32 mrpt::UNITTEST_BASEDIR +
"/share/mrpt/datasets/dummy_video.avi"s;
55 app.
params.
write(
"Camera1",
"process_rate",
"10.0");
64 const std::size_t REQUIRED_GRAB_OBS = 3U;
65 std::atomic_bool runEnded =
false;
67 auto tWatchDog = std::thread([&]() {
70 const auto numSavedObjs = [&]() {
74 if (numSavedObjs >= REQUIRED_GRAB_OBS)
80 std::this_thread::sleep_for(std::chrono::milliseconds(500));
92 if (tWatchDog.joinable()) tWatchDog.join();
96 catch (
const std::exception& e)
bool createDirectory(const std::string &dirName)
Creates a directory.
std::mutex results_mtx
Acquire this mutex if reading these output variables while the app is running.
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
void setMinLoggingLevel(const VerbosityLevel level)
Set the minimum logging level for which the incoming logs are going to be taken into account...
const std::string video_fil
bool show_sensor_thread_exceptions
If enabled (default), exceptions in sensor threads will be reported to std::cerr. ...
TEST(ICP_SLAM_App, MapFromRawlog_PointMap)
LockHelper< T > lockHelper(T &t)
Syntactic sugar to easily create a locker to any kind of std::mutex.
std::string getTempFileName()
Returns the name of a proposed temporary file name.
void initialize(int argc, const char **argv)
Initializes the application from CLI parameters.
void run()
Runs with the current parameter set.
const std::string ini_fil
void write(const std::string §ion, const std::string &name, enum_t value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string())
EXPECT_TRUE(mrpt::system::fileExists(ini_fil))
double run_for_seconds
If >0, run() will return after this period (in seconds)
std::size_t rawlog_saved_objects
Counter of saved objects.
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
std::mutex params_mtx
Acquire this mutex if changing parameters while the app is running.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
mrpt::config::CConfigFileMemory params
Populated in initialize().
RawlogGrabber application wrapper class.