Giter Club home page Giter Club logo

haiderabasi / ros2-path-planning-and-maze-solving Goto Github PK

View Code? Open in Web Editor NEW
126.0 3.0 104.0 55.54 MB

Developing a maze solving robot in ROS2 that leverages information from a drone or Satellite's camera using OpenCV algorithms to find its path to the goal and solve the maze. :)

License: MIT License

Python 97.66% Dockerfile 1.10% Shell 1.24%
opencv python robotics ros astar-algorithm depth-first-search dijikstra-algorithm mapping mazesolving navigation path-planning

ros2-path-planning-and-maze-solving's Introduction

Maze Solving using Computer Vision In ROS2

alt text

Repository contents

Table of Contents
  1. 🤝Repository's About
  2. ⚡ Using this Repository
  3. ⛲Features
  4. 🧊Pre-Course Requirments
  5. 📗 Notes
  6. 👤Instructors
  7. 🌟Star History
  8. 💰Coupon
  9. 📝License

🤝Repository's About


This course is focus on Maze Solving behavior of robot In a Simulation based on ROS2. Computer Vision is the key focus with integrated important robotics algorithms of Motion Planning . The type of robot we will be using is Differential Drive Robot with a caster wheel . Course is structured with below main headings .

  • Custom Robot Creation
  • Gazebo and Rviz Integrations
  • Localization
  • Navigation
  • Path Planning

From our robot to last computer vision Node ,we will create every thing from scratch . Python Object Oriented programming practices will be utilized for better development.

⚡ Using this Repository


Docker:

alt text   alt text  

Ubuntu-20.04:

  • Follow along the Wiki guide to setup the project.

⛲ Features


  • Custom Robot Integeration

    • alt text

  • Drive to Goal Nodes

    • alt text

  • Custom World Setup

    • alt text

  • Mapping

    • alt text

  • Path Planning

    • alt text

  • Maze Solving

    • alt text

🧊 Pre-Course Requirments:


  • Ubuntu 20.04 (LTS)
  • ROS2 - Foxy Fitzroy
  • Python 3.6
  • Opencv 4.2

📗 Notes


You can access section wise notes here -> PDFs

  • Computer Vision -> PDFs

Star History


Star History Chart

💰 Coupon


✨ Enroll Now with Special Discount ✨ [Discounted Link]

👤 Instructors


Muhammad Luqman

Haider Abbasi

📝 License


Distributed under the GNU-GPL License. See LICENSE for more information.

ros2-path-planning-and-maze-solving's People

Contributors

haiderabasi avatar noshluk2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ros2-path-planning-and-maze-solving's Issues

Missing model.config for model built from Dockerfile

Prerequisites

  • [Y] Are you running the latest version (Repo)?
  • [Y] Did you follow the How_to_Run_the_project guide in Section 1 (Lec 1 & 2)?
  • [Y] Did you check Issues on Github for related queries?
  • [Y] Did you try restarting the PC and re-doing the steps in Section 1 (Lec 1 & 2)?
  • [Y] Is the problem persistent?

Description

[gazebo-1] [Err] [InsertModelWidget.cc:403] Missing model.config for model "/root/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/../ament_index"

Steps to Reproduce

  1. download the Dockerfile from https://github.com/HaiderAbasi/ROS2-Path-Planning-and-Maze-Solving/blob/master/docker/Dockerfile
  2. docker build -t mazeros . --no-cache
  3. docker run -it --name ros -e DISPLAY=host.docker.internal:0.0 -e LIBGL_ALWAYS_INDIRECT=0 --gpus 'all' mazeros:latest bash
  4. docker exec -it ros bash
  5. cd root/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/
  6. colcon build
  7. ros2 launch maze_bot maze_1_robot_camera.launch.py
    or
  8. ros2 run maze_bot maze_solver

Expected behavior: Without error and runs properly

Actual behavior: Errors happens

Screenshots
image

image

Environment (please complete the following information):

  • OS: Windows 11 with WSL2
  • Python-Version: Python 3.8.10
  • OpenCV-Version: 4.2.0

Hardware

  • Desktop/Laptop: Laptop
  • Make-Model (If Any): Asus
  • GPU: 3070

Additional context (Optional)
image

Project is not executing properly

It is giving error when I try to launch the robot is gazebo that is gazebo path errors
and when I try to spawn the maze from this repo then gazebo is not launching, and it is crashing

[Problem Executing the Project] (Ubuntu 22.04) Unable to launch maze_1_robot_camera.launch.py

Prerequisites

  • [y] Are you running the latest version (Repo)?
  • [y] Did you follow the How_to_Run_the_project guide in Section 1 (Lec 1 & 2)?
  • [y] Did you check Issues on Github for related queries?
  • [y] Did you try restarting the PC and re-doing the steps in Section 1 (Lec 1 & 2)?
  • [y] Is the problem persistent?

Description

Following the steps on 4. Guide 1 Base setup
When I try ros2 launch maze_bot maze_1_robot_camera.launch.py
I get the error

[gazebo-1] [ERROR] [1659383314.723800169] [gazebo_ros_node]: Found multiple nodes with same name: /camera_controller. This might be due to multiple plugins using the same name. Try changing one of the the plugin names or use a different ROS namespace. This error might also result from a custom plugin inheriting from another gazebo_ros plugin and the custom plugin trying to access the ROS node object hence creating multiple nodes with same name. To solve this try providing the optional node_name argument in gazebo_ros::Node::Get() function.

[ERROR] [gazebo-1]: process has died [pid 24592, exit code 255, cmd 'gazebo --verbose /home/scott/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/worlds/maze_1.world -s libgazebo_ros_factory.so'].

[gazebo-1]

and the program stops responding

When trying with ros2 launch maze_bot maze_2_robot_camera.launch.py the program runs ok

Steps to Reproduce

  1. Fresh install of ubuntu 22.04
  2. installed ros humble and followed setup as per course guide
  3. cloned git hub repository and followed steps in guid up to this point with no issues

Expected behavior:
Gazebo will launch with the maze loades

Actual behavior:
Program throws above error then stops

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Ubuntu
  • OS-Version 22.04 LTS
  • Python-Version 3.10.4
  • OpenCV-Version4.5

Hardware

  • Desktop/Laptop Desktop
    • Make-Model (If Any) ASUSTek ROG Maximus Hero XI with Intel i7-9700K CPU, 32GB RAM
  • GPU Nvidia GTX 1060
  • Ubuntu OS running as VM in Oracle Box 6.1
  • the vm has been setup with 4 CPU cores, 8GB Ram and 50GB Hdd

Additional context
Add any other context about the problem here.

[Problem Executing the Project] (OS) One liner description of the issue.

Prerequisites

  • Are you running the latest version (Repo)?
  • Did you follow the How_to_Run_the_project guide in Section 1 (Lec 1 & 2)?
  • Did you check Issues on Github for related queries?
  • Did you try restarting the PC and re-doing the steps in Section 1 (Lec 1 & 2)?
  • Is the problem persistent?

Description

Unable to run the project(lecture 2)

Steps to Reproduce

  1. ros2 launch maze_bot maze_2_robot_camera.launch.py
  2. ros2 run maze_bot maze_solver
  3. [and so on...]

Expected behavior: Wanted to run complete project as stated in Lecture 2

Actual behavior: Getting error, there is no sat_view or robot movement

Screenshots
Screenshot from 2022-11-03 07-59-10

Environment (please complete the following information):

  • OS: ubuntu (using in VM)
  • OS-Version 20.04 LTS
  • Python-Version [e.g. 3.6] - compatable with the code
  • OpenCV-Version [e.g. 4.2]

Hardware

  • Laptop
    • Make-Model (If Any) [e.g. MSI - GF65]
  • GPU [e.g. Nvidia RTX 3060]

Additional context (Optional)
Add any other context about the problem here.

[Problem Executing the Project] (OS) Missing model.config in gazebo launch

Prerequisites

  • Are you running the latest version (Repo)?
  • Did you follow the How_to_Run_the_project guide in Section 1 (Lec 1 & 2)? (Unfortunately I do not have access to the course)
  • Did you check Issues on Github for related queries?
  • Did you try restarting the PC and re-doing the steps in Section 1 (Lec 1 & 2)?
  • Is the problem persistent?

Description

Hi, there seem to be some errors in Gazebo while I am trying to run this repo for the first time.

[INFO] [launch]: All log files can be found below /root/.ros/log/2024-03-13-08-56-23-685178-05562f0f464a-916
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gazebo-1]: process started with pid [918]
[INFO] [robot_state_publisher-2]: process started with pid [920]
[robot_state_publisher-2] [WARN] [1710320183.869148633] [robot_state_publisher]: No robot_description parameter, but command-line argument available. Assuming argument is name of URDF file. This backwards compatibility fallback will be removed in the future.
[robot_state_publisher-2] Parsing robot urdf xml string.
[robot_state_publisher-2] Link base had 4 children
[robot_state_publisher-2] Link camera_link had 0 children
[robot_state_publisher-2] Link caster had 0 children
[robot_state_publisher-2] Link wheel_left had 0 children
[robot_state_publisher-2] Link wheel_right had 0 children
[robot_state_publisher-2] [INFO] [1710320183.872277743] [robot_state_publisher]: got segment base
[robot_state_publisher-2] [INFO] [1710320183.872304090] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-2] [INFO] [1710320183.872306779] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-2] [INFO] [1710320183.872309343] [robot_state_publisher]: got segment caster
[robot_state_publisher-2] [INFO] [1710320183.872311965] [robot_state_publisher]: got segment wheel_left
[robot_state_publisher-2] [INFO] [1710320183.872314118] [robot_state_publisher]: got segment wheel_right
[gazebo-1] Gazebo multi-robot simulator, version 11.11.0
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1]
[gazebo-1] Gazebo multi-robot simulator, version 11.11.0
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1]
[gazebo-1] [INFO] [1710320184.541168474] [gazebo_ros_node]: ROS was initialized without arguments.
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 172.17.0.2
[gazebo-1] [Msg] Loading world file [/root/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/worlds/maze_1.world]
[gazebo-1] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 172.17.0.2
[gazebo-1] [Wrn] [GuiIface.cc:120] QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[gazebo-1] [Err] [InsertModelWidget.cc:403] Missing model.config for model "/root/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/../ament_index"
[gazebo-1] [Err] [InsertModelWidget.cc:403] Missing model.config for model "/root/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/../colcon-core"
[gazebo-1] [Err] [InsertModelWidget.cc:403] Missing model.config for model "/root/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/../maze_bot"
[gazebo-1] [INFO] [1710320185.595063406] [camera_controller]: Publishing camera info to [/Botcamera/camera_info]
[gazebo-1] [WARN] [1710320185.599270546] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[gazebo-1] [INFO] [1710320185.602863510] [camera_controller]: Publishing camera info to [/upper_camera/camera_info]
[gazebo-1] [INFO] [1710320185.620585003] [gazebo_base_controller]: Wheel pair 1 separation set to [0.800000m]
[gazebo-1] [INFO] [1710320185.620685967] [gazebo_base_controller]: Wheel pair 1 diameter set to [0.300000m]
[gazebo-1] [INFO] [1710320185.621490378] [gazebo_base_controller]: Subscribed to [/cmd_vel]
[gazebo-1] [INFO] [1710320185.622351340] [gazebo_base_controller]: Advertise odometry on [/odom]
[gazebo-1] [INFO] [1710320185.623260832] [gazebo_base_controller]: Publishing odom transforms between [odom] and [base_footprint]
[INFO] [gazebo-1]: process has finished cleanly [pid 918]
[gazebo-1]
[gazebo-1]

Steps to Reproduce

  1. Followed run_docker_Win10.MD
  2. ran docker run -it --name r2_pathplanning_container -e DISPLAY=host.docker.internal:0.0 -e LIBGL_ALWAYS_INDIRECT=0 --runtime=nvidia haiderabbasi333/ros2-pathplanning-course:1 bash
  3. ran ros2 launch maze_bot maze_1_robot_camera.launch.py

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • OS: Ubuntu docker in WSL2

Hardware

  • Laptop [e.g. Laptop]
  • Make-Model: HP Omen
  • GPU - Nvidia RTX 4070

Additional context (Optional)
Add any other context about the problem here.

[Problem Executing the Project] (Ubuntu 20.04) The extracting bg problem in "bot_localization.py".

Prerequisites

  • [ y ] Are you running the latest version (Repo)?
  • [ y ] Did you follow the How_to_Run_the_project guide in Section 1 (Lec 1 & 2)?
  • [ y ] Did you check Issues on Github for related queries?
  • [ y ] Did you try restarting the PC and re-doing the steps in Section 1 (Lec 1 & 2)?
  • [ y ] Is the problem persistent?

Description

Hi !
I'm in the step of localization (bot_localization.py).
I create a simple world (4 walls only) and try to extract the backgroung model ,but comes with this error.

The camera is working but the variable "min_cntr_idx" is -1, seems that the function "ret_smallest_obj" does not work...
How can I deal with this error?
Should I move the camera or modify the functions in utilities.py?
Thank you for help!
Screenshot from 2022-08-18 16-25-39
Screenshot from 2022-08-18 16-25-45

Steps to Reproduce

  1. Launch the word(maze)
  2. Run "maze_solver.py"

Expected behavior:
The frame "frame_car_remvd" should be showed.

Actual behavior:
Comes in error:
UnboundLocalError: local variable 'frame_car_remvd' referenced before assignment

Screenshots
Screenshot from 2022-08-18 15-59-59

Environment (please complete the following information):

  • OS: Ubuntu
  • OS-Version: 20.04 LTS
  • Python-Version: 3.8.10
  • OpenCV-Version: 4.2.0

Hardware

  • Desktop
  • CPU: AMD Ryzen 5 5600X
  • GPU: Nvidia RTX 3060
  • RAM: 16G

[Problem Executing the Project] (OS) One liner description of the issue.

Screenshot from 2023-11-09 10-24-30

Prerequisites

  • [y ] Are you running the latest version (Repo)?
  • [y ] Did you follow the How_to_Run_the_project guide in Section 1 (Lec 1 & 2)?
  • [y] Did you check Issues on Github for related queries?
  • [y ] Did you try restarting the PC and re-doing the steps in Section 1 (Lec 1 & 2)?
  • [y ] Is the problem persistent?

Description

I follow the video instructions and setup everything according to it. I could not run maze_2_robot_camera.launch.py from beginning from lecture 1, part 4. Run Complete Project without docker.

Steps to Reproduce

  1. colcon build
    getting just this: Starting >>> maze_bot
    Finished <<< maze_bot [4.31s]

Summary: 1 package finished [10.7s]

  1. source install/setup.bash
    3.ros2 launch maze_bot maze_2_robot_camera.launch.py

Expected behavior:
I expect to get reaction as what happened in the video. After running 'ros2 launch maze_bot maze_2_robot_camera.launch.py', Gazebo should have opened.

Actual behavior:
I am getting this information/messages:
[INFO] [launch]: All log files can be found below /home/merve/.ros/log/2023-11-09-02-03-08-924152-merve-Katana-GF76-11UC-22445
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=InvalidLaunchFileError('py')>
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 53, in get_launch_description_from_any_launch_file
return loader(launch_file_path)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 62, in get_launch_description_from_python_launch_file
launch_file_module = load_python_launch_file_as_module(python_launch_file_path)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 37, in load_python_launch_file_as_module
loader.exec_module(mod)
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/merve/Masaüstü/ROS2-Path-Planning-and-Maze-Solving/path_planning_ws/install/maze_bot/share/maze_bot/launch/maze_2_robot_camera.launch.py", line 6, in
from scripts import GazeboRosPaths
ImportError: cannot import name 'GazeboRosPaths' from 'scripts' (/home/merve/.local/lib/python3.8/site-packages/scripts/init.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 130, in execute
launch_description = self.__launch_description_source.get_launch_description(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
self._get_launch_description(self.__expanded_location)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
return get_launch_description_from_any_launch_file(location)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 56, in get_launch_description_from_any_launch_file
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: cannot import name 'GazeboRosPaths' from 'scripts' (/home/merve/.local/lib/python3.8/site-packages/scripts/init.py)

Screenshots
If applicable, add screenshots to help explain your problem.

Screenshot from 2023-11-09 02-24-39

Environment (please complete the following information):

  • Ubuntu 20.04 LTS]
  • Python 3.8.10
  • OpenCV-Version 4.8.1

Hardware

  • Laptop
  • Make-Model (If Any) [ MSI - GF76]
  • GPU [e.g. Nvidia RTX 3050 Ti]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.