Skip to content

This package provides functionality for teaching and repeating (Teach and Repeat) navigation paths using ROS 2.

Notifications You must be signed in to change notification settings

jardeldyonisio/teach_and_repeat

Repository files navigation

Teach and Repeat using Bézier Curves

This repository implements a Teach and Repeat (T&R) navigation system for mobile robots, allowing them to autonomously follow previously demonstrated paths.

Dependencies

  • ROS 2 Humble;
  • Ubuntu 22.04;
  • Colcon Common Extensions;
  • Turtlebot3 simulation;

Methods

There are two methods to follow the demonstrated path:

  • Dot-to-dot (nodes/repeat_path_coords.py): The robot follows a Pure Pursuit-like approach where it intercepts a look-ahead point. Once it reaches this point, a new point further along the path is set as the next target.
  • Bezier curve based (nodes/repeat_bezier_path.py): The robot simulates multiple potential paths ahead using Bézier curves and selects the optimal path based on predefined criteria.

Installation

To set up the Teach and Repeat system, follow these steps:

Clone this repository along with its submodules:

git clone --recurse-submodules https://github.com/jardeldyonisio/teach_and_repeat.git

Make the installation script executable and run it with superuser privileges:

chmod +x install.sh
sudo ./install.sh

Initialize rosdep in your workspace:

rosdep init

Update rosdep to fetch the latest package information:

rosdep update

Install the required ROS package dependencies:

rosdep install --from-paths src -y --ignore-src

Run

After setting up the environment, follow these steps to run the system:

Demonstrate Path

To demonstrate a path, follow these steps:

Launch the navigation system:

ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

You must use 'Pose2DEstimation' to define the initial position.

Open another terminal and start the teleoperation node:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

Control the robot using the following keys:

  • I to move forward
  • K to move backward
  • J to turn left
  • L to turn right
  • Q to increase speed
  • Z to decrease speed
  • Space to stop

Start the path demonstration:

ros2 launch lognav_navigation teach_path_coords

To end the demonstration the user have to press CTRL + C.

Follow Path

To follow a path, first ensure that the coordinates from the path demonstration are stored in the teach_and_repeat/data/teleop_data.txt file. This file is also the default file read during the path following process. Make sure you start from the same point where the demonstration began.

If the navigation system is not already running, launch it:

ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

Then, run the path following node:

ros2 run teach_and_repeat repeat_bezier_path

After starting the repeat node, set a pose using '2DPoseEstimate'. The robot will immediately begin following the path.

Demo Videos

Check out the teach and repeat system in action:

Contributing

Feel free to open issues or submit pull requests to improve this project.

Publication

For more details, refer to our publication Teach and Repeat for Path Planning Using Bézier Curves.

@INPROCEEDINGS{Dyonisio2024,
  author={J. Dos Santos Dyonisio and others},
  title={Teach and Repeat for Path Planning Using Bézier Curves},
  booktitle={2024 Brazilian Symposium on Robotics (SBR) and 2024 Workshop on Robotics in Education (WRE)},
  year={2024},
  pages={79-84},
  doi={10.1109/SBR/WRE63066.2024.10837801}
}

TODO

  • Create a .yaml file to configure:
    • The robot model;
    • Future behavior parameters.
  • Use multiple Bézier curves (e.g., B-splines) to represent the path.
  • Update the teach node to:
    • Accept a string input to name the path;
    • Require a key press to start collecting poses.
  • Display poses during the teaching process.
  • Show the circular threshold around the closest Bézier reference point.
  • Automatically calculate start_num_knots based on the path.

About

This package provides functionality for teaching and repeating (Teach and Repeat) navigation paths using ROS 2.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published