feat(scene): semantic scene understanding — YOLOv8n TRT + room classification + hazards (Issue #141) #153
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-perception/issue-141-scene-understanding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue #141 — Semantic Scene Understanding
Summary
saltybot_scene_msgs— 4 msgs:SceneObject,SceneObjectArray,RoomClassification,BehaviorHintsaltybot_scene— 3 nodes: scene detector (YOLOv8n TRT FP16), behavior adapter, Nav2 costmap publisherArchitecture
Detection Classes
Scene-filtered COCO subset: person, cat, dog, chair, couch, potted plant, dining table, toilet, tv, microwave, oven, sink, refrigerator + custom: door (80), stairs (81), wet_floor (82)
Hazard Detection
Room Classification
Rule-based (always): object co-occurrence weights → softmax → room type (8 classes)
MobileNetV2 TRT (optional): 224×224 RGB → 8 logits; built via
build_scene_trt -- --roomBehavior Adaptation
Nav2 Integration
Obstacle cloud: ring of PointCloud2 points around each object (radius 0.15m normal, 0.4m for hazards) → Nav2
obstacle_layerviaobservation_sources. Config snippet inscene_params.yaml.Test Plan
colcon build --packages-select saltybot_scene_msgs saltybot_sceneros2 run saltybot_scene build_scene_trt— builds TRT engineros2 launch saltybot_scene scene_understanding.launch.pyros2 topic hz /social/scene/objects→ ≥15 Hzros2 topic hz /social/scene/room_type→ ~2 Hzros2 topic echo /social/scene/room_type→ correct room nameros2 topic echo /social/scene/behavior_hint→ speed/personality updates/social/scene/hazardspublishes HAZARD_STAIRSros2 topic hz /social/scene/obstacle_cloud→ objects visible in costmap🤖 Generated with Claude Code
New packages: saltybot_scene_msgs — 4 msgs (SceneObject, SceneObjectArray, RoomClassification, BehaviorHint) saltybot_scene — 3 nodes + launch + config + TRT build script Nodes: scene_detector_node — YOLOv8-nano TRT FP16 (target ≥15 FPS @ 640×640); synchronized RGB+depth input; filters scene classes (chairs, tables, doors, stairs, pets, appliances); 3D back-projection via aligned depth; depth-based hazard scan (HazardClassifier); room classification at 2Hz; publishes /social/scene/objects + /social/scene/hazards + /social/scene/room_type behavior_adapter_node — adapts speed_limit_mps + personality_mode from room type and hazard severity; publishes BehaviorHint on /social/scene/behavior_hint (on-change + 1Hz heartbeat) costmap_publisher_node — converts SceneObjectArray → PointCloud2 disc rings for Nav2 obstacle_layer + MarkerArray for RViz; publishes /social/scene/obstacle_cloud Modules: yolo_utils.py — YOLOv8 preprocess/postprocess (letterbox, cx/cy/w/h decode, NMS), COCO+custom class table (door=80, stairs=81, wet=82), hazard-by-class mapping room_classifier.py — rule-based (object co-occurrence weights + softmax) with optional MobileNetV2 TRT/ONNX backend (Places365-style 8-class) hazard_classifier.py — depth-only hazard patterns: drop (row-mean cliff), stairs (alternating depth bands), wet floor (depth std-dev), glass (zero depth + strong Sobel edges in RGB) scripts/build_scene_trt.py — export YOLOv8n → ONNX → TRT FP16; optionally build MobileNetV2 room classifier engine; includes benchmark Topic map: /social/scene/objects SceneObjectArray ~15+ FPS /social/scene/room_type RoomClassification ~2 Hz /social/scene/hazards SceneObjectArray on hazard /social/scene/behavior_hint BehaviorHint on-change + 1 Hz /social/scene/obstacle_cloud PointCloud2 Nav2 obstacle_layer /social/scene/object_markers MarkerArray RViz debug Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>