mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Windows CI: make vcpkg download compatible with draft release (#1727)
* Windows CI: make vcpkg download compatible with draft release * forcing nvdia driver dll to be ignored in fixup_bundle * disabling opencv cudec and python * disabling rtabmap-console --version on cuda build * Added assert when bad imu data is provided. Added checks when zed sdk is returning nan imu data. * Updated zed sdk5 resolution and quality * Updated zed sdk5 resolution and quality * Fixing parameters reloaded when testing camera. Also fixed app freezing when closing Preferences dialog after using test camera dialog * cleanup and debug logs * Added dialogs when starting/stopping sensors/detection. Fixed nullptr bug on MainWindow::handleEvents * renamed * found a way to expose ZED model downloads * Updated default config path on Windows * Fixed extra endline in file logging (windows) * Fixed camera local transform when used with lidar and odomSensor * CI(macos): build g2o from source with OpenMP (libomp include/link fix) * Mac: added ceres dep, fixed omp not found by cmake * Mac: bundle orbbec extensions * stripping rpath of orbbec's extensions * cleanup * Realsense2 error as error (not warning) * Fixed config ownership changed to root when sarting in sudo. LidarVLP16: fixed crash on Mac by reimplementing our own socket threading * LidarVLP16: own socket implementation only for Mac (linux and windows use original PCL's reader)
This commit is contained in:
@@ -344,7 +344,7 @@ public:
|
||||
void setGPS(const GPS & gps) {gps_ = gps;}
|
||||
const GPS & gps() const {return gps_;}
|
||||
|
||||
void setIMU(const IMU & imu) {imu_ = imu; }
|
||||
void setIMU(const IMU & imu);
|
||||
const IMU & imu() const {return imu_;}
|
||||
|
||||
void setEnvSensors(const EnvSensors & sensors) {_envSensors = sensors;}
|
||||
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
public:
|
||||
CameraStereoZed(
|
||||
int deviceId,
|
||||
int resolution = -1, // -1 = AUTO, 0=HD4K 1=HD2K 2=HD1080 3=HD1200 4=HD720 5=SVGA 6=VGA
|
||||
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
|
||||
int resolution = -1, // -1 = AUTO, 0=HD4K 1=QHDPLUS 2=HD2K 3=HD1536 4=HD1080 5=HD1200 6=HD720 7=SVGA 8=VGA 9=XVGA 10=TXVGA
|
||||
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY, 3=ULTRA, 4=NEURAL_LIGHT, 5=NEURAL, 6=NEURAL_ULTRA
|
||||
int sensingMode = 0,// 0=STANDARD, 1=FILL
|
||||
int confidenceThr = 100,
|
||||
bool computeOdometry = false,
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
int texturenessConfidenceThr = 90); // introduced with ZED SDK 3
|
||||
CameraStereoZed(
|
||||
const std::string & svoFilePath,
|
||||
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY, 3=NEURAL
|
||||
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY, 3=ULTRA, 4=NEURAL_LIGHT, 5=NEURAL, 6=NEURAL_ULTRA
|
||||
int sensingMode = 0,// 0=STANDARD, 1=FILL
|
||||
int confidenceThr = 100,
|
||||
bool computeOdometry = false,
|
||||
@@ -81,6 +81,15 @@ public:
|
||||
void postInterIMUPublic(const IMU & imu, double stamp);
|
||||
void setRightGrayScale(bool enabled = true);
|
||||
|
||||
/**
|
||||
* If the given ZED depth mode (quality: same encoding as the constructor) is a NEURAL mode
|
||||
* whose AI model isn't yet downloaded/optimized for the GPU, returns a human-readable warning
|
||||
* that the first start will be slower (the ZED SDK downloads/optimizes the model during
|
||||
* init()). Returns an empty string when the model is ready, the mode isn't neural, or the
|
||||
* SDK/build doesn't support the check.
|
||||
*/
|
||||
static std::string getNeuralModelWarning(int quality);
|
||||
|
||||
protected:
|
||||
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
||||
|
||||
|
||||
@@ -29,10 +29,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// Should be first on windows to avoid "WinSock.h has already been included" error
|
||||
#include <pcl/io/vlp_grabber.h>
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
#include <rtabmap/core/Lidar.h>
|
||||
#include <rtabmap/utilite/USemaphore.h>
|
||||
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
// On Apple, closing pcl::HDLGrabber's UDP socket while its read thread is blocked
|
||||
// in receive_from returns EBADF, which pcl::HDLGrabber::readPacketsFromSocket()
|
||||
// rethrows uncaught in its own thread, aborting the process on shutdown. There we
|
||||
// run our own single-threaded UDP receive loop and own the socket lifecycle.
|
||||
// Other platforms use the base pcl::VLPGrabber path (which also avoids needing
|
||||
// boost::asio::io_context, absent from the Boost 1.65 on e.g. Ubuntu Bionic).
|
||||
// Comment this out to force the base path everywhere (e.g. A/B testing on macOS).
|
||||
#if defined(__APPLE__)
|
||||
#define RTABMAP_VLP16_USE_CUSTOM_SOCKET
|
||||
#endif
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
struct PointXYZIT {
|
||||
@@ -68,9 +83,28 @@ public:
|
||||
|
||||
void setOrganized(bool enable);
|
||||
|
||||
#ifdef RTABMAP_VLP16_USE_CUSTOM_SOCKET
|
||||
// Overridden only on Apple: in network mode we run our own UDP receive loop
|
||||
// instead of pcl::HDLGrabber's, because on macOS/BSD closing the grabber's
|
||||
// socket while its read thread is blocked in receive_from returns EBADF, a
|
||||
// code that pcl::HDLGrabber::readPacketsFromSocket() rethrows uncaught (in
|
||||
// its own thread), aborting the process on shutdown. Owning the socket lets
|
||||
// us tear it down with the non-throwing receive_from overload. Like
|
||||
// pcl::HDLGrabber, we bind to the given LOCAL interface address (to scope
|
||||
// reception on a multi-homed host) and fall back to all interfaces (0.0.0.0)
|
||||
// when it is unspecified or not a local address. In PCAP mode we delegate to
|
||||
// the base grabber. On other platforms we inherit pcl::VLPGrabber directly.
|
||||
virtual void start() override;
|
||||
virtual void stop() override;
|
||||
virtual bool isRunning() const override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
void buildTimings(bool dualMode);
|
||||
virtual void toPointClouds (HDLDataPacket *dataPacket) override;
|
||||
#ifdef RTABMAP_VLP16_USE_CUSTOM_SOCKET
|
||||
void readPackets();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual SensorData captureData(SensorCaptureInfo * info = 0) override;
|
||||
@@ -88,6 +122,18 @@ private:
|
||||
std::vector<std::vector<PointXYZIT> > accumulatedScans_;
|
||||
USemaphore scanReady_;
|
||||
UMutex lastScanMutex_;
|
||||
|
||||
// Own UDP receive path (network mode only).
|
||||
bool networkMode_;
|
||||
boost::asio::ip::address ipAddress_;
|
||||
std::uint16_t port_;
|
||||
bool receivedScan_; // set once the first scan is received
|
||||
#ifdef RTABMAP_VLP16_USE_CUSTOM_SOCKET
|
||||
boost::asio::io_context ioContext_;
|
||||
boost::asio::ip::udp::socket * socket_;
|
||||
std::thread * readThread_;
|
||||
std::atomic<bool> terminate_;
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* namespace rtabmap */
|
||||
|
||||
Reference in New Issue
Block a user