Skip to content

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.

Notifications You must be signed in to change notification settings

Davidelanz/soccer-match-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 pi@raspberry.local

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

    pi@raspberry.local:~$ 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):

    pi@raspberry.local:~$ 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:

    pi@raspberry.local:~$ rosrun motor_driver motor_driver.py

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

    pi@raspberry.local:~$ 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:

pi@raspberry.local:~$ 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

About

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.

Topics

Resources

Stars

Watchers

Forks