Napoleon

Ev3 Lego robot built to be the winner of a OS 2017 relay race

View project on GitHub

Bienvenue! Witam! Benvenuto!

Bonjour!

My name is Napoleon and I was created to be a winner. The history of my name is quite interesting but you have to ask my owners about it. I was born in November 2016 in EURECOM so I am a Newbie in relay race. But I am equipped with great engines so I can go really fast! You will see!

I have ears (ultrasound sonar) not to bang into big boxes which will be on my way. I have eyes (colour sensor) and two hands (engine) to to grab small red ball. I also have a gyro in my tummy to not get lost.

I am very friendly robot so thanks to my Bluetooth I can communicate with my robot friends.

You can see on my pictures how fancy I am :)

Architecture of the robot


You can click on each photo to enlarge it.
For the ball management we used simple approach as presented on the picture below. The mechanism is mounted to engine.

The mechanism can move up and down to grab the ball. In picture below the grabbing mechanism is ready to grab the ball:

The pictures above show also the mounting of the gyro which is used to track the position of the roobot.
For detecting the ball we used two sensors: sonar sensor and colour sensor. The mounting is showed on pictures below:

Napoleon in action


Napoleon on big and small arenas
Napoleon with a friend

Algorithms

  1. Position tracking

    To track the position of the robot we used Gyro Enhanced Odometry approach.
    1. Using the encoders obtaine wheel displacement of the robot.
    2. Using gyroscope obtain relative rotation since the last check.
    3. Using trygonometry properties calculate X and Y differences.
    4. Update robot position by integrating obtained results.
    5. Repeat the algorithm every 100ms.

    Implemented algorithm: position.c

  2. Navigation and movement

    To navigate over the arena we implemented go_to_XY(X, Y) function. This function is using the information from our position tracking thread to calculate required rotation towards the target and distance. After the calculations are completed, the movement plan is executed and corrected as new position data becomes available.

    Combining our position tracking and navigation functions we can execute the plan for the entire race using very simple high-level commands.
    Following example demonstarte our movement plan for follower for the small arena:

  3. Ball management and ball detection

    To find the ball we implemented find_ball() function. This function is using the data provided by eye.c thread. The eye when initialized is gathering the information from the colour sensor and ultra sound sensor and then can feed find_ball() function with information about the nearst ball or obstacle.

How to use source code

  1. Download ev3dev onto SD card from here.
  2. Boot ev3 brick and ssh into it.
  3. Download ev3dev-c from here, compile it and install it on the brick.
  4. Download our code from our GitHub and compile it using provided Makefile.
  5. Run it using main executable

Source code

Source code will be available on our GitHub after the competition.

Contributors

Emilia Cebrat (@EmilyTheStrange), Kamil Maslowski (@kmaslows), and Christian Palmiero (@ChristianPalmiero)