baidu / boteye

211 stars 72 forks source link

Only camera pose track ,But no map established #11

Open xjtao1314 opened 6 years ago

xjtao1314 commented 6 years ago

Hello there, Thank you for your great work. I test the whole camera XP2 and program . The platform is cpu i7 7700
system :Ubuntu 14.04 with kernel 4.4.0-31 Question : there is only camera trajectory show as below, and failed to save map ,instead give many log files in the given path? Is that a normal display? screenshot from 2018-02-25 14 30 18

kiyology commented 6 years ago

Hi @xjtao1314 Can you post the command you use? The program only displays map when you use -pb_load with the saved map. To save map, you need to add a -pb_save xxxx option, where xxxx indicates the location of the map to be saved(eg. /tmp/room.pb). When you are done recording the map, make sure to press ESC for the program to exit normally and save the map. Let me know if you have more questions.

lightningsoon commented 6 years ago

I met the same problem as your. The following is my command: ./app_tracking -sensor_type XP2 -cam_calib_path mysensor180601.yaml -pb_load data/room1.pb -path_follower walk -guide_ip 127.0.0.1 -guide_port 8887 no img_size is found in calib file. Using default value [752 x 480] loading dic: /home/momo/XP_release/3rdparty_lib_lean/BOW.proto ok! E0614 18:39:16.049405 22204 map.cc:407] a mp in map cannot be associated with any mp extraction. E0614 18:39:16.049537 22204 map.cc:407] a mp in map cannot be associated with any mp extraction. Loading data/room1.pb took 212.645 ms Skip /dev/video0 name BisonCam, NB Pro Find a Baidu_Robotics_vision_XP2S dev at /dev/video1 hardware version num: 1 Firmware version: V0.6.5-fa43d90-commit device ID: ����������������������������������������������������������������������������������������������������� try reloc with rig 30.164 try reloc with rig 36.51 try reloc with rig 28.936 try reloc with rig 44.124

Do you have any approach to deal with this bug? I'll appreciate you very much.

lightningsoon commented 6 years ago

具体情况是这样的,如果运行官方编译好的程序app_tracking,没有问题,和手册中效果一样。但是自己编译出的app_tracking就没有地图,命令都是一样的,我重新存了张地图也不能读取,就是这样报错。 是不是两份代码不一样。

lightningsoon commented 6 years ago

还有一个问题,为什么角度最大也就15,和注释里点单位不一样啊?

lightningsoon commented 6 years ago

ubuntu1604 @xjtao1314 @kiyology I solve this problem. in line 650~700 Please modify them with the following code.Note my number of line is not same as yours possibly. and I use cout,so add these codes

include

using namespace std; at the front of app_tracking.cpp

ifdef SHOW_POSE_2D

    // Use example 2D pose drawer
    top_down_and_camera_canvas.create(PoseDrawer2D::imageSize,
                                           PoseDrawer2D::imageSize + img_w, CV_8UC3);
    top_down_view_canvas =
      top_down_and_camera_canvas(cv::Rect(0, 0, PoseDrawer2D::imageSize,
                                               PoseDrawer2D::imageSize));
    cout<< "------------SHOW_POSE_2D"<<endl;

else

    // Use tracker drawer
    // do not show trajectory history
    if (FLAGS_show_both) {
      top_down_and_camera_canvas.create(img_h, img_h + img_w * 2, CV_8UC3);
    } else {
      top_down_and_camera_canvas.create(img_h, img_h + img_w, CV_8UC3);
    }
    top_down_view_canvas =
      top_down_and_camera_canvas(cv::Rect(0, 0, img_h, img_h));
    // Trajectory view is an independent view
    // Clear canvas before plotting
    cout<<"---------------Use tracker drawer"<<endl;

endif

    // set to black
    // 为什么要黑色
    top_down_and_camera_canvas.setTo(cv::Vec3b(0, 0, 0));
    cv::putText(top_down_and_camera_canvas, "Waiting for initialization",
                cv::Point(15, 15), cv::FONT_HERSHEY_COMPLEX,
                0.5, cv::Scalar(255, 255, 255), 1);
    // Set camera_view_canvas as a sub-matrix of top_down_and_camera_canvas
    // 把天眼视角和相机画布整个图的一部分给相机画布set函数画图
    if (FLAGS_show_both) {
      camera_view_canvas =
        top_down_and_camera_canvas(cv::Rect(top_down_view_canvas.cols, 0,
                                                 img_w * 2, img_h));
    } else {
      camera_view_canvas =
        top_down_and_camera_canvas(cv::Rect(top_down_view_canvas.cols, 0,
                                                 img_w, img_h));
    }
    XP_TRACKER::set_top_view_canvas(&top_down_view_canvas, false);
    XP_TRACKER::set_camera_view_canvas(&camera_view_canvas);
    //
    cv::namedWindow("Top View & Left Camera");
    cv::moveWindow("Top View & Left Camera", 0, 0);
  }  // FLAGS_show_simple
  cv::imshow("Top View & Left Camera", top_down_and_camera_canvas);