Skip to content

A ROS BASED PATH PLANNING OBSTACTLE AVOIDANCE AND NAVIGATIONAL SYSTEM FOR VISUALLY IMPAIRED

Notifications You must be signed in to change notification settings

arhmAli/A.R.T.I.S.T

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link to lidar workspaces which contains slam algorithms

Setting Up Laptop to Send Data to the Microcontroller

Step 1: Create the boot.py File

Create the boot.py file in MicroPython, which essentially connects to the Wi-Fi network.

Step 2: Create the Server

Create the server in MicroPython, which will accept the data sent to it.

i) Define a Host and Port

Define the host and port for your server.

ii) Make a Socket Connection

Make a socket connection using:

socket.socket(socket.AF_INET, socket.SOCK_STREAM)

iii) Bind the Socket

Bind the socket to listen to the host and port.

iv) Listen for Connections

Listen for one connection at a time using:

server.listen(1)

v) Receive and Process Data

Make a loop in which you wait for a connection:


while True:
    client_socket, client_address = server.accept()
    data = client_socket.recv(1024)
    print(f"data: {data.decode('utf-8')}")
    client_socket.close()

ROS/Ubuntu Commands Guide

This guide provides an overview of some basic commands used in ROS/Ubuntu projects. Note that advanced procedures such as adding Gazebo or modifying launch files are not covered here. This guide aims to help you get started.

Adjusting Swap File Configuration

  1. sudo dphys-swapfile swapoff

    Purpose: Disable swapping temporarily.
    Description: Stops the swapping process, allowing for changes to the swap file configuration.

  2. sudo nano /etc/dphys-swapfile

    Purpose: Edit the swap file configuration.
    Description: Opens the swap file configuration file in the Nano text editor, allowing you to modify parameters such as swap size.

  3. Make changes to CONF_SWAPSIZE and press ctrl+x, y, enter

    Purpose: Adjust swap file size.
    Description: Modify the CONF_SWAPSIZE parameter to set the desired swap size, then save the changes and exit Nano.

  4. sudo dphys-swapfile setup

    Purpose: Apply the new swap file configuration.
    Description: Configures the system with the updated swap file settings.

  5. sudo dphys-swapfile swapon

    Purpose: Enable swapping with the new configuration.
    Description: Activates swapping using the modified swap file settings.

Setting Up ROS Workspace and RPLidar

  1. cd /home/ubuntu

    Purpose: Change directory to the home folder.
    Description: Navigates to the home directory to create a new catkin workspace.

  2. mkdir catkin_ws

    Purpose: Create a new catkin workspace.
    Description: Creates a directory named catkin_ws to serve as a workspace for ROS packages.

  3. catkin_init_workspace

    Purpose: Initialize the catkin workspace.
    Description: Initializes the newly created catkin_ws as a ROS catkin workspace.

  4. git clone [repo for rplidar]

    Purpose: Clone the repository for RPLidar.
    Description: Retrieves the RPLidar ROS package from the specified Git repository.

  5. catkin_make

    Purpose: Build the ROS packages.
    Description: Compiles the ROS packages in the catkin workspace.

  6. source devel/setup.bash

    Purpose: Source the workspace setup file.
    Description: Sets up the ROS environment for the current terminal session.

  7. sudo chmod 666 /dev/ttyUSB0

    Purpose: Change permissions for USB device.
    Description: Grants read and write permissions to /dev/ttyUSB0 to allow communication with the RPLidar sensor.

  8. killall -9 roscore

    Purpose: Terminate the running ROS core.
    Description: Stops the currently running ROS core.

  9. roscore

    Purpose: Start a new ROS core.
    Description: Initiates a new ROS core to serve as the communication backbone.

  10. roslaunch rplidar_ros rplidar.launch

    Purpose: Launch RPLidar ROS node.
    Description: Starts the RPLidar ROS node with the specified launch file.

  11. After running it, check for errors...

    Purpose: Diagnose common errors during RPLidar setup.
    Description: Inspects for errors such as "operation timed out" or "scan not started," usually caused by incorrect wiring. Recheck and reconnect if necessary.

Creating and Running a Custom ROS Package

  1. cd /home/ubuntu/custom_workspace

    Purpose: Change directory to a custom workspace.
    Description: Navigates to a custom workspace for creating a new ROS package.

  2. catkin_create_pkg custom_package rospy

    Purpose: Create a new ROS package.
    Description: Generates a new ROS package named custom_package with rospy as a dependency.

  3. cd scripts

    Purpose: Change directory to the scripts folder.
    Description: Navigates to the scripts folder within the newly created package.

  4. Create and edit Python scripts

    Purpose: Develop custom ROS nodes.
    Description: Creates Publisher.py and Subscriber.py scripts, adds code to them, and makes them executable using chmod +x.

  5. catkin_make

    Purpose: Build the ROS packages.
    Description: Compiles the ROS packages in the custom workspace.

  6. source devel/setup.bash

    Purpose: Source the workspace setup file.
    Description: Sets up the ROS environment for the current terminal session.

  7. rosrun custom_package Publisher.py

    Purpose: Run the custom Publisher node.
    Description: Executes the custom Python script that acts as a ROS Publisher node.

  8. rosrun custom_package Subscriber.py

    Purpose: Run the custom Subscriber node.
    Description: Executes the custom Python script that acts as a ROS Subscriber node.

Additional ROS Commands

  1. rostopic list

    Purpose: List active ROS topics.
    Description: Displays a list of currently active ROS topics.

  2. rostopic echo /scan or any other topic

    Purpose: Monitor topic messages.
    Description: Prints the messages published on the specified ROS topic (e.g., /scan).

Running SLAM Algorithms

  1. If doing Hector SLAM...

    Purpose: Run Hector SLAM after RPLidar setup.
    Commands:

    roslaunch hector_slam_ros tutorial.launch
    rostopic echo /map or /mapupdates
    Description: Initiates Hector SLAM launch file for mapping and visualization.

  2. If running Gmapping...

    Purpose: Run Gmapping algorithm.
    Commands:

    roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
    Description: Launches Gmapping SLAM algorithm for mapping using TurtleBot3. Change the model using export model=wafflepi or any other before running the algorithm or add your model here.

Saving a Map

  1. rosrun map_server map_saver -f ~/name

    Purpose: Save the generated map.
    Description: Utilizes the map_server tool to save the generated map with the specified filename (e.g., ~/name).

Running the Algorithm in Gazebo Environment

  1. Move to the directory artist_ws
  2. catkin_make
  3. source devel/setup.bash
  4. roslaunch astar_search algorithm_visualization.launch

After running, the results are given as:

a_star_big_path_sim.mp4

About

A ROS BASED PATH PLANNING OBSTACTLE AVOIDANCE AND NAVIGATIONAL SYSTEM FOR VISUALLY IMPAIRED

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages