real-stanford / universal_manipulation_interface

Universal Manipulation Interface: In-The-Wild Robot Teaching Without In-The-Wild Robots
https://umi-gripper.github.io/
MIT License
683 stars 131 forks source link

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

Open ysyyork opened 4 months ago

ysyyork commented 4 months ago

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

AlphaGotReal commented 4 months ago

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 commented 1 month ago

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::Ptr 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 commented 1 month ago

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 commented 2 weeks ago

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

nazir-hk commented 1 week ago

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

Hi, were you able to resolve this?