Skip to content

fix simtime update in write_FM and write_SM functions#351

Merged
pradeeban merged 1 commit intoControlCore-Project:devfrom
Sahil-u07:fix/cpp-simtime-update
Feb 18, 2026
Merged

fix simtime update in write_FM and write_SM functions#351
pradeeban merged 1 commit intoControlCore-Project:devfrom
Sahil-u07:fix/cpp-simtime-update

Conversation

@Sahil-u07
Copy link
Copy Markdown
Contributor

While porting behavior from Python to C++, I found that [write_FM] and [write_SM] were writing timestamps into the output but never advancing the [simtime] member. That left simulations stuck at the same time across steps.

This change makes the C++ functions increment [simtime] by [delta] immediately after a successful write (vector payloads only, matching the Python implementation).

Copilot AI review requested due to automatic review settings February 16, 2026 00:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a critical bug where the C++ write_FM and write_SM functions were writing timestamps into output files but failing to advance the simtime member variable, causing simulations to be stuck at the same time across steps. The fix adds simtime += delta statements immediately after successful writes in both functions, matching the behavior of the Python reference implementation.

Changes:

  • Added simtime += delta to write_FM function for vector payloads after successful file write
  • Added simtime += delta to write_SM function for vector payloads after successful shared memory write

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pradeeban pradeeban merged commit 315d3f4 into ControlCore-Project:dev Feb 18, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants