Hello mohammed alany,
As per my understanding, you have a 2D path for a robot. You would like to have N number of obstacles that move randomly in the environment, and you would like to visually see this in action.
Please refer to the demo code below. I have used an ‘occupancyMap’ in this example to showcase the animation as it visually looks the most similar to the example image you have provided. Alternatively, you could also create a ‘robotScenario’ or use ‘dynamicCapsuleList’. In the code below, I have generated N=10 obstacles and moved them all diagonally upwards. You can modify the code to have each obstacle’s location be updated based on your requirement and kinematic constraints. I have set the path of the robot to move from (90,90) to (50,50). The robot is the only one moving diagonally downwards in the example. Do consider increasing timeSteps and decreasing the change in value per timeStep to have a smoother animation. But this will come at the cost of some extra performance.
map = occupancyMap(zeros(100,100));
If you wish to read more about the following, please refer to the following documentation.
If you wish to read more about the functions used in the above code, please refer to these documentations
I hope this helps resolve the issue you were facing.