-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
⚠️ Issue: Non-Deterministic Temporal Reference & Thread Contention
The system currently suffers from Temporal Alias where logic relies on the host's system clock (import time) rather than the ROS 2 abstraction layer. Additionally, as we scale to a MultiThreadedExecutor, the shared glob_bin is vulnerable to race conditions without explicit synchronization.
🎯 Location:
/robot/vtc/pump.py
🦠 Symptoms:
time.time()ignores ROS 2 SimTime, causing consistent "Pulse Brightness" even when simulation is paused or running at 0.5x speed.- Potential
RuntimeErroror data corruption when the Pump writes to a deque while the Display or Regulator is performing amax()calculation. - Inconsistent timestamps during rosbag playback.
🩺 Diagnosis:
- Temporal Disconnect: The use of the System Wall Clock (
import time) bypasses the ROS 2 clock middleware. - Race Conditions: Using a MultiThreadedExecutor means the
display_tickandpump_cyclerun on separate threads. Simultaneous access to theglob_bindictionary is non-thread-safe in Python's high-frequency loops.
💡 Proposal:
- Synchronized Critical Sections: Implement
threading.Lock(a Mutex) to wrap all read/write operations on theglob_bin. - ROS 2 Clock Integration: Replace all
time.time()calls withself.get_clock().now()to ensure logic adheres to the use_sim_time parameter. - Hardware Discovery Probe: Use the
INITstate to validate all YAML conduit paths before starting the high-frequency harvest.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Todo