Conversation
Greptile OverviewGreptile SummaryThis PR makes three main changes to fix semantic navigation issues: Changes Made
Critical Issues
Additional concerns:
ImpactThe image payload optimization successfully addresses timeout issues, but the critical bug in error handling will cause runtime crashes when TF transforms are temporarily unavailable, which is a common scenario during system startup or network interruptions. Confidence Score: 2/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant SM as SpatialMemory
participant TF as TF System (LCMTF)
participant VDB as SpatialVectorDB
participant VM as VisualMemory
Note over SM: start() method called
SM->>TF: Access self.tf (triggers lazy init)
TF-->>SM: LCMTF instance created
Note over SM: sleep(1.0) - wait for TF
Note over SM: Periodic _process_frame()
SM->>TF: get("world", "base_link")
alt TF transform available
TF-->>SM: Transform object
SM->>SM: tf.to_pose()
SM->>SM: Compute embedding
SM->>VDB: add_image_vector(id, image, embedding, metadata)
VDB->>VM: add(id, image)
Note over VM: Image stored
VDB->>VDB: Add to ChromaDB
else TF transform unavailable
TF-->>SM: None
Note over SM: ❌ BUG: Continues execution
SM->>SM: tf.to_pose() - AttributeError!
end
Note over SM: Query operations
SM->>VDB: query_by_text(text, limit)
VDB->>VDB: Generate text embedding
VDB->>VDB: Query ChromaDB
Note over VDB: Images NOT retrieved (commented out)
VDB-->>SM: Results (metadata only, no images)
|
| if tf is None: | ||
| logger.warning("No TF transform (map -> base_link) available") |
There was a problem hiding this comment.
The code continues execution even when tf is None, which will cause an AttributeError on line 233 when tf.to_pose() is called. The return statement should be executed when tf is None, not just a warning.
| if tf is None: | |
| logger.warning("No TF transform (map -> base_link) available") | |
| if tf is None: | |
| logger.warning("No TF transform (world -> base_link) available") | |
| return |
| return | ||
|
|
||
| if tf is None: | ||
| logger.warning("No TF transform (map -> base_link) available") |
There was a problem hiding this comment.
The warning message is inconsistent with the actual code. Line 224 now requests "world -> base_link" transform, but the warning message still says "map -> base_link".
| logger.warning("No TF transform (map -> base_link) available") | |
| logger.warning("No TF transform (world -> base_link) available") |
| _ = self.tf | ||
| import time | ||
|
|
||
| time.sleep(1.0) |
There was a problem hiding this comment.
The workaround of accessing self.tf and sleeping for 1 second is brittle and doesn't guarantee the TF system is properly initialized. This introduces a race condition where the module may not be ready even after 1 second, or may waste time sleeping when it's already ready.
Consider using a more robust initialization approach:
- Add a check to verify TF is receiving transforms before proceeding
- Use a timeout-based loop that polls for TF availability instead of a fixed sleep
- Or document why exactly 1 second is needed and what specific initialization it's waiting for
| _ = self.tf | ||
| import time | ||
|
|
||
| time.sleep(1.0) |
| tf = self.tf.get("world", "base_link") | ||
|
|
||
| if tf is None: | ||
| logger.warning("No TF transform (world -> base_link) available") |
Fix for semantic navigation
= Fixed TF error
=Removed sending full image to avoid timeout