Mobile Robot Control 2024 HAL-9000: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
Line 42: Line 42:


=== Artificial potential fields ===
=== Artificial potential fields ===
Artificial potential fields are self-explanatory: they portray the potential fields around an object. A field can either be repulsive or attractive. The reason for being artificial is because these fields do not exist in the real world. In the real world, an object does not push the robot away or pull the robot towards it. In a simulation, however, artificial potential fields can be drawn such that a robot avoids certain objects and gravitates toward others. In this particular case, the robot is drawn towards the goal and repulsed by obstacles that are in its way. The distance between the robot and the goal or obstacle dictates the strength of the field around it. When an abstacle is close, for example, the repulsion force should be higher than the attraction force and high enough to repulse the robot away from the obstacle. This dependancy on distance can be seen in the formulas for the two fields.
The artificial attraction potential is dependent on a scaling factor, ka, and the distance between the robot and the goal.
<insert attraction formula>
From the potential, the force can be caluclated using:
<insert att force>
For the repulsion potential, the outcome depends on the factor p0. This factor portrays a boundary around an obstacle if the robot moves within this boundary, the repulsion potential is relevant if the robot is outside of this boundary, the repulsion potential is not relevant and therefore zero. The reason the repulsion is not relevant outside of this bound is because the robot is not close to the obstacle at that point, so it would be unwise to repulse the robot away when it is far away from obstacles. It is important that the robot does not crash into the obstacles and therefore the repulsion potential, once inside the boundary, blows up the closer the robot gets to the object.
<nowiki><math>U_{rep} = ½ kr (1/||q - q_o|| - 1/ρ_0) if ||q - q_o|| < ρ_0 else U_{rep} = 0</math></nowiki>
The formula for the repulsion field also shows that the repulsion field depends on a scaling factor, kr. These scaling factors, ka and kr, should always be bigger than zero and can be chosen such that there is a good dynamic between the repulsion and attraction potentials.
With this, the repulsion force can be calculated:
<nowiki><math>F_{rep} = kr (1/||q - q_o|| - 1/ρ_0)(1/||q-q_o||^2) if ||q - q_o|| < ρ_0 else F_{rep} = 0</math></nowiki>
These artificial forces can be added up to obtain the total artificial force.
<insert total force formula>
The total force can, in turn, be inserted in the velocity of the robot.
The implementation of these artificial potential fields seems to be straightforward. (Later it will be explained why this is not necessarily the case). One of the disadvantages of the fields is, however, local minima. Local minima occur, for example, when the force is zero.
<insert figure>
This could happend when the goal is right behind a wall. The robot wants to move through the wall to the goal but is repulsed by the wall. It does not know that it can move around the wall but will stay trapped.


=== Vector field histogram ===
=== Vector field histogram ===

Revision as of 09:55, 20 May 2024

Group members:

Caption
Name student ID
Salim Achaoui 1502670
Luis Ponce Pacheco 2109417
Nienke van Hemmen 1459570
Mohamed Elbehery 1035058
Aniek Wigman 1463535
Max Hage 1246704
Max van der Donk 1241769

Exercise 1: Non-crashing robot

For the first exercise, the goal was to ensure that the robot does not move through walls in the simulation and not crash into the walls in both the simulation and the real world. To solve this matter, there were multiple solutions. The first solution collects all of the data from the lasers and stops the robot when it reaches a wall. A second solution also uses this notion but instead of stopping the robot, the robot turns away from the wall. These solutions were then tested on the robot in real life. After testing, it became clear that, although stopping the robot was not an issue, the robot was not able to move along a wall in parallel. This issue occurred since the sensor data was taken uniformly. So on all sides, the robot would stop with the same threshold. Therefore, a third solution was made that took the orientation of the sensor data into account for the robot to move alongside a wall. The details of the solutions will now be covered in more detail.

Solution 1

For the first solution, we utilize the laser data that the robot has. This contains data as to how far a wall or object is to the robot at a certain angle. For each angle, we check whether the robot is too close to an obstacle, thus within range x. If it is, it stops moving. Else, it keeps on going forward.

Solution 2

For the second solution, the first solution was expanded. Instead of just stopping, the robot now rotates until no obstacle is close to the robot anymore, and it moves forward again.

Solution 3

This solution is also an expansion of solution 1. In this expansion, the size of the robot is taken into account aswell. This solution was created after testing the robot physically. We came to the realisation that the size of the robot is not taken into account. Therefore, in the script an offset was included such that the body of the robot does not bump into the wall. using the line: scan.ranges[i] < minDist + robotWidth*abs(sin(currentAngle) we introduce an offset by adding the sinusoid of the current angle, which is approximately the circular body of the robot. Because the laser of the robot is approximately in the middle of its body, the sinusoid creates a proper offset to not bump into a wall anymore.

Exercise 2: Local Navigation

For local navigation, 2 different solutions had to be introduced for the restaurant scenario. We have chosen for artificial potential fields and vector field histograms because these solutions seemed the most robust to us. In this parahraph the 2 solutions will be explained.

Artificial potential fields

Artificial potential fields are self-explanatory: they portray the potential fields around an object. A field can either be repulsive or attractive. The reason for being artificial is because these fields do not exist in the real world. In the real world, an object does not push the robot away or pull the robot towards it. In a simulation, however, artificial potential fields can be drawn such that a robot avoids certain objects and gravitates toward others. In this particular case, the robot is drawn towards the goal and repulsed by obstacles that are in its way. The distance between the robot and the goal or obstacle dictates the strength of the field around it. When an abstacle is close, for example, the repulsion force should be higher than the attraction force and high enough to repulse the robot away from the obstacle. This dependancy on distance can be seen in the formulas for the two fields.

The artificial attraction potential is dependent on a scaling factor, ka, and the distance between the robot and the goal.

<insert attraction formula>

From the potential, the force can be caluclated using:

<insert att force>

For the repulsion potential, the outcome depends on the factor p0. This factor portrays a boundary around an obstacle if the robot moves within this boundary, the repulsion potential is relevant if the robot is outside of this boundary, the repulsion potential is not relevant and therefore zero. The reason the repulsion is not relevant outside of this bound is because the robot is not close to the obstacle at that point, so it would be unwise to repulse the robot away when it is far away from obstacles. It is important that the robot does not crash into the obstacles and therefore the repulsion potential, once inside the boundary, blows up the closer the robot gets to the object.

<math>U_{rep} = ½ kr (1/||q - q_o|| - 1/ρ_0) if ||q - q_o|| < ρ_0 else U_{rep} = 0</math>

The formula for the repulsion field also shows that the repulsion field depends on a scaling factor, kr. These scaling factors, ka and kr, should always be bigger than zero and can be chosen such that there is a good dynamic between the repulsion and attraction potentials.

With this, the repulsion force can be calculated:

<math>F_{rep} = kr (1/||q - q_o|| - 1/ρ_0)(1/||q-q_o||^2) if ||q - q_o|| < ρ_0 else F_{rep} = 0</math>

These artificial forces can be added up to obtain the total artificial force.

<insert total force formula>

The total force can, in turn, be inserted in the velocity of the robot.

The implementation of these artificial potential fields seems to be straightforward. (Later it will be explained why this is not necessarily the case). One of the disadvantages of the fields is, however, local minima. Local minima occur, for example, when the force is zero.

<insert figure>

This could happend when the goal is right behind a wall. The robot wants to move through the wall to the goal but is repulsed by the wall. It does not know that it can move around the wall but will stay trapped.

Vector field histogram

*insert explanation for how this method works*

for vector field histograms, 2 major components had to be created. Firstly, the translation from the laser data to a map that contains the coordinates of the obstacles together with a certainty value and a polar histogram, from which a minima should be chosen as direction to continue moving.

Obstacle map

Polar Histogram