Giter VIP home page Giter VIP logo

davidelanz / soccer-match-robot Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 6.0 9.57 MB

Four-wheeled robot interfaced with ROS through a Raspberry Pi. Low level control of the L298N motor drivers via Arduino UNO controller. Developed ROS modules for perception tasks, visual servoing, and task planning in C++ and Python.

Python 22.83% C++ 62.04% CMake 11.33% Shell 0.13% C 3.24% Makefile 0.43%
robotics mobile-robots raspberry-pi arduino ros

soccer-match-robot's Introduction

Four-wheeled Robot Design for Soccer Match

ROS Distro Raspberry Model Raspberry Model

The aim of this project is to build a system able to play a robotic soccer match 1 vs 1. Subtasks involved:

  • Perception: detecting a red ball and (eventually) the opponent and the goal (blue)
  • Trajectory planning: controlling the velocity for reaching the target in an appropriate way
  • Task planning
  • Low level driver control


Demo video:


Contents

  1. Guidelines
  2. Scheme
  3. Getting started
    1. Download the ROS workspace
    2. Configure the Arduino motor driver
    3. Connect Raspberry's ROS master to remote workstation
    4. Launch the ROS node necessary for autonomous control
    5. Cameras
    6. Control the robot with keyboard
  4. Troubleshoot
  5. Authors

Guidelines

Sketch out the possible general architecture of the system, defining the main blocks constituting the model:

Scheme

  • L298 Motor drivers interface with the Arduino board:

L298-With-Arduino

L298-With-Arduino

  • ROS Nodes architecture scheme (Raspberri Pi Robot & Remote Workstation):

Getting started

Download the ROS workspace

Clone this repository on both the Raspberry Pi and the remote workstation:

https://github.com/Davidelanz/soccer-match-robot.git

Then build the workspace:

cd soccer-match-robot/
catkin_make

Remember to source it in the bash (for further details: http://wiki.ros.org/catkin/Tutorials/create_a_workspace).

Configure the Arduino motor driver

Simply load the motor_driver.ino sketch on the board. Remeber to choose the Arduino due - programming port board and /dev/ttyACM0 port.

Connect Raspberry's ROS master to remote workstation

Prerequisite: the Raspberry must be connected on the same network of the remote workstation (e.g. a laptop).

  1. Access the Raspberry via SSH by running in remote workstation's terminal. For example: ssh [email protected]

  2. Once got in Raspberry's terminal, export its IP address:

    [email protected]:~$ export ROS_IP=RASPBERRY_IP

    โš ๏ธ If you need the machine's IP you can run hostname -I

  3. Launch the raspicam node in Raspberry's terminal (this command will also launch the roscore):

    [email protected]:~$ roslaunch raspicam_node camerav2_410x308_10fps.launch

  4. Get back to the remote workstation and export its IP address as well:

    user@remote-workstation:~$ export ROS_IP=REMOTE_WORKSTATION_IP

  5. Then, connect the ROS master on the Raspberry to the remoting workstation by using the Raspberry's IP:

    user@remote-workstation:~$ export ROS_MASTER_URI=http://RASPBERRY_IP:11311/

Launch the ROS node necessary for autonomous control

  1. In the Raspberry's terminal, launch the motor_driver node:

    [email protected]:~$ rosrun motor_driver motor_driver.py

  2. You can now launch the controller on another terminal of the Raspberry with:

    [email protected]:~$ rosrun bull_controller clever_bull_controller.py

  3. In remote workstation's terminal run the red perception node for detecting the ball:

    user@remote-workstation:~$ rosrun robot_perception red_perception_node.py

  4. In remote workstation's terminal run the blue_perception node for detecting the goal:

    user@remote-workstation:~$ rosrun robot_perception blue_perception_node.py

Remember that you have to export the Raspberry's IP for each terminal you need to use and export the remote workstation's IP and connect it to the ROS master on the raspberry on each laptop's terminal

Cameras

The raspicam_node supports dynamically reconfiguring the camera parameters. Run the dynamic reconfigure node on a connected computer:

rosrun rqt_reconfigure rqt_reconfigure

Control the robot with keyboard

Pre-requisites: arduino sketch loaded and Raspberry's ROS master connected to the remote workstation

  1. In Raspberry's terminal, launch the motor_driver node:

[email protected]:~$ rosrun motor_driver motor_driver.py

  1. In remote workstation's terminal launch the teleop_twist_keyboard node and follow the instruction at screen:

user@remote-workstation:~$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Remember to increase the speed (w key) at least to 2/3 to get a decent feedback from the motor

Troubleshoot:

SSH not enabled on Rasp:

Authors

EMARO Advanced Robotics Master - 2nd year University of Genoa

soccer-match-robot's People

Contributors

albertoghiotto avatar albertogrillo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.