🤖 MOSQUETERO

Operating Systems Project - EURECOM

Algorithms Overview

MosqueterOS implements a variety of algorithms for autonomous navigation, object detection, and task execution. These algorithms evolved through our development process, with some shared between versions and others developed specifically for advanced implementations.

🔹 Algorithms for Version 1 & 2

Shared Implementation

📝 Overview

The control algorithm implemented for both Version 1 and Version 2 follows a simple two-phase strategy focused on maximizing points through efficient ore collection and strategic opponent disruption.

🎯 Main Algorithm: Two-Phase Collection Strategy

📋 Strategy Description

The robot executes a straightforward strategy divided into two sequential phases. The primary objective is to collect as many cubes and cylinders as possible from our side of the field in the shortest time, then transition to disrupting the opponent's collection efforts.

⚡ Phase 1: Own Territory Collection

Objective:

Collect all cubes and cylinders from our side as quickly as possible to secure maximum points.

Key Components:

  • Navigation: Use gyroscope to maintain orientation while moving through the field
  • Object Detection: Use sonar sensor to detect and identify objects (cubes, cylinders, cones)
  • Selective Collection: Collect cubes and cylinders one by one, avoiding cones to prevent wasted time
  • Time Optimization: Focus on speed to maximize the number of collected ores before phase transition

🎯 Phase 2: Opponent Field Disruption

Objective:

Make the opponent's ore collection more difficult by moving objects and cones strategically across their territory.

Key Components:

  • Field Transition: Navigate from our territory to the opponent's field
  • Object Movement: Push and displace objects randomly to scatter them
  • Cone Manipulation: Move cones to create obstacles and complicate opponent's navigation
  • Strategic Interference: Make ore gathering as difficult as possible for the enemy robot

🔹 Algorithms for Version 3

Advanced Implementation

🏆 Competition Victory

The Mosquetero can follow multiple strategies, which we are to choose before the duel. We ultimately prioritized Strategy 3, which yielded the most consistent results and won us the competition in First Place!

🎥 Winning Match

📝 Strategies Overview

Version 3 implements multiple strategic approaches that can be selected before the duel based on opponent behavior and field conditions. These strategies leverage the improved hardware and control systems to execute more sophisticated maneuvers.

🛡️ Strategy One: Gathering

📋 Strategy Description:

This strategy focuses on cylinders and cubes, and is more defensive, against potentially aggressive robots.

⚙️ Execution Steps:

  1. Grab the box and raise it
  2. Go to the closest cube, push it toward the lower cylinder
  3. Go to the higher cylinder, push it down
  4. Put the box where the cube, two cylinders, and cube are
  5. Once this is done, go around the box and push it toward the opposite cones and cylinders, impeding them from being taken

✨ Strategic Advantages:

  • Point Gain: Seven points when executed successfully
  • Opponent Blocking: If we stop the other team from obtaining their cylinders and the cones, grabbing the cubes is not enough to win
  • Offensive Tool: If the enemy robot moves our box, then they lose three points. This makes the box an useful offensive tool

⚔️ Strategy Two: Cone-Focus

📋 Strategy Description:

This strategy focuses on the two cones. Indeed, getting the two cones is enough to warrant a victory as long as none of the ore on our side of the map are taken.

⚙️ Execution Steps:

  1. Grab the box and raise it
  2. Go to the closest cone, and push it closer to the other one
  3. Retreat and lower the box, safely storing the cones
  4. Push both cylinders to our zone
  5. Push the remaining cube to our zone

✨ Strategic Advantages:

  • Victory Condition: If everything was done right, we have a point majority
  • Efficiency: Getting the two cones is sufficient to warrant victory
  • Protection: Success depends on preventing the opponent from taking ores on our side

� Strategy Three: Fast, One-Cone Approach

🥇 WINNING STRATEGY

📋 Strategy Description:

This strategy adapts from strategy two, pushing one cone rather than both, optimizing so we disrupt the cylinder-grabbing of the opponent quicker.

⚙️ Execution Steps:

  1. Grab the box and raise it
  2. Go to the closest cone, drop the box, collecting it
  3. Push the box forward, until the box blocks one of the enemy's cylinder, and the robot the other
  4. Stay there. Unless another robot steals our box, we should be safe until the competition ends

✨ Strategic Advantages:

  • Point Majority: If the enemy makes less than 5 points (very likely), we have a point majority
  • Quick Execution: Faster than the two-cone approach
  • Early Disruption: Blocks enemy cylinders quicker than other strategies
  • Defensive Position: Robot and box work together to block two enemy cylinders
  • Low Risk: Safe position maintained until competition ends
  • Proven Success: Won us First Place in the competition!

🎯 Strategy Selection

The choice between strategies depends on: