A method for monitoring movement of a moving object and avoiding a
collision with it comprises constructing a panoramic image from images of
a rotating camera attached to the moving object, constructing a virtual
cuboid around the moving object utilizing data from the panoramic image,
calculating a difference between a position of the cuboid and a position
of an obstacle, and changing a moving direction of the moving object if
the difference between the position of the cuboid and the position of an
obstacle is smaller than a threshold value to avoid the obstacle.