https://github.com/simone-contorno/rt-assignment-2
Research Track 1 - Second assignment - Control of a robot in a simulated environment
https://github.com/simone-contorno/rt-assignment-2
cpp engineering robot robotics ros
Last synced: about 2 months ago
JSON representation
Research Track 1 - Second assignment - Control of a robot in a simulated environment
- Host: GitHub
- URL: https://github.com/simone-contorno/rt-assignment-2
- Owner: simone-contorno
- Created: 2021-11-25T15:02:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-04T08:42:08.000Z (about 4 years ago)
- Last Synced: 2025-10-31T00:47:55.226Z (8 months ago)
- Topics: cpp, engineering, robot, robotics, ros
- Language: CMake
- Homepage: https://github.com/simone-contorno/RT-Assignment-2
- Size: 118 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](#intro)
### How it works
A rapid description of how the program works (pseudo-code).
[Go to How it works](#how)
### Installation and Execution
How install and run this program in Linux.
[Go to Installation and Execution](#installation)
### Improvements
How this program could be improved.
[Go to Improvements](#improve)
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:

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).
- robot.cpp: controls the robot to follow the ciruit avoiding the borders; for this task it reads data from laser scanners (base_scan topic),
- 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
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.