]
+def gen_obst_at(x, y, h):
+ """Generate obstacle at specific coordinates."""
+ length = 0.5
+ width = 0.5
+ return [
+ [
+ x + width/2 * cos(h - pi/2) + length/2 * cos(h),
+ y + width/2 * sin(h - pi/2) + length/2 * sin(h),
+ ],
+ [
+ x + width/2 * cos(h - pi/2) - length/2 * cos(h),
+ y + width/2 * sin(h - pi/2) - length/2 * sin(h),
+ ],
+ [
+ x + width/2 * cos(h + pi/2) - length/2 * cos(h),
+ y + width/2 * sin(h + pi/2) - length/2 * sin(h),
+ ],
+ [
+ x + width/2 * cos(h + pi/2) + length/2 * cos(h),
+ y + width/2 * sin(h + pi/2) + length/2 * sin(h),
+ ],
+ [
+ x + width/2 * cos(h - pi/2) + length/2 * cos(h),
+ y + width/2 * sin(h - pi/2) + length/2 * sin(h),
+ ]]
+
+
def gen_obst():
"""Generate obstacles array."""
obstacles = []