Skip to content

kc-ml2/text_nav_bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 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 Humble
  • navigation2
  • rtabmap_ros
  • textmap (provides shared text_similarity.hpp)
  • yaml-cpp, tf2, rclcpp_action
sudo apt install ros-humble-navigation2 ros-humble-nav2-bringup ros-humble-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 (map) and landmarks.yaml (text landmarks).

1. Launch navigation stack

ros2 launch text_nav_bridge text_nav.launch.py landmark_file:=/path/to/landmarks.yaml

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

This launches:

  • Static TF (RealSense D435i)
  • IMU filter
  • RGBD odometry
  • RTAB-Map localization mode (uses existing rtabmap.db)
  • Nav2 navigation stack
  • text_nav_bridge node
  • 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. Compute a goal point approach_distance meters in front of the landmark
  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
landmark_file (required) Path to landmarks.yaml
use_sim_time true Use simulation time (true for rosbag)

Node Parameters

Parameter Default Description
landmark_file (required) Path to landmarks.yaml
match_threshold 0.5 Text similarity threshold (0~1)
approach_distance 1.5 Stop this many meters before the landmark
robot_frame camera_link Robot base frame
world_frame map World coordinate frame

Topics

Subscriptions

Topic Type Description
/text_nav/command std_msgs/String Text command to navigate to
/textmap/markers visualization_msgs/MarkerArray Landmark markers for visualization

Publications

Topic Type Description
/text_nav/status std_msgs/String Navigation status updates
/text_nav/goal_marker visualization_msgs/Marker Goal visualization in RViz

RViz Displays

The provided text_nav.rviz config includes:

Display Topic Description
Map /map 2D occupancy grid
TF Robot position
Global Plan /plan Path to goal
Local Plan /local_plan Obstacle-avoidance path
Local Costmap /local_costmap/costmap Cost map around robot
Nav Goal Marker /text_nav/goal_marker Goal arrow marker
Text Landmarks /textmap/markers Text landmark labels

License

Apache License 2.0

About

Text-command-driven robot navigation for ROS2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors