So yeah you're @Carlos Vidal in the project that is, creating a 2d simulator and here's the simulation of an obstacle working with a robot to get picked up.
drawState[arena_Rectangle, robotPosition : {_, _},
obstaclePosition : {_, _}] := Graphics[{FaceForm[LightGray],
EdgeForm[Blue],
arena,
FaceForm[Pink],
EdgeForm[Orange],
Rectangle[{96, 46}, {104, 54}],
PointSize[.05],
Point[robotPosition, VertexColors -> {Cyan}],
PointSize[0.03],
Point[obstaclePosition, VertexColors -> {Black, Red}]}]
DynamicModule[{x = 0, y = 25,
obstaclePosition = {RandomInteger[100], 25}},
Dynamic@EventHandler[
Dynamic[
If[Norm[{x, y} - obstaclePosition] <= 1,
obstaclePosition = {x, y}];
drawState[Rectangle[{0, 0}, {100, 50}], {x, y}, obstaclePosition]],
{"UpArrowKeyDown" :> (If[y < 50, (y += 1)]),
"DownArrowKeyDown" :> (If[y > 0, (y -= 1)]),
"LeftArrowKeyDown" :> (If[x > 0, (x -= 1)]),
"RightArrowKeyDown" :> (If[x < 100, (x += 1)])}]]
The various robot movements linear or circular, those are the kinds of movements that a robot makes finally @Carlos Vidal you made my fantasy come true: the robot performs a linear routine and if it encounters an obstacle that is the safe area, and I can't wait.
This is Graphics and ListAnimate functions and the robot can also be controlled using keyboard keys and I'm shouting yeah because of the movement with or without obstacles, in which the robot can continue with its linear routine and create these simulations in the Wolfram Language.