It was narrated from Musa bin Talhah that his father said: “We used to perform prayer while the beasts were passing in front of us. That was mentioned to the Messenger of Allah (ﷺ) and he said: ‘If something like the hand of a saddle* is placed in front of anyone of you, it will not matter whoever passes in front of him.”
It was narrated that Ibn ‘Umar said: “A small spear (Harbah) would be brought out to the Prophet (ﷺ) when he was travelling; he would plant it (in the ground) to perform prayer while facing it.”
It was narrated that ‘Aishah said: “The Messenger of Allah had a reed mat that he would spread out during the day, and make into a compartment at night, towards which he would perform prayer.”
It was narrated from Abu Hurairah that the Prophet (ﷺ) said: “When anyone of you performs prayer, let him put something in front of him. If he cannot find anything then let him put a stick. If he cannot find one, then let him draw a line. Then it will not matter if anything passes in front of him.”