Skip to content

kc-ml2/text_nav_bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text_nav_bridge

Text-command-driven robot navigation for ROS 2. Reads text landmarks generated by TextMap (Phase 1) and converts user text commands into Nav2 NavigateToPose actions.

Dependencies

  • ROS 2 (tested on Humble; source compiles on Iron/Jazzy/Kilted/Rolling)
  • navigation2
  • rtabmap_ros
  • textmap (provides shared text_similarity.hpp)
  • yaml-cpp, tf2, rclcpp_action
sudo apt install ros-${ROS_DISTRO}-navigation2 ros-${ROS_DISTRO}-nav2-bringup ros-${ROS_DISTRO}-rtabmap-ros

Build

cd ~/ros2_ws
colcon build --packages-select text_nav_bridge
source install/setup.bash

Usage (Phase 2: Navigation)

Requires Phase 1 outputs: rtabmap_db/<bag_name>.db (map) and landmarks/<bag_name>.yaml (text landmarks).

1. Launch navigation stack

ros2 launch text_nav_bridge text_nav.launch.py bag_name:=rosbag2_2026_01_08-15_03_00

A single bag_name argument resolves both the landmark file and rtabmap DB:

  • src/text_nav_bridge/landmarks/<bag_name>.yaml
  • src/text_nav_bridge/rtabmap_db/<bag_name>.db

2. Play rosbag or run real camera

# Rosbag
ros2 bag play <your_bagfile> --clock

# Or real camera
ros2 launch rtabmap_ros realsense_infra_for_record.launch.py

Spawns RTAB-Map localization (loading the bag's .db) + Nav2 + text_nav_bridge + RViz.

3. Send a text command

ros2 topic pub --once /text_nav/command std_msgs/msg/String "data: 'restroom'"

The node will:

  1. Find the best matching landmark from landmarks.yaml
  2. Ray-march along the robot-to-landmark line on the Nav2 /map costmap and pick the last free cell as the navigation goal
  3. Send a NavigateToPose goal to Nav2

4. Monitor status

ros2 topic echo /text_nav/status
data: "NAVIGATING: heading to 'restroom'"
data: "NAVIGATING: distance_remaining=2.31m"
data: "SUCCESS: Navigation completed"

Launch Arguments

Argument Default Description
bag_name (required) Rosbag name (e.g. rosbag2_2026_01_08-15_03_00)
use_sim_time true Use simulation time (true for rosbag)
data_dir resolved from install share Directory containing landmarks/ and rtabmap_db/
match_threshold 0.5 Text similarity threshold (0~1)
robot_frame camera_link Robot base frame id
world_frame map World/map frame id
static_tfs_file <pkg>/config/realsense_d455_tfs.yaml YAML of static TFs to inject (see realsense_d455_tfs.yaml for the schema). Pass '' when /tf_static is already provided by the bag or camera driver.

Topics

Subscriptions

Topic Type Description
/text_nav/command std_msgs/String Text command to navigate to
/map nav_msgs/OccupancyGrid Costmap used for ray-march goal selection (transient_local)

Publications

Topic Type Description
/text_nav/status std_msgs/String Navigation status updates
/text_nav/goal_marker visualization_msgs/Marker Goal visualization in RViz
/textmap/markers visualization_msgs/MarkerArray Loaded landmarks republished for RViz (1 Hz)

RViz config: rviz/text_nav.rviz.

License

Apache License 2.0

About

Text-command-driven robot navigation for ROS2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors