feat: raise second floor to 28 meters

This commit is contained in:
2026-10-31 16:09:19 +07:00
parent 56abc94642
commit b75196be9a
11 changed files with 386 additions and 242 deletions

View File

@@ -13,7 +13,8 @@ SIZE = 2048
ORIGIN = -51.2
FREE = 254
OCCUPIED = 0
FLOOR_2_Z = 14.0
FLOOR_2_Z = 28.0
ELEVATOR_TRAVEL_SPEED = 2.2
FLOORS = ((1, 0.0), (2, FLOOR_2_Z))
WAREHOUSE_HALF = 46.0
SHELL_WALL_THICKNESS = 0.30
@@ -410,7 +411,7 @@ def elevator_components():
0.08, 0.08, FLOOR_2_Z, "0.19 0.22 0.25 1"))
out.append(model_box("elevator_guide_right", 40.78, 1.48, FLOOR_2_Z / 2.0,
0.08, 0.08, FLOOR_2_Z, "0.19 0.22 0.25 1"))
out.append('''<plugin name="two_floor_elevator_controller" filename="libtwo_floor_elevator_gazebo_plugin.so">
out.append(f'''<plugin name="two_floor_elevator_controller" filename="libtwo_floor_elevator_gazebo_plugin.so">
<elevator_id>sim_elevator</elevator_id><car_id>sim_car_1</car_id>
<car_model>elevator_car</car_model><robot_model>robot</robot_model>
<door_floor_1_left_model>landing_door_floor_1_left</door_floor_1_left_model>
@@ -420,8 +421,8 @@ def elevator_components():
<car_door_left_model>elevator_car_door_left</car_door_left_model>
<car_door_right_model>elevator_car_door_right</car_door_right_model>
<floor_1_id>floor_1</floor_1_id><floor_2_id>floor_2</floor_2_id>
<floor_1_z>0.0</floor_1_z><floor_2_z>14.0</floor_2_z>
<travel_speed>1.1</travel_speed><travel_timeout>30.0</travel_timeout>
<floor_1_z>0.0</floor_1_z><floor_2_z>{FLOOR_2_Z}</floor_2_z>
<travel_speed>{ELEVATOR_TRAVEL_SPEED}</travel_speed><travel_timeout>30.0</travel_timeout>
<door_travel_time>1.5</door_travel_time><door_open_timeout>12.0</door_open_timeout>
<door_leaf_open_offset>1.4</door_leaf_open_offset><door_pocket_offset_x>0.15</door_pocket_offset_x>
<cabin_half_x>1.4</cabin_half_x><cabin_half_y>1.4</cabin_half_y>
@@ -498,30 +499,33 @@ def build_world():
model_box("stairwell_guard_south", -40.0, -25.0, rail_z, 8.0, 0.12, 1.16, "0.86 0.62 0.12 1"),
))
# Switchback stair keeps the rise practical and leaves a guarded mezzanine opening.
steps_per_flight = 20
# Eight switchback flights fit the existing blocked stairwell footprint.
# The perimeter remains guarded; this stair is decorative, not a robot route.
flights, steps_per_flight = 8, 20
flight_run = 6.84
flight_rise = (FLOOR_2_Z - 0.35) / 2.0
for step in range(steps_per_flight):
along = step * (flight_run / (steps_per_flight - 1))
rise = step * (flight_rise / (steps_per_flight - 1))
out.append(model_box(f"stair_flight_1_step_{step:02d}", -43.5 + along, -22.8,
0.18 + rise, 0.50, 3.0, 0.18, "0.54 0.57 0.59 1"))
out.append(model_box(f"stair_flight_2_step_{step:02d}", -36.66 - along, -18.0,
7.18 + rise, 0.50, 3.0, 0.18, "0.58 0.60 0.61 1"))
out.append(model_box("stair_mid_landing", -36.5, -20.5, 7.0,
2.2, 7.0, 0.18, "0.48 0.52 0.55 1"))
rail_length = 9.7
out.extend((
model_box("stair_flight_1_rail_south", -40.08, -24.35, 4.30,
rail_length, 0.10, 0.10, "0.20 0.25 0.29 1", pitch=-0.771),
model_box("stair_flight_1_rail_north", -40.08, -21.25, 4.30,
rail_length, 0.10, 0.10, "0.20 0.25 0.29 1", pitch=-0.771),
model_box("stair_flight_2_rail_south", -40.08, -19.55, 11.30,
rail_length, 0.10, 0.10, "0.20 0.25 0.29 1", pitch=0.771),
model_box("stair_flight_2_rail_north", -40.08, -16.45, 11.30,
rail_length, 0.10, 0.10, "0.20 0.25 0.29 1", pitch=0.771),
))
flight_rise = FLOOR_2_Z / flights
step_rise = flight_rise / steps_per_flight
rail_length = hypot(flight_run, flight_rise)
rail_pitch = atan2(flight_rise, flight_run)
for flight in range(flights):
forward = flight % 2 == 0
lane_y = -22.8 if forward else -18.0
for step in range(steps_per_flight):
along = step * flight_run / (steps_per_flight - 1)
x = -43.5 + along if forward else -36.66 - along
z = flight * flight_rise + (step + 1) * step_rise - 0.09
out.append(model_box(f"stair_flight_{flight + 1}_step_{step:02d}", x, lane_y, z,
0.50, 3.0, 0.18, "0.54 0.57 0.59 1"))
for side, dy in (("south", -1.55), ("north", 1.55)):
out.append(model_box(f"stair_flight_{flight + 1}_rail_{side}", -40.08, lane_y + dy,
flight * flight_rise + flight_rise / 2.0 + 1.0,
rail_length, 0.10, 0.10, "0.20 0.25 0.29 1",
pitch=-rail_pitch if forward else rail_pitch))
if flight < flights - 1:
landing_x = -36.7 if forward else -43.3
out.append(model_box(f"stair_landing_{flight + 1}", landing_x, -20.4,
(flight + 1) * flight_rise - 0.09,
1.3, 7.8, 0.18, "0.48 0.52 0.55 1"))
# Factory traffic: receiving, mixed rack storage, two production conveyors,
# assembly work cells, packing benches, boxed pallets, and dispatch staging.