Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any method that I can visualize the ORB SLAM results? #48

Open
ysyyork opened this issue Jun 23, 2024 · 4 comments
Open

Any method that I can visualize the ORB SLAM results? #48

ysyyork opened this issue Jun 23, 2024 · 4 comments

Comments

@ysyyork
Copy link

ysyyork commented Jun 23, 2024

This would be very helpful and more straightforward than pure CSV and other text file formats.

@AlphaGotReal
Copy link

AlphaGotReal commented Jun 26, 2024

You can probably visualise by passing in enable_gui=true in the ORB_SLAM3 package

bool enable_gui = false;
  app.add_flag("-g,--enable_gui", enable_gui);
.
.
.
.
cv::Ptr<cv::aruco::Dictionary> aruco_dict = cv::aruco::getPredefinedDictionary(aruco_dict_id);
  ORB_SLAM3::System SLAM(
    vocabulary, setting, 
    ORB_SLAM3::System::IMU_MONOCULAR, 
    enable_gui, load_map, save_map, // make enable gui ---> true
    aruco_dict, init_tag_id, init_tag_size
  );

passing that here(03_batch_slam.py) as --enable-gui true should launch the built-in gui tool by ORB SLAM3

cmd = [
      'docker',
      'run',
      '--rm', # delete after finish
      '--volume', str(video_dir) + ':' + '/data',
      '--volume', str(map_mount_source.parent) + ':' + str(map_mount_target.parent),
      docker_image,
      '/ORB_SLAM3/Examples/Monocular-Inertial/gopro_slam',
      '--vocabulary', '/ORB_SLAM3/Vocabulary/ORBvoc.txt',
      '--setting', '/ORB_SLAM3/Examples/Monocular-Inertial/gopro10_maxlens_fisheye_setting_v1_720.yaml',
      '--input_video', str(video_path),
      '--input_imu_json', str(json_path),
      '--output_trajectory_csv', str(csv_path),
      '--load_map', str(map_mount_target),
      '--mask_img', str(mask_path),
      '--max_lost_frames', str(max_lost_frames),
      '--enable-gui', 'true' # or make it a user argument in some config file or command itself
]

but before that you also need to enable gui in docker by running the xhost + or xhost +docker command in the particular terminal window

@cynthia-you
Copy link

You can probably visualise by passing in enable_gui=true in the ORB_SLAM3 package

bool enable_gui = false;
  app.add_flag("-g,--enable_gui", enable_gui);
.
.
.
.
cv::Ptr<cv::aruco::Dictionary> aruco_dict = cv::aruco::getPredefinedDictionary(aruco_dict_id);
  ORB_SLAM3::System SLAM(
    vocabulary, setting, 
    ORB_SLAM3::System::IMU_MONOCULAR, 
    enable_gui, load_map, save_map, // make enable gui ---> true
    aruco_dict, init_tag_id, init_tag_size
  );

passing that here(03_batch_slam.py) as --enable-gui true should launch the built-in gui tool by ORB SLAM3

cmd = [
      'docker',
      'run',
      '--rm', # delete after finish
      '--volume', str(video_dir) + ':' + '/data',
      '--volume', str(map_mount_source.parent) + ':' + str(map_mount_target.parent),
      docker_image,
      '/ORB_SLAM3/Examples/Monocular-Inertial/gopro_slam',
      '--vocabulary', '/ORB_SLAM3/Vocabulary/ORBvoc.txt',
      '--setting', '/ORB_SLAM3/Examples/Monocular-Inertial/gopro10_maxlens_fisheye_setting_v1_720.yaml',
      '--input_video', str(video_path),
      '--input_imu_json', str(json_path),
      '--output_trajectory_csv', str(csv_path),
      '--load_map', str(map_mount_target),
      '--mask_img', str(mask_path),
      '--max_lost_frames', str(max_lost_frames),
      '--enable-gui', 'true' # or make it a user argument in some config file or command itself
]

but before that you also need to enable gui in docker by running the xhost + or xhost +docker command in the particular terminal window

Hello, could you specific the path of :
"bool enable_gui = false;
app.add_flag("-g,--enable_gui", enable_gui);
.
.
.
.
cv::Ptrcv::aruco::Dictionary aruco_dict = cv::aruco::getPredefinedDictionary(aruco_dict_id);
ORB_SLAM3::System SLAM(
vocabulary, setting,
ORB_SLAM3::System::IMU_MONOCULAR,
enable_gui, load_map, save_map, // make enable gui ---> true
aruco_dict, init_tag_id, init_tag_size
);"

thanks~

@AlphaGotReal
Copy link

The parameter variable actually exists inside the docker container running ORBSLAM3, visit https://github.com/cheng-chi/ORB_SLAM3/blob/master/Examples/Monocular-Inertial/gopro_slam.cc, where you'll find the argument, for the changes to take action you'll have to build the package again inside the docker container.
However you can control the param within the python script in scripts_slam_pipeline/03_batch_slam.py where you append the argument

'--enable-gui', 'true' # or make it a user argument in some config file or command itself

at line number 124 in the cmd list.
This should run the GUI, but before this you'll have to run the xhost +docker command in the particular terminal window so as to give permission for the docker container to run apps that include GUI.

@fighting-j
Copy link

I followed the above method and added '--enable-gui', 'true' to scripts_slam_pipeline/03_batch_slam.py, but the following problem occurred:
截图 2024-10-29 10-53-21
How can I solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants