Skip to content

cybernetic-m/LIDARino_robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

208 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIDARino

This is the official repository of the Robot Programming subject in Artificial Intelligence and Robotics course at Sapienza University of Rome

Description

Description

FULL VIDEO HERE: https://drive.google.com/file/d/1uY1311wZvZpM1vVac2CnY4hhfMcjk1Bl/view?usp=drive_link

Description

Project Structure

firmware
├── encoderWheel.cpp => Functions to read data from encoders
├── firmlib.h => header file for the whole firmware library 
├── firmware.ino => sketch that puts all the firmware together and that gets uploaded to the Arduino
├── Motors.cpp => Implementation of the class motors to control both motors
├── Motors.h => header file for the class motors to control both motors
├── ultrasound.cpp => Functions to request and read data from the ultrasound sensor
├── velocitiesCallback.cpp => Function that gets called when a new command from rosserial arrives
LIDARINO_WORKSPACE
├── build ...
├── devel ...
├── src
    ├── lidarino_pkg
        ├── config 
            ├── base_local_planner.yaml => local planner parameters
            ├── costmap_common.yaml => general costmap parameters
            ├── global_costmap.yaml => gloabal costmap parameters
            ├── local_costmap.yaml => local costmap parameters
        ├── launch
            ├── launch.launch => planning complete launcher
            ├── launch2.launch => everything except planning
            ├── launch2pi.launch => same as launch2 but no simulator map server to launch it separately
            ├── move_base.launch => only planning
            ├── pi.launch => same as launch2 but no simulator
            ├── Testing_Localization.launch => localization simulation
            ├── tfonly.launch => only tf nodes
        ├── maps
            ├── cappero_laser_odom_diag_2020-05-06-16-26-03.png => diag map
            ├── map.pgm => 1st configuration of the room
            ├── map.yml => yml file for the room map
            ├── map2.pgm => 2nd configuration of the room
            ├── map3.pgm => 3rd configuration of the room
            ├── sim_map.yaml => yaml file for the diag map
        ├── rviz
            ├── navigation.rviz => navigation package rviz configuration 
            ├── rviz_map_and_robot.rviz => rviz configuration for our localizer
        ├── src
            ├── dmap_localizer.cpp => implementation of a dmap based localizer 
            ├── localizer.cpp => node that uses the localizer to localize the robot in the map
            ├── simulation.cpp => simulation node to handle a virtual world with a map and robot with a lidar
            ├── odometry.cpp => node to do odometry based either on a simulated cmd_vel or the real one 
            ├── keyboard_interface.cpp => node to create a interface between the keyboard and the robot
            ├── pos_subscriber.cpp => node to test that the position is being published correctly

INSTALLATION

  1. Clone the repository:
git clone "https://github.com/cybernetic-m/LIDARino_robot"
  1. Install ROS Noetic on your PC following these instructions

  2. Configuring your ROS environment on your PC following these instructions !!!Important: You need at least the catkin_ws!!!

  3. Install ROS Melodic on your Raspberry following these instructions

  4. Configuring your ROS environment on Raspberry following these instructions !!!Important: You need at least the catkin_ws!!!

  5. Install rosserial-arduino on the Arduino IDE with these instructions

  6. Install rosserial on Raspberry PI:

cd ~/catkin_ws/
git clone "https://github.com/ros-drivers/rosserial"
catkin_make
  1. Build our package:
cd LIDARino_robot/LIDARINO_WORKSPACE
catkin_make
  1. Launch the Arduino IDE and open the "firmware.ino"

  2. Upload the firmware to your Arduino

  3. Install the lidar ros package from the repo and follow the instructions in the doc folder of the repo

git clone "https://github.com/LetsOKdo/sdk_ld06_raspberry_ros"
  1. (Mapper - optional) follow point 7 of this tutorial https://yoraish.wordpress.com/2021/09/08/a-full-autonomous-stack-a-tutorial-ros-raspberry-pi-arduino-slam/ to install hector mapper to create a custom map

LAUNCH

  1. Start the lidar:
cd sdk_ld06_raspberry_ros
roslaunch ldlidar ld06.launch 
  1. Start our package in another terminal:
cd LIDARino_robot/LIDARINO_WORKSPACE
. ./devel/setup.bash
roslaunch lidarino_pkg pi.launch
  1. Start rosserial on the raspberry side (change the PORT based on your Arduino serial communication /dev/{your_port}, you can see it on Arduino IDE:
rosrun rosserial_python serial_node.py /dev/ttyACM0
  1. Start the keyboard interface:
cd LIDARino_robot/LIDARINO_WORKSPACE
. ./devel/setup.bash
rosrun lidarino_pkg keyboard_interface

HARDWARE

  1. Arduino UNO

  2. Raspberry PI

  3. DUAL H-BRIDGE L298N

  4. 2 TT motors

  5. Ultrasonic sensor HC-SR04

  6. Breadboard

  7. Power Bank for the Raspberry and separate battery for the motors (9V+ recommended )

VERSIONS

v0.1

To design the base for our robot we started from a community shared base (https://www.tinkercad.com/things/daN7nNs5RfJ-line-follower-robot-v3) but modified it a lot to add wheel encoders, ultrasonic sensor, raspberry and a more secure mounting system for the motors and for the 2 bases. We also made it a bit bigger to fit all the new equipment.

Description

Description

From there we started to write the firmware on Arduino to read data from all the sensors and to control the motors, and we programmed it to be able to turn on it's axis

Description

and go "straight"...

Description

But the space was still too little to fit everything comfortably without fear of disconnects, for example we had to fit the breadboard upside down which made the sensors not very reliable. To fix that we created a new version bigger still, so that we could leave the top for the lidar and raspberry only and fit Arduino and all the sensor and motor and their wiring in the bottom base, that made it so that we could control it better.

v0.2

The result of the v0.2 is available at these links if you want to 3D print them ;):

  1. Lower Chassis
  2. Upper Chassis

Description

Description

Authors

Massimo Romano (2043836) (https://github.com/cybernetic-m)

Paolo Renzi (1887793) (https://github.com/RenziPaolo)

Francesco Giarrusso (1807094) (https://github.com/fragiarrusso)

Description

About

This is the official repository of the Robot Programming subject in Artificial Intelligence and Robotics course at Sapienza University of Rome

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors