Skip to content

Research Track 1 - Second assignment - Control of a robot in a simulated environment

Notifications You must be signed in to change notification settings

simone-contorno/rt-assignment-2

Repository files navigation

Second Assignment of Research Track 1 - Robotics Engineering

Author: Simone Contorno


Control of a robot in a simulated environment.

Introduction

An overview of this program function.
Go to Introduction

How it works

A rapid description of how the program works (pseudo-code).
Go to How it works

Installation and Execution

How install and run this program in Linux.
Go to Installation and Execution

Improvements

How this program could be improved.
Go to Improvements

Introduction

This program manage a robot, endowed with laser scanners, which should move autonomously inside a circuit.
You can use the robot controller to:

  • Increase the linear velocity;
  • Decrease the linear velocity;
  • Stop the robot;
  • Reset the robot to the initial position.

The circuit is this one:

map

How it works

There are 3 packages:

  • second_assignment: contains the map of the circuit.
  • second_assignment_node: contains 2 source files .cpp
    • robot.cpp: controls the robot to follow the ciruit avoiding the borders; for this task it reads data from laser scanners (base_scan topic), compare them (on the left and on the right) when it is too close to an obstacle (in front of its) and choose the direction where there is more space; it also publishes the new linear velocity (managed from the user interface provided by robot_controller node) in the cmd_vel topic.
    • robot_controller.cpp: provides the user interface to digit commands and sends them to the service (server.cpp).
  • second_assignment_server: contains the source file server.cpp that provides a service that takes in input the requested command from the robot_controller node, and execute the corrisponding task; Robot.srv is the file used by this service.

Look the pseudocode files into the corresponding directories for more details.

Installation and Execution

First of all download into your ROS workspace the current repository opening the terminal and typing:

git clone https://github.com/simone-contorno/rt-assignment-2

Move the folders into the src directory of your ROS workspace.
After, go into the root folder of your ROS workspace and type:

catkin_make

Afterwards type:

rospack profile

Now, open 5 terminals; in the first one run ROS core:

roscore

In the second one run the node to visualize the map:

rosrun stage_ros stageros $(rospack find second_assignment)/world/my_world.world

In the third one run the service node:

rosrun second_assignment_server server

In the fourth one run the robot controller node to manage the robot through the user interface:

rosrun second_assignment_node robot_controller

In the last one run the robot node:

rosrun second_assignment_node robot

Improvements

To improve the robot performance, it could be done an improvement to mantain better the robot in the center of the path.

Thanks to have read this file, i hope it was clear and interesting.

About

Research Track 1 - Second assignment - Control of a robot in a simulated environment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published