Skip to content

Commit

Permalink
Merge run slam (ros2) (#99)
Browse files Browse the repository at this point in the history
* Add gulrak/filesystem

* Update run_slam and merge run_localization
  • Loading branch information
ymd-stella authored Aug 29, 2022
1 parent c535409 commit bda22b5
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 258 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
ROS_LOG_DIR: ${GITHUB_WORKSPACE}/.ros
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: build ros2 packages
run: |
mkdir -p /ros_ws/src
Expand All @@ -48,34 +50,34 @@ jobs:
run: |
(source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_footprint)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 run tf2_ros static_transform_publisher 0 0 -1.57 0 0 -1.57 base_footprint cam0)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && source /ros_ws/install/setup.bash && ros2 run stella_vslam_ros run_slam -v /datasets/orb_vocab/orb_vocab.fbow -c /ros_ws/src/stella_vslam/example/euroc/EuRoC_mono.yaml --map-db map_mono.msg --ros-args -r /camera/image_raw:=/cam0/image_raw)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && source /ros_ws/install/setup.bash && ros2 run stella_vslam_ros run_slam -v /datasets/orb_vocab/orb_vocab.fbow -c /ros_ws/src/stella_vslam/example/euroc/EuRoC_mono.yaml --map-db-out map_mono.msg --ros-args -r /camera/image_raw:=/cam0/image_raw)&
(source /opt/ros/${ROS1_DISTRO}/setup.bash && source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 bag play -s rosbag_v2 /datasets/EuRoC/MH_04_difficult.bag)
sleep 1
if ! pkill -0 run_slam; then exit 1; fi
echo "pkill -SIGINT -f run_slam"
pkill -SIGINT -f run_slam
while pkill -0 run_slam 2> /dev/null; do sleep 1; done
pkill -SIGINT -f static_transform_publisher
- name: run run_slam (stereo)
- name: run slam (stereo)
run: |
(source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_footprint)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 run tf2_ros static_transform_publisher 0 0 -1.57 0 0 -1.57 base_footprint cam0)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && source /ros_ws/install/setup.bash && ros2 run stella_vslam_ros run_slam -r -v /datasets/orb_vocab/orb_vocab.fbow -c /ros_ws/src/stella_vslam/example/euroc/EuRoC_stereo.yaml --map-db map_stereo.msg --ros-args -r /camera/left/image_raw:=/cam0/image_raw -r /camera/right/image_raw:=/cam1/image_raw)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && source /ros_ws/install/setup.bash && ros2 run stella_vslam_ros run_slam -r -v /datasets/orb_vocab/orb_vocab.fbow -c /ros_ws/src/stella_vslam/example/euroc/EuRoC_stereo.yaml --map-db-out map_stereo.msg --ros-args -r /camera/left/image_raw:=/cam0/image_raw -r /camera/right/image_raw:=/cam1/image_raw)&
(source /opt/ros/${ROS1_DISTRO}/setup.bash && source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 bag play -s rosbag_v2 /datasets/EuRoC/MH_04_difficult.bag)
sleep 1
if ! pkill -0 run_slam; then exit 1; fi
echo "pkill -SIGINT -f run_slam"
pkill -SIGINT -f run_slam
while pkill -0 run_slam 2> /dev/null; do sleep 1; done
pkill -SIGINT -f static_transform_publisher
- name: run run_localization
- name: run localization
run: |
(source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_footprint)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 run tf2_ros static_transform_publisher 0 0 0 -1.57 0 -1.57 base_footprint cam0)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && source /ros_ws/install/setup.bash && ros2 run stella_vslam_ros run_localization -v /datasets/orb_vocab/orb_vocab.fbow -c /ros_ws/src/stella_vslam/example/euroc/EuRoC_mono.yaml --map-db map_mono.msg --ros-args -r /camera/image_raw:=/cam0/image_raw)&
(source /opt/ros/${ROS2_DISTRO}/setup.bash && source /ros_ws/install/setup.bash && ros2 run stella_vslam_ros run_slam --disable-mapping -v /datasets/orb_vocab/orb_vocab.fbow -c /ros_ws/src/stella_vslam/example/euroc/EuRoC_mono.yaml --map-db-in map_mono.msg --ros-args -r /camera/image_raw:=/cam0/image_raw)&
sleep 5
(source /opt/ros/${ROS1_DISTRO}/setup.bash && source /opt/ros/${ROS2_DISTRO}/setup.bash && ros2 bag play -s rosbag_v2 /datasets/EuRoC/MH_04_difficult.bag)
pkill -SIGINT -f run_localization
pkill -SIGINT -f run_slam
pkill -SIGINT -f static_transform_publisher
rosdep:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "3rd/filesystem"]
path = 3rd/filesystem
url = https://github.com/gulrak/filesystem
1 change: 1 addition & 0 deletions 3rd/filesystem
Submodule filesystem added at cd6805
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ find_package(yaml-cpp REQUIRED)
set(spdlog_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rd/spdlog/include)
include_directories(${spdlog_INCLUDE_DIR})

# filesystem
set(filesystem_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rd/filesystem/include)
include_directories(${filesystem_INCLUDE_DIR})

# popl
set(popl_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rd/popl/include)
include_directories(${popl_INCLUDE_DIR})
Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(run_slam run_slam.cc stella_vslam_ros.cc)
list(APPEND EXECUTABLE_TARGETS run_slam)

add_executable(run_localization run_localization.cc stella_vslam_ros.cc)
list(APPEND EXECUTABLE_TARGETS run_localization)

foreach(EXECUTABLE_TARGET IN LISTS EXECUTABLE_TARGETS)
# pangolin_viewer is used on a priority basis
if(USE_PANGOLIN_VIEWER)
Expand Down
194 changes: 0 additions & 194 deletions src/run_localization.cc

This file was deleted.

Loading

0 comments on commit bda22b5

Please sign in to comment.