Skip to content

Commit fa0d236

Browse files
committed
Fix build errors
1 parent 0fe406b commit fa0d236

3 files changed

Lines changed: 32 additions & 32 deletions

File tree

zed_components/src/zed_camera/include/zed_camera_component.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,13 @@ class ZedCamera : public rclcpp::Node
577577
double mSensPubRate = 200.;
578578

579579
std::vector<std::vector<float>> mRoyPolyParam; // Manual ROI polygon
580-
std::atomic<bool> mAutoRoiEnabled{false};
581-
std::atomic<bool> mManualRoiEnabled{false};
580+
bool mAutoRoiEnabled = false;
581+
bool mManualRoiEnabled = false;
582582
float mRoiDepthFarThresh = 2.5f;
583583
float mRoiImgHeightRationCutOff = 0.5f;
584584
std::unordered_set<sl::MODULE> mRoiModules;
585585

586-
std::atomic<bool> mPosTrackingEnabled{false};
586+
bool mPosTrackingEnabled = false;
587587
bool mPublishTF = false;
588588
bool mPublishMapTF = false;
589589
bool mPublishImuTF = false;
@@ -610,7 +610,7 @@ class ZedCamera : public rclcpp::Node
610610
bool mSetGravityAsOrigin = false;
611611
int mPathMaxCount = -1;
612612

613-
std::atomic<bool> mGnssFusionEnabled{false};
613+
bool mGnssFusionEnabled = false;
614614
std::string mGnssTopic = "/gps/fix";
615615
bool mGnssEnableReinitialization = true;
616616
bool mGnssEnableRollingCalibration = true;
@@ -624,11 +624,11 @@ class ZedCamera : public rclcpp::Node
624624
bool mPublishUtmTf = true;
625625
bool mUtmAsParent = true;
626626

627-
std::atomic<bool> mMappingEnabled{false};
627+
bool mMappingEnabled = false;
628628
float mMappingRes = 0.05f;
629629
float mMappingRangeMax = 10.0f;
630630

631-
std::atomic<bool> mObjDetRunning{false};
631+
bool mObjDetEnabled = false;
632632
bool mObjDetTracking = true;
633633
double mObjDetPredTimeout = 0.5;
634634
bool mObjDetReducedPrecision = false;
@@ -660,7 +660,7 @@ class ZedCamera : public rclcpp::Node
660660
std::unordered_map<int, std::string> mCustomLabels;
661661
std::unordered_map<std::string, int> mCustomClassIdMap;
662662

663-
std::atomic<bool> mBodyTrkEnabled{false};
663+
bool mBodyTrkEnabled = false;
664664
sl::BODY_TRACKING_MODEL mBodyTrkModel =
665665
sl::BODY_TRACKING_MODEL::HUMAN_BODY_FAST;
666666
sl::BODY_FORMAT mBodyTrkFmt = sl::BODY_FORMAT::BODY_38;
@@ -1075,9 +1075,9 @@ class ZedCamera : public rclcpp::Node
10751075

10761076
bool mAreaFileExists = false;
10771077
bool mResetOdomFromSrv = false;
1078-
bool mSpatialMappingRunning = false;
1078+
std::atomic<bool> mSpatialMappingRunning{false};
10791079
std::atomic<bool> mObjDetRunning{false};
1080-
bool mBodyTrkRunning = false;
1080+
std::atomic<bool> mBodyTrkRunning{false};
10811081
bool mRgbSubscribed = false;
10821082
bool mGnssMsgReceived = false; // Indicates if a NavSatFix topic has been
10831083
// received, also with invalid position fix

zed_components/src/zed_camera/src/zed_camera_component_main.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,30 +3914,29 @@ bool ZedCamera::startPosTrackingLocked()
39143914
return false;
39153915
}
39163916

3917-
3918-
if (mZed && mZed->isPositionalTrackingEnabled()) {
3919-
if (!mAreaMemoryFilePath.empty() && mSaveAreaMemoryOnClosing) {
3920-
// ----> Safe disablePositionalTracking
3921-
{
3922-
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
3923-
mZed->disablePositionalTracking(mAreaMemoryFilePath.c_str());
3924-
}
3925-
// <---- Safe disablePositionalTracking
3926-
RCLCPP_INFO(
3927-
get_logger(),
3928-
"Area memory updated before restarting the Positional "
3929-
"Tracking module.");
3930-
} else {
3931-
// ----> Safe disablePositionalTracking
3932-
{
3933-
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
3934-
mZed->disablePositionalTracking();
3935-
}
3936-
// <---- Safe disablePositionalTracking
3917+
3918+
if (mZed && mZed->isPositionalTrackingEnabled()) {
3919+
if (!mAreaMemoryFilePath.empty() && mSaveAreaMemoryOnClosing) {
3920+
// ----> Safe disablePositionalTracking
3921+
{
3922+
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
3923+
mZed->disablePositionalTracking(mAreaMemoryFilePath.c_str());
39373924
}
3925+
// <---- Safe disablePositionalTracking
3926+
RCLCPP_INFO(
3927+
get_logger(),
3928+
"Area memory updated before restarting the Positional "
3929+
"Tracking module.");
3930+
} else {
3931+
// ----> Safe disablePositionalTracking
3932+
{
3933+
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
3934+
mZed->disablePositionalTracking();
3935+
}
3936+
// <---- Safe disablePositionalTracking
39383937
}
39393938
}
3940-
// <---- Safe disablePositionalTracking
3939+
39413940

39423941
RCLCPP_INFO(get_logger(), "=== Starting Positional Tracking ===");
39433942

@@ -4025,9 +4024,10 @@ bool ZedCamera::startPosTrackingLocked()
40254024
}
40264025

40274026
// ----> Safe enablePositionalTracking
4027+
sl::ERROR_CODE err;
40284028
{
40294029
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
4030-
sl::ERROR_CODE err = mZed->enablePositionalTracking(ptParams);
4030+
err = mZed->enablePositionalTracking(ptParams);
40314031

40324032
if (err != sl::ERROR_CODE::SUCCESS) {
40334033
mPosTrackingStarted = false;

zed_components/src/zed_camera/src/zed_camera_component_objdet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ bool ZedCamera::startObjDetect()
978978

979979
// ----> Safe enableObjectDetection
980980
{
981-
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
981+
std::lock_guard<std::mutex> grab_lock(mGrabMutex);
982982
sl::ERROR_CODE objDetError = mZed->enableObjectDetection(od_p);
983983
if (objDetError != sl::ERROR_CODE::SUCCESS) {
984984
RCLCPP_ERROR_STREAM(

0 commit comments

Comments
 (0)