Skip to content
Snippets Groups Projects
Commit d0177680 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

[WIP] Debug weak_ptr segfault

parent 61bcc41a
No related branches found
No related tags found
1 merge request!362WIP: Resolve "std::set and std::map instead of std::list in wolf nodes"
Pipeline #5331 failed
This commit is part of merge request !362. Comments created here will be created in the context of that merge request.
......@@ -176,8 +176,8 @@ inline unsigned int CaptureBase::id() const
inline FrameBasePtr CaptureBase::getFrame() const
{
frame_ptr_.expired();
return frame_ptr_.lock();
if(frame_ptr_.expired()) return nullptr;
else return frame_ptr_.lock();
}
inline void CaptureBase::setFrame(const FrameBasePtr _frm_ptr)
......
......@@ -466,7 +466,7 @@ class ProcessorMotion : public ProcessorBase, public IsMotion
bool state_blocks,
std::ostream& stream ,
std::string _tabs = "") const override;
CaptureMotionPtr last_ptr_;
protected:
// Attributes
SizeEigen x_size_; ///< The size of the state vector
......@@ -475,7 +475,7 @@ class ProcessorMotion : public ProcessorBase, public IsMotion
SizeEigen delta_cov_size_; ///< the size of the delta covariances matrix
SizeEigen calib_size_; ///< the size of the calibration parameters (TBD in derived classes)
CaptureMotionPtr origin_ptr_;
CaptureMotionPtr last_ptr_;
CaptureMotionPtr incoming_ptr_;
protected:
......
......@@ -116,6 +116,9 @@ TEST(ProcessorBase, KeyFrameCallback)
capt_odo->setTimeStamp(t);
std::cout << "2\n";
problem->check(1);
auto proc_odo_motion = std::static_pointer_cast<ProcessorMotion>(proc_odo);
auto last_ptr = proc_odo_motion->last_ptr_;
auto last_ptr_frame = last_ptr->getFrame();
proc_odo->captureCallback(capt_odo);
std::cout << "3\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment