Exploring and Mapping Unknown Areas with a Clearpath Jackal in Gazebo

Talha Ejaz
3 min readDec 18, 2022

--

If you want to autonomously navigate a ground robot in an unknown environment, you need to first acquire a map of the environment while keeping track of the robot’s location. Simultaneous localization and mapping, also known as SLAM, helps you to generate the map while simultaneously localizing the robot’s pose relative to the map without the need of GPS.

Clearpath Jackal in Simulated Environment (Gazbo 9) using ROS Melodic

ROS:

ROS (Robot Operating System) is an open-source software framework for developing autonomous vehicles. It provides a set of tools and libraries for building and running autonomous vehicle applications, such as navigation, perception, and control. It enables developers to quickly create and deploy autonomous vehicle applications. It also provides a platform for integrating different components of an autonomous vehicle system, such as sensors, actuators, and controllers..

Frontier-Based Exploration:

Frontier based approach is used for exploration in an unknown environment based on the concept of the frontier. It creates the boundary region between open and unexplored space. Jackal robots moving into a new frontier extend their new place until the entire place has been explored.It the process of exploring and mapping unknown or uncharted areas. It is often used to discover new resources, expand a region’s knowledge, or find new trade routes.

Slam Gmapping:

SLAM Gmapping is a ROS package that implements SLAM (Simultaneous Localization and Mapping) using a grid-based FastSLAM algorithm. It can be used to create a 2D occupancy grid map from laser and pose data collected by a mobile robot. It uses the data to update a particle filter and estimate the robot’s pose. Finally, it outputs the estimated map and pose of the robot.

After successfully clone these repository from mechwiz & clearpath jackal.

Run these command in separate terminal.

roslaunch jackal_exploration jackal_world.launch #launch environment in gazebo
roslaunch jackal_exploration jackal_setup.launch # launch gmapping,laser scan,twist multiplexer
roslaunch jackal_exploration view_robot.launch #Open in Rviz
roslaunch jackal_exploration jackal_exploration.launch #Run explore.py file

Navigation Stack:

The navigation stack uses the SLAM Gmapping data to create a costmap, which is used to plan a path for the robot to follow. The navigation stack also uses the SLAM Gmapping data to localize the robot within the map. It then uses the costmap to generate a path for the robot to follow. Finally, it sends velocity commands to the robot to follow the generated path.

Run this command for saving the map once it complete.

rosrun map_server map_saver -f jackal_world #save the map once it completed

Adaptive Monte Carlo Localization:

AMCL is a ROS package that implements a probabilistic localization system for a robot moving in 2D. It uses a particle filter to track the robot’s pose in a known map. It takes in sensor data from the robot and uses it to update the particle filter and estimate the robot’s pose. It also uses the map data to calculate the likelihood of the robot’s pose. Finally, it outputs the estimated pose of the robot.

roslaunch jackal_gazebo jackal_world.launch config:=front_laser #launch jackal in environment with lidar                                                 
roslaunch jackal_navigation amcl_demo.launch map_file:=/home/talha/jackal_world.yaml #import map which previously built and run amcl
roslaunch jackal_viz view_robot.launch config:=localization #open Rviz

For tutorial check this youtube video.

Reference:

http://www.clearpathrobotics.com/assets/guides/noetic/ros/ROS%20Navigation%20Basics.html

https://github.com/mechwiz/jackal_exploration

--

--

Talha Ejaz

Robotics Researcher (Machine Learning, Computer Vision, Autonomous Navigation, Big Data) , Traveler, Nature, Potrait