Skip to content

Este repositorio esta diseñado para guardar todos los documentos/archivos iam-stp-URDF y codigos

License

Notifications You must be signed in to change notification settings

RAMEL-ESPOL/MARVIN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mobile Autonomous Robot Vehicle for Investigation and Navigation

Introduction

MARVIN is a comprehensive platform (built by Luis Andrade Proaño) designed to facilitate the development and deployment of autnomous vehicles with Ackermann steering , providing a set of essential modules and tools to enable various capabilities. The framework consists of the following core components:

  • Manual control over the vehicle.
  • Real time mapping of the enviroment sourrounding the robot.
  • Localization, once the map is saved in the robots system.
  • Autonomous navigation of the vehicle with object avoidance.
  • Simulation enviroment designed for gazebo.
  • Graphical User Interface (GUI).
  • Code developed for ROS2 foxy

MARVIN is designed to be versatile, enabling researchers and developers to experiment with different robot types with the same steering system, test various algorithms, and to navigate complex enviroments in real-world scenarios. By providing these core modules and simulation environments, MARVIN is another tool for investigation in the field of robotics.

Framework Overview

An overview of the framework modules and communications is presented below: framework

Software Requirements

For the simulation :

For MARVIN :

Prerequisites 0.1.- Update your apt repository
sudo apt update

0.2.- Download and install git

sudo apt install git
  • To confirm that it's properly installed, run the following command
    git --version

0.3.- Download and install ROS2 humble

All instructions are found in the following link: https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html

  • Finally add sourcing to your shell startup script
    echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc

0.4.- Install Gazebo for simulation with physics

sudo apt install ros-humble-gazebo-ros-pkgs

0.5 Install the following dependencies ```sh

sudo apt install ros-humble-xacro

sudo apt install ros-humble-joint-state-publisher

sudo apt install ros-humble-joint-state-publisher-gui

sudo apt install python3-colcon-common-extensions

sudo apt install ros-humble-ros2-control

sudo apt install ros-humble-navigation2 ros-humble-nav2-bringup

sudo apt install ros-humble-twist-mux

```

Installation steps for the simulation

1.- Clone the github repository in a workspace source folder. (marvin_sim_ws/src)

git clone https://github.com/RAMEL-ESPOL/MARVIN.git

2.- Go to workspace directory and copy the "meshes" folder

cd MARVIN/marvin_sim_ws/src/marvin_description
  • Paste the "meshes" folder into the following folder. (This will allow you to visualize the MARVIN model in the Gazebo environment)
    cd .gazebo
    mkdir models
    cd models
    mkdir marvin_model

3.- Build the package in marvin_sim_ws workspace.

colcon build

Process

0.- Navigate to the workspace directory (The previous step to perform in all new cmd windows opened)

source install/setup.bash

1.- Launch the simulation.

ros2 launch marvin_sim_gazebo gazebo_spawn.launch.py world:=./src/marvin_sim_gazebo/worlds/lab_track.world use_sim_time:=true

2.- Open a new cmd window, source in the ws and launch SLAM.

ros2 launch marvin_navigation slam.launch.py use_sim_time:=true

In Rviz activate the map node and spec

3.- Connect a joystick to the computer and use it to move the vehicle manually around the map.

After you've mapped the area, go in Rviz to Panels -> add new Panel and click on SlamToolboxPlugin Make sure that you save the map with the name "marvin_world"

4.- After saving, finish with Ctrl-c the window where is you where running SLAM and in Rviz don't forget to Remove the Map plugin

5.- Open a new cmd window, source in the ws and launch the Navigation.

ros2 launch marvin_navigation navigation.launch.py use_sim_time:=true

To make the robot navigate autonomously use the 2D Goal Pose tool in Rviz to select a point in the map.

You can now move the robot freely through the map. You can also (during the path) use manual control to change directions, but the robot will stop at the Goal that you previously set.

Installation for the Jetson Nano

Prerequisites for the computer you're going to use with MARVIN

0.1.- Update your apt repository

sudo apt update

0.2.- Download and install git

sudo apt install git
  • To confirm that it's properly installed, run the following command
git --version

0.3.- Download and install ROS2 foxy

All instructions are found in the following link: https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html

  • Add sourcing to your shell startup script
echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

0.4.- Finally set the ROS_DOMAIN_ID variable

echo "export ROS_DOMAIN_ID=0" >> ~/.bashrc

source ~/.bashrc

0.5 Install the following dependencies

  
sudo apt install python3-colcon-common-extensions
  
sudo apt install ros-foxy-navigation2 ros-foxy-nav2-bringup
  

0.6 Clone the github repository in the HOME enviroment.

   
git clone https://github.com/RAMEL-ESPOL/MARVIN.git
    

0.7 Build the ROS2 workspace

  
cd /HOME/MARVIN/marvin_ws
  
colcon build
  

0.8 Source the environment

  
source install/setup.bash
  
Prerequisites for the Jetson Nano

0.1 Device bind ID

0.2.- Connect the control via Bluetooth to the Jetson Nano

0.3.- Check the IP address

hostname -I
  • Write the address down.

REMEMBER: Both the Jetson Nano and your computer must be connected to the same Wifi network.

1.- Connect your computer to the Jetson Nano.

ssh marvin@<the Jetsons IP address>

*Always set the time and date everytime you turn on the Jetson Nano

Date

date +%Y%m%d -s "20081128" 

Time (use a 24h cycle)

date +%T -s "10:13:13"

2.- Clone the github repository in the HOME enviroment.

git clone https://github.com/RAMEL-ESPOL/MARVIN.git

3.- Go to recently downloaded folder and initialize the DockerFile (dont worry, the factory image of the Jetson Nano comes with Docker pre-installed).

cd /MARVIN
sudo docker build . -t marvin:latest

After the docker has been built, you have to run it with the following conditions

4.- Build the container environment.

sudo docker run -it --net=host --device=/dev/input/event0 --device=/dev/input/event1 --device=/dev/input/event2 --device=/dev/input/js0 --device=/dev/myserial --device=/dev/rplidar --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix marvin:latest /bin/bash

##Inside the container

5.- Build the package.

colcon build 

6.- Source the environment

source install/setup.bash

7.- Finally set the ROS_DOMAIN_ID variable

echo "export ROS_DOMAIN_ID=0" >> ~/.bashrc

source ~/.bashrc

Exit the docker with the "exit" command.

Now that the container is created, all the files and changes that you've made, will remain there.

To open the container you must first now its name.

To get the containers name:

docker ps -a

The last name is the last container that was active.

Start the container

docker start <container name> 

Run the container

docker exec -it <container name> /bin/bash
Recomendations Everytime you open a new cmd window, you must connect via ssh to the Jetson nano and execute the running container to access it
docker exec -it <container name> /bin/bash

To get the containers name:

docker ps -a

Exit the docker container with the "exit" command.

Turn off the container if it's still active

sudo docker stop <container name>

Turn off the Jetson Nano remotely

sudo shutdown -h now

Process

  1. Inside the container you'll be in the MARVIN workspace already built. (Important step to perform in all new cmd windows opened)
source install/setup.bash
  1. Launch the control and LiDAR of the robot
ros2 launch marvincar_bringup marvincar_bringup_launch.py
  1. Open a new cmd window, source in the ws and launch the LiDAR.
ros2 launch marvin_lidar ld19.launch.py

In Rviz activate the map node and spec

  1. In your computer run the following launcher to display the map being made in real time.
ros2 launch marvincar_nav view_map_launch.py 
  1. Start the mapping node
ros2 launch marvincar_nav mapping_launch.py  

Move the vehicle so that SLAM Toolbox maps the area in real time.

After you've mapped the area.

  1. After you've mapped the area, go in Rviz to Panels -> add new Panel and click on SlamToolboxPlugin Make sure that you save the map with the name "marvincar"

  2. Close the Map Plugin and the cmd Windows that's running the mapping

  3. Launch the Navigation.

ros2 launch marvincar_nav navigation_dwa_launch.py

To make the robot navigate autonomously use the 2D Pose Estimate to select the point in the map where the real robot is, drag the click to specify its orientation. Use the 2D Goal Pose tool in Rviz to select a point in the map.

You can now move the robot freely through the map.

=======

Package Structure

The package structure is the following:

  • marvin_images -> includes images of the project.
  • marvin_ws -> includes the robots' packages (In this repo are all the packages that control the vehicule including the LiDAR LD19 sensor).
  • marvin_sim_ws -> includes the robots' simulation packages (In this repo are all the packages that control the vehicule including the different Gazebo enviroments ready for usage).
  • configurations -> contains the bash file that replaces the original created in the Docker container.
  • Dockerfile -> contains a list of instrucctions to build a container from a file. (Includes the main container image with ubuntu 20.04 and ROS2 foxy installed).

repository_structure

About

Este repositorio esta diseñado para guardar todos los documentos/archivos iam-stp-URDF y codigos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published