1 minute read

This week I’ve been working on developing a new application based on VFF.

Virtual force field or VFF is a goal-based obstacle avoidance algorithm. It is based on 2 kind of forces: attractive and repulsive forces. The attractive force goes from the robot to the goal, while the repulsive forces go from the obstacles to the robot. The amount of force caused by the obstacles is inverse proportional to the distance, so the closer an obstacle is the greater magtinude of the force. Here is a better explanation on what the VFF algorith is and how it works.

To develop this application, we need 2 kind of sensors:

One is the laser, which will be used to calculate the forces caused by the obstacles. To filter which info from the laser is usefull and which is not, we need to transform the 360 array measures into a 2D (2, 360) array in which we get X and Y for each one. To make it inverse proportional, we can make it by just changing the measures. With this I mean that, if the max measure is 10m, this will become a 0 magtinude force, and 0m will become the max magnitude force (whatever we consider a good one).

The other one is odometry. This gives us the position and orientation of the robot at the moment, which will be really usefull to get the attractive forces. To calculate the attractive force, we will get the distance from the robot to the objective in relative coords (again in X/Y coords). This one will also be proportional to the distance (not inverse), but it will also have a limit so a really far objective will not create an infinite attractive force.

Finally we add up both forces and get a final linear and angular velocities to send to the robot. Here is the layout of the project.

Now I’m having some troubles with getting the actual position of the robot, since it is given from the ROS2 topic in quaternions and I need to work with euler angles (as the laser has 360º and makes it more intuitive), but they will get solved! Stay tunned for future information.