uzh-rpg / rpg_svo_pro_open

GNU General Public License v3.0
1.39k stars 385 forks source link

SVO crashed when running stereo imu frontend vio #24

Open liuheng135 opened 2 years ago

liuheng135 commented 2 years ago

Today I'm trying to test stereo frontend vio of SVO on ARM platform(RK3399 ubuntu20.04 ROS noetic). I followed instructions of doc/frontend/visual_frontend.md And SVO crashed in few seconds. Below is the stack trace info: [ INFO] [1637825128.329917831]: Img Align: Maximum Number of Features = 540 [ INFO] [1637825128.329973246]: ref_frame: 88 [ INFO] [1637825128.330030411]: fts.szie = 59 [ INFO] [1637825128.330105950]: Img Align: Maximum Number of Features = 88 [ INFO] [1637825128.330148240]: Img Align: Tracking 117 features. Aborted at 1637825128 (unix time) try "date -d @1637825128" if you are using GNU date PC: @ 0x0 (unknown) SIGSEGV (@0xfffffc23288f) received by PID 26633 (TID 0xffff87ff3680) from PID 18446744073644746895; stack trace: @ 0xffffa5314bb8 google::(anonymous namespace)::FailureSignalHandler() @ 0xffffa6248588 ([vdso]+0x587) @ 0xffffa559415c svo::warp::warpAffine() @ 0xffffa55b28a4 svo::Matcher::findEpipolarMatchDirect() @ 0xffffa55b6ee4 svo::depth_filter_utils::updateSeed() @ 0xffffa55b7e18 svo::DepthFilter::updateSeeds() @ 0xffffa564cc70 svo::FrameHandlerStereo::makeKeyframe() @ 0xffffa564b50c svo::FrameHandlerStereo::processFrame() @ 0xffffa56663c4 svo::FrameHandlerBase::addFrameBundle() @ 0xffffa5667ab0 svo::FrameHandlerBase::addImageBundle() @ 0xffffa5f8cefc svo::SvoInterface::processImageBundle() @ 0xffffa5f8f5b0 svo::SvoInterface::stereoCallback() @ 0xffffa5fa14c4 boost::detail::function::void_function_obj_invoker9<>::invoke() @ 0xffffa5fab7a8 message_filters::CallbackHelper9T<>::call() @ 0xffffa5fa5794 message_filters::sync_policies::ExactTime<>::checkTuple() @ 0xffffa5fa719c message_filters::Synchronizer<>::cb<>() @ 0xffffa5fa221c image_transport::SubscriberFilter::cb() @ 0xffff94229c88 image_transport::RawSubscriber::internalCallback() @ 0xffffa595c2bc boost::detail::function::void_function_obj_invoker1<>::invoke() @ 0xffff9422db30 ros::SubscriptionCallbackHelperT<>::call() @ 0xffffa61b4264 ros::SubscriptionQueue::call() @ 0xffffa6160e64 ros::CallbackQueue::callOneCB() @ 0xffffa616258c ros::CallbackQueue::callAvailable() @ 0xffffa5f91068 svo::SvoInterface::stereoLoop() @ 0xffffa5e3b76c (unknown) @ 0xffffa60084fc start_thread @ 0xffffa5cacf2c (unknown) [svo-1] process has died [pid 26633, exit code -11, cmd /home/khadas/svo_ws/devel/lib/svo_ros/svo_node name:=svo log:=/home/khadas/.ros/log/3e96beba-4db7-11ec-9700-c863147043e2/svo-1.log]. log file: /home/khadas/.ros/log/3e96beba-4db7-11ec-9700-c863147043e2/svo-1*.log

And This is the code of crashed function: bool warpAffine( const AffineTransformation2& A_cur_ref, const cv::Mat& img_ref, const Eigen::Ref& px_ref, const int level_ref, const int search_level, const int halfpatch_size, uint8_t patch) { Eigen::Matrix2f A_ref_cur = A_cur_ref.inverse().cast()(1<<search_level); if(std::isnan(A_ref_cur(0,0))) { LOG(WARNING) << "Affine warp is NaN, probably camera has no translation"; return false; }

// Perform the warp on a larger patch. uint8_t patch_ptr = patch; const Eigen::Vector2f px_ref_pyr = px_ref.cast() / (1<<level_ref); const int stride = img_ref.step.p[0]; for (int y=-halfpatch_size; y<halfpatch_size; ++y) { for (int x=-halfpatch_size; x<halfpatch_size; ++x, ++patch_ptr) { const Eigen::Vector2f px_patch(x, y); const Eigen::Vector2f px(A_ref_curpx_patch + px_ref_pyr); const int xi = std::floor(px[0]); const int yi = std::floor(px[1]); if (xi<0 || yi<0 || xi+1>=img_ref.cols || yi+1>=img_ref.rows) return false; else { const float subpix_x = px[0]-xi; const float subpix_y = px[1]-yi; const float w00 = (1.0f-subpix_x)(1.0f-subpix_y); const float w01 = (1.0f-subpix_x)subpix_y; const float w10 = subpix_x(1.0f-subpix_y); const float w11 = 1.0f - w00 - w01 - w10; const uint8_t const ptr = img_ref.data + yistride + xi; patch_ptr = static_cast(w00ptr[0] + w01ptr[stride] + w10ptr[1] + w11ptr[stride+1]); } } } return true; }

it seems that the pointer is out of the patch border.

Does anybody know why????? Thx.

xixi0226 commented 2 years ago

I have same situation, Do you solve this problems?

liuheng135 commented 2 years ago

Not yet, I'm trying VINS-Fusion now 😂