From ab2417999038a24186bb4ce52c72410626f455c4 Mon Sep 17 00:00:00 2001 From: mithunvarma Date: Tue, 16 Jul 2019 14:51:43 -0400 Subject: [PATCH 1/3] will make frameViewer to 640,480 fixed size window, ROS Mono exmaple will take image topic as argument --- .gitignore | 1 + Examples/ROS/ORB_SLAM2/src/ros_mono.cc | 4 ++-- src/FrameDrawer.cc | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 611b5adb2c..3a5404eeab 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Examples/Monocular/mono_tum Examples/RGB-D/rgbd_tum Examples/ROS/ORB_SLAM2/CMakeLists.txt.user Examples/ROS/ORB_SLAM2/Mono +Examples/ROS/ORB_SLAM2/flir.yaml Examples/ROS/ORB_SLAM2/MonoAR Examples/ROS/ORB_SLAM2/RGBD Examples/ROS/ORB_SLAM2/Stereo diff --git a/Examples/ROS/ORB_SLAM2/src/ros_mono.cc b/Examples/ROS/ORB_SLAM2/src/ros_mono.cc index 2913525bfc..597837aeac 100644 --- a/Examples/ROS/ORB_SLAM2/src/ros_mono.cc +++ b/Examples/ROS/ORB_SLAM2/src/ros_mono.cc @@ -48,7 +48,7 @@ int main(int argc, char **argv) ros::init(argc, argv, "Mono"); ros::start(); - if(argc != 3) + if(argc != 4) { cerr << endl << "Usage: rosrun ORB_SLAM2 Mono path_to_vocabulary path_to_settings" << endl; ros::shutdown(); @@ -61,7 +61,7 @@ int main(int argc, char **argv) ImageGrabber igb(&SLAM); ros::NodeHandle nodeHandler; - ros::Subscriber sub = nodeHandler.subscribe("/camera/image_raw", 1, &ImageGrabber::GrabImage,&igb); + ros::Subscriber sub = nodeHandler.subscribe(argv[3], 1, &ImageGrabber::GrabImage,&igb); ros::spin(); diff --git a/src/FrameDrawer.cc b/src/FrameDrawer.cc index e23b86c207..7a3e0dcc2a 100644 --- a/src/FrameDrawer.cc +++ b/src/FrameDrawer.cc @@ -121,8 +121,9 @@ cv::Mat FrameDrawer::DrawFrame() cv::Mat imWithInfo; DrawTextInfo(im,state, imWithInfo); - - return imWithInfo; + cv::Mat imWithInfoResized = cv::Mat(480,640,CV_8UC3, cv::Scalar(0,0,0)); + cv::resize(imWithInfo, imWithInfoResized, imWithInfoResized.size(), 0, 0, CV_INTER_AREA); + return imWithInfoResized; } From 8e71bee9c3235388b44df5113873f8b9fafc4fc3 Mon Sep 17 00:00:00 2001 From: mithunvarma Date: Tue, 16 Jul 2019 14:54:12 -0400 Subject: [PATCH 2/3] will update ReadMe for ROS MONO version, passing image_topic as argument --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acf42ee7e0..0276298e8d 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ This will create **libORB_SLAM2.so** at *lib* folder and the executables **mono For a monocular input from topic `/camera/image_raw` run node ORB_SLAM2/Mono. You will need to provide the vocabulary file and a settings file. See the monocular examples above. ``` - rosrun ORB_SLAM2 Mono PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE + rosrun ORB_SLAM2 Mono PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE NAME_OF_IMAGE_TOPIC ``` ### Running Monocular Augmented Reality Demo From 7129c7194ff9198b0def5e1af30d616f25e322aa Mon Sep 17 00:00:00 2001 From: mithun Date: Sun, 2 Feb 2020 22:24:58 -0500 Subject: [PATCH 3/3] add boost libs to ros example cmakelists to avoid build error --- Examples/ROS/ORB_SLAM2/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Examples/ROS/ORB_SLAM2/CMakeLists.txt b/Examples/ROS/ORB_SLAM2/CMakeLists.txt index 7cbf71c199..cca29b4182 100644 --- a/Examples/ROS/ORB_SLAM2/CMakeLists.txt +++ b/Examples/ROS/ORB_SLAM2/CMakeLists.txt @@ -40,6 +40,7 @@ endif() find_package(Eigen3 3.1.0 REQUIRED) find_package(Pangolin REQUIRED) +find_package(Boost COMPONENTS system filesystem REQUIRED) include_directories( ${PROJECT_SOURCE_DIR} @@ -52,6 +53,8 @@ set(LIBS ${OpenCV_LIBS} ${EIGEN3_LIBS} ${Pangolin_LIBRARIES} +${Boost_SYSTEM_LIBRARY} +${Boost_FILESYSTEM_LIBRARY} ${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so ${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so ${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so