Autonomous Explorat...
 
Notifications
Clear all

Autonomous Exploration

2 Posts
1 Users
0 Reactions
92 Views
Posts: 5
Moderator
Topic starter
(@tanyap)
Member
Joined: 5 months ago

What the exploration node does:

Exploration is not part of Nav2. It is a goal generator:

- subscribes to /map (OccupancyGrid)

- finds frontiers (boundary between known free space and unknown space)

- picks a frontier goal pose

- calls Nav2's NavigateToPose (or waypoint follower) action so Nav2 drives the repeats until no frontiers remain

explorer never publishes /cmd_vel. Nav2 still owns motion.

 

Prereqs that must already work:

Before installing exploration, make sure:

  1. SLAM toolbox is publishing /map
  2. TF chain exists: map --> odom --> base_link --> laser
  3. Nav2 action server exists: navigate_to_pose

Check using:

  • ros2 topic echo /map --once

  • ros2 run tf2_ros tf2_echo map odom

  • ros2 action list | grep navigate_to_pose

 

Install:

1) Install dependencies (Jazzy):

sudo apt update

sudo apt install -y ros-jazzy-nav2-bringup ros-jazzy-slam-toolbox

2) Clone + build in your workspace

cd ~/ws_big_robot/src   # or whatever your colcon ws is

git clone https://github.com/robo-friends/m-explore-ros2.git

cd ~/ws_big_robot

rosdep update

rosdep install -i --from-path src --rosdistro jazzy -y

colcon build --symlink-install

source install/setup.bash

3) Confirm it installed

ros2 pkg list | grep explore

ros2 run explore_lite explore --help

4) How to run it manually (first test)

ros2 run explore_lite explore --ros-args --params-file \

  ~/ws_big_robot/src/m-explore-ros2/explore/config/params.yaml

It also supports stop/resume by publishing Bool to explore/resume.

 

Where to embed it in your system (your bringup XML):

You embed it in the same bringup launch after you start SLAM Toolbox + Nav2.

In your current bringup file, add this node near the bottom (after navigation include is fine):

<!-- Exploration node (frontier exploration) -->

<node pkg="explore_lite"

      exec="explore"

      name="explore"

      output="screen"

      args="--ros-args --params-file $(find-pkg-share big_robot_navigation)/params/explore.yaml">

  <param name="use_sim_time" value="$(var use_sim_time)"/>

 

  <!-- If you use namespaces, avoid absolute topics unless you really mean global -->

  <remap from="/tf" to="tf"/>

  <remap from="/tf_static" to="tf_static"/>

</node>

 

Important practical note (startup ordering):

explore_lite “starts right away” by default.
If it starts before Nav2 is fully active, it may fail goals.

Easy workaround: start it embedded, but immediately “pause” exploration and unpause after Nav2 is active:

# pause

ros2 topic pub /explore/resume std_msgs/msg/Bool "{data: false}" -1

 

# later, resume

ros2 topic pub /explore/resume std_msgs/msg/Bool "{data: true}" -1

 

Create params/explore.yaml (starter template):

Start simple; don’t over-tune until it moves.

# big_robot_navigation/params/explore.yaml

explore:

  ros__parameters:

    # Common knobs you’ll tune:

    # - how close is "goal reached"

    # - how long to wait before declaring stuck

    # - frontier size thresholds

    # These names vary slightly across explore implementations, so:

    # 1) start by copying the repo's explore/config/params.yaml

    # 2) move it here and edit

 

Best workflow:

  1. Copy the repo’s default params file into your package
  2. Edit locally
  3. Point the node at your copy

The repo explicitly shows where the default params live and how to run with them. 

 

Debugging when it “doesn’t move”

Most common causes:

  1. No /map (SLAM toolbox not running / wrong scan topic)
  2. TF broken (especially map→odom or odom→base_link)
  3. Nav2 not actually active (bt_navigator lifecycle not “active”)
  4. Topic mismatch (namespaces + you used /scan absolute in one place, relative in another)

Also: in RViz, add the frontiers marker if available:

  • m-explore-ros2 mentions a frontiers marker topic explore/frontiers.

1 Reply
Posts: 5
Moderator
Topic starter
(@tanyap)
Member
Joined: 5 months ago

If m-explore doesn't work, try installing nav2_wfd explore.

  • clone it
  • build it
  • run: ros2 run nav2_wfd explore

It computes frontier centroids from the OccupancyGrid and invokes Nav2 waypoint follower. 

Install

cd ~/ws_big_robot/src

git clone https://github.com/SeanReg/nav2_wavefront_frontier_exploration.git

cd ~/ws_big_robot

rosdep update

rosdep install -i --from-path src --rosdistro jazzy -y

colcon build --symlink-install

source install/setup.bash

Run

ros2 run nav2_wfd explore


Reply
Share:
Scroll to Top