import math
from simulation.utils.road.sections.start_box import StartBox
[docs]def draw_walls(start_box: StartBox):
return model(
x=start_box.startbox_position.x,
y=start_box.startbox_position.y,
z=0,
orientation=math.pi,
name="start_box_walls",
mesh="startbox_walls",
)
[docs]def draw_gate(start_box: StartBox):
return model(
x=start_box.startbox_gate_position.x,
y=start_box.startbox_gate_position.y,
z=0,
orientation=math.pi,
name="start_box_gate",
mesh="startbox_gate",
)
[docs]def model(x, y, z, orientation, name, mesh):
return f"""
<model name='{name}'>
<plugin filename="libmodel_plugin_link.so" name="model_plugin_link"/>
<static>1</static>
<link name='link'>
<visual name='visual'>
<cast_shadows>1</cast_shadows>
<geometry>
<mesh>
<uri>file://meshes/{mesh}.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</visual>
<self_collide>0</self_collide>
</link>
<pose>{x} {y} {z} {0} 0 {orientation}</pose>
</model>
"""