Update app.py
Browse files
app.py
CHANGED
|
@@ -223,11 +223,8 @@ OBSTACLE_COUNT = 10
|
|
| 223 |
with gr.Blocks() as demo:
|
| 224 |
gr.Markdown("# 2D SLAM Simulation")
|
| 225 |
with gr.Row():
|
| 226 |
-
|
| 227 |
env_img = gr.Image(label="Environment View", height=SPACE_SIZE, width=SPACE_SIZE)
|
| 228 |
-
|
| 229 |
-
#slam_img = gr.Image(label="SLAM Map View", shape=(SPACE_SIZE, SPACE_SIZE))
|
| 230 |
-
slam_img = draw_slam_map(state.robot_pose, state.slam_points, scan_range)
|
| 231 |
with gr.Row():
|
| 232 |
scan_range_slider = gr.Slider(1.0, 10.0, value=SCAN_RANGE_DEFAULT, step=0.1, label="Laser Scan Range")
|
| 233 |
obstacle_count_slider = gr.Slider(0, 30, value=OBSTACLE_COUNT, step=1, label="Obstacle Count")
|
|
@@ -235,7 +232,6 @@ with gr.Blocks() as demo:
|
|
| 235 |
step_btn = gr.Button("Step")
|
| 236 |
reset_btn = gr.Button("Reset")
|
| 237 |
record_toggle = gr.Checkbox(label="Record Video")
|
| 238 |
-
|
| 239 |
status_text = gr.Textbox(value="Simulation ready.", interactive=False)
|
| 240 |
|
| 241 |
reset_btn.click(reset_simulation, inputs=obstacle_count_slider, outputs=[env_img, slam_img, status_text])
|
|
@@ -243,3 +239,4 @@ with gr.Blocks() as demo:
|
|
| 243 |
record_toggle.change(toggle_recording, inputs=record_toggle, outputs=None)
|
| 244 |
|
| 245 |
demo.launch()
|
|
|
|
|
|
| 223 |
with gr.Blocks() as demo:
|
| 224 |
gr.Markdown("# 2D SLAM Simulation")
|
| 225 |
with gr.Row():
|
|
|
|
| 226 |
env_img = gr.Image(label="Environment View", height=SPACE_SIZE, width=SPACE_SIZE)
|
| 227 |
+
slam_img = gr.Image(label="SLAM Map View", height=SPACE_SIZE, width=SPACE_SIZE)
|
|
|
|
|
|
|
| 228 |
with gr.Row():
|
| 229 |
scan_range_slider = gr.Slider(1.0, 10.0, value=SCAN_RANGE_DEFAULT, step=0.1, label="Laser Scan Range")
|
| 230 |
obstacle_count_slider = gr.Slider(0, 30, value=OBSTACLE_COUNT, step=1, label="Obstacle Count")
|
|
|
|
| 232 |
step_btn = gr.Button("Step")
|
| 233 |
reset_btn = gr.Button("Reset")
|
| 234 |
record_toggle = gr.Checkbox(label="Record Video")
|
|
|
|
| 235 |
status_text = gr.Textbox(value="Simulation ready.", interactive=False)
|
| 236 |
|
| 237 |
reset_btn.click(reset_simulation, inputs=obstacle_count_slider, outputs=[env_img, slam_img, status_text])
|
|
|
|
| 239 |
record_toggle.change(toggle_recording, inputs=record_toggle, outputs=None)
|
| 240 |
|
| 241 |
demo.launch()
|
| 242 |
+
|