Loading repository data…
Loading repository data…
Yasouimo / repository
Multi-agent cooperative system for mapping and surveillance using e-Puck robots in Webots. Leverages robotics, computer vision, and machine learning for real-time coordination and environment mapping. Enhances mapping accuracy, exploration efficiency, and surveillance coverage compared to single-agent systems. Video Simulation on the link
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This project explores the collaborative capabilities of e-Puck robots in map parsing and surveillance. Utilizing the Webots simulation environment, the e-Puck robots are programmed to work cooperatively to map a maze environment and perform surveillance tasks. The robots use a deterministic 4-state navigation system to navigate through the maze while avoiding obstacles and cover the entire map. Additionally, they utilize YOLOv8 for object detection - if a cat is detected, an alarm is activated signifying the presence of a stray object that should not be in the monitored area.
In this experiment, each e-Puck robot collects environmental data using its onboard proximity sensors and cameras. These observations are used to continuously update the robot's internal map and metadata. To promote efficient collaboration and situational awareness, all robots actively share their updated data with their peers through a . This real-time exchange of sensory information and map updates enables the robots to operate in a synchronized and informed manner, improving the overall performance of the multi-robot system.
The diagram above illustrates the workflow of the team, highlighting the processes of observation, map updating, metadata management, and information sharing among the robots.
The core logic for each robot is a continuous, independent cycle designed for robust, cooperative exploration and mapping. The process follows the operational flow illustrated in the diagram below, ensuring each robot can sense, share, plan, and act in a coordinated manner.
Here is a breakdown of the main cycle (Cycle Principal du Robot):
Before entering the main loop, each robot initializes its core components. This includes setting up its motors, enabling proximity sensors, and creating a new, blank internal map of its environment.
# In EPuckController.__init__
self.robot = Robot()
self.left_motor = self.robot.getDevice("left wheel motor")
self.sensors = [self.robot.getDevice(f'ps{i}') for i in range(8)]
# The mapping module creates a blank grid map for this specific robot
self.mapping = CooperativeMapping(self.robot_name)
At the start of every cycle, the robot updates its state. It calculates its current position and orientation in the world using data from its wheel encoders (odometry). It then uses its proximity sensors to detect nearby walls and obstacles, updating its own local map.
# In the main loop of e-puck_controller.run()
self.update_pose() # Update position (x, y) and orientation
sensor_values = [s.getValue() for s in self.sensors]
# Update the local map with what the sensors currently see
self.mapping.update_map_from_sensors(self.position, self.orientation, sensor_values)
To collaborate, robots must share what they've learned. In this step, the robot performs a two-way data synchronization:
This is handled by the sync_data() method, which saves the robot's own data and then calls load_all_robot_data() to merge information from peers.
# Simplified logic from cooperative_mapping.py
# 1. Save my own data to a file
my_data = {'map_update': self.grid_map, 'position': my_pos, ...}
with open(self.my_data_file, 'wb') as f:
pickle.dump(my_data, f)
# 2. Load and merge data from other robots
all_data_files = glob.glob("robot_data/data_*.pkl")
for file_path in all_data_files:
# ... (load data from file)
# Merge the maps, giving priority to obstacles
self.grid_map[other_robot_map == OCCUPIED] = OCCUPIED
With an updated and merged map, the robot decides what to do next. This is handled by a simple state machine:
# Simplified logic from e-puck_controller.run()
is_obstacle = sensor_values[0] > 150 or sensor_values[7] > 150
if is_obstacle:
# Plan is to execute the avoidance maneuver
self.state = "AVOIDING"
elif self.cooperative_target is not None:
# Plan is to move towards the shared target
self.state = "FOLLOWING_COOPERATIVE_TARGET"
else:
# Plan is to continue exploring
self.state = "EXPLORING"
Based on the plan from the previous step, the controller sends commands to the motors. This results in the robot moving forward, turning to avoid an obstacle, or steering towards a target. Once the movement is executed, the cycle repeats, allowing the robot to continuously react to its environment and its teammates.
# Example: executing the exploration movement
side_steer = (sensor_values[5] - sensor_values[2]) / 500.0
left_speed = self.max_speed - side_steer
right_speed = self.max_speed + side_steer
self.set_motor_speeds(left_speed, right_speed)
The e-Puck robots utilize a sophisticated communication system to share information and coordinate their activities across the environment. This system enables efficient mapping and surveillance by allowing robots to exchange detection data and avoid redundant exploration.
Each e-Puck robot is equipped with an emitter and receiver device that allows for bidirectional communication with other robots in the team. The RobotCommunicator class manages this communication, handling tasks such as:
When a robot detects an object in the environment, it broadcasts this information to all other robots in the network. This approach has several benefits:
Here's an example from our detection logs showing how different robots detect and share information about various objects:
| Timestamp | Robot | Object | ID | Position | Status | Notes |
|-----------|-----------|---------------|----|-----------------|---------|-----------------------------|
| 14:21:50 | e-puck | PlasticCrate | 1 | (0.09, -0.34) | First | First detection of a crate |
| 14:22:28 | e-puck(1) | CardboardBox | 1 | (0.90, -0.04) | First | First detection of a box |
| 14:23:42 | e-puck(3) | OilBarrel | 1 | (3.34, 4.11) | First | First detection of a barrel |
| 14:24:21 | e-puck(3) | Cat | 1 | (4.74, 1.57) | First | First cat - triggers alarm |
The robot team implements a cooperative alarm system that prevents multiple alerts for the same object. When a robot detects a cat (unauthorized entity), it:
For example, at 14:24:21, e-puck(3) first detected a cat at position (4.74, 1.57), triggering an alarm. Subsequent cat detections by the same robot don't trigger new alarms, as shown by the "Repeat" status:
| Timestamp | Robot | Object | Status | Position | Detected By |
|-----------|-----------|--------|--------|------------------|--------------|
| 14:24:21 | e-puck(3) | Cat | First | (4.74, 1.57) | - | # Initial detection - triggers alarm
| 14:24:25 | e-puck(3) | Cat | Repeat | (4.70, 0.93) | e-puck(3) |
| 14:24:30 | e-puck(3) | Cat | Repeat | (4.51, -0.07) | e-puck(3) |
| 14:24:35 | e-puck(3) | Cat | Repeat | (4.00, -0.95) | e-puck(3) |
When another robot (e-puck(1)) detected a cat at 14:27:15, it created a new first detection, as it was detecting the cat in a different area of the environment:
| Timestamp | Robot | Object | ID | Position | Status | Notes |
|-----------|-----------|--------|----|-----------------|---------|-----------------------------|
| 14:27:15 | e-puck(1) | Cat | 1 | (-2.53, 4.02) | First | New cat detected by different robot |
Each robot in the team is equipped with cameras that capture real-time images of the environment. These images are processed through a YOLOv8 model to perform object detection. The primary goal of this system is to identify and alert the team about any foreign objects detected in the monitored area.
The above image shows an example of real-time predictions made by the YOLOv8 model. The model detects and classifies objects, drawing bounding boxes around them with confidence scores.
The performance of the YOLOv8 model was evaluated using standard metrics such as loss, precision, recall, and mean Average Precision (mAP). The results of these evaluations are summarized below.
The following table presents the benchmarking results for the YOLOv8 model against other popular object detection models. The benchmarks include metrics like inference time, precision, recall, and mAP.
| Model | Inference Time (ms) | Precision (%) | Recall (%) | mAP@0.5 (%) | mAP@0.5:0.95 (%) |
|---|---|---|---|---|---|
| YO |