Skip to content

Conversation

@Johnarman1398
Copy link

Add StateManager implementation into vda5050_core

This PR implements tracking of VDA 5050-compliant state information.

@Johnarman1398 Johnarman1398 requested a review from sauk2 November 25, 2025 09:04
@Johnarman1398 Johnarman1398 self-assigned this Nov 25, 2025
Copy link
Member

@sauk2 sauk2 left a comment

Choose a reason for hiding this comment

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

Thanks for PR! I have provided some initial review comments.

I feel there are some features still missing from the StateManager class,

  • Getters and setters for the action_states variable
  • Function to set the header. I would expect the users to directly serialize the vda5050_types::State class into nlohmann::json and in the current implementation get_state would be missing the header fields.
  • Function to update the order progress. There is no way to update the last_node_id and last_node_sequence_id fields. In our current design, these fields will be read by the OrderManager to increment the order and dispatch the next node/edge.

I also have a general comment on the API design. Most of the get functions return references to fields inside the internal robot_state_ object. This works only under the assumption that the StateManager outlives all consumers of those references and callers never store those references beyond the StateManager’s lifetime.

If the StateManager were ever destroyed earlier than expected, any stored references would become dangling and could lead to undefined behavior as it tightly couples the lifetime of external code to the lifetime of StateManager.

We should discuss whether returning values would make the API safer, especially if the StateManager is ever used without our execution engine. I would also like to include @Briancbn in this discussion for his thoughts!

$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

add_library(state_manager src/vda5050_core/state_manager/state_manager.cpp)
Copy link
Member

Choose a reason for hiding this comment

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

Let's change the library name to client that includes all the state and order related features. The order related code will be added to the same library

Copy link
Member

Choose a reason for hiding this comment

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

I think you missed this change

@sauk2
Copy link
Member

sauk2 commented Nov 26, 2025

@Johnarman1398 you can ignore the CI failures for now. The failing tests are due to failure to connect to the online MQTT broker. I will try to investigate this issue.

@sauk2
Copy link
Member

sauk2 commented Nov 26, 2025

I will try to investigate this issue.

The issue seems to have solved itself XD

@Johnarman1398 Johnarman1398 requested a review from sauk2 December 2, 2025 08:43
Copy link
Member

@sauk2 sauk2 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. I think this PR is almost ready to be merged!

@Johnarman1398 Johnarman1398 requested a review from sauk2 December 9, 2025 08:31
Copy link
Member

@sauk2 sauk2 left a comment

Choose a reason for hiding this comment

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

Looks good! I will merge it in once you make that remaining change

$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

add_library(state_manager src/vda5050_core/state_manager/state_manager.cpp)
Copy link
Member

Choose a reason for hiding this comment

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

I think you missed this change

@sauk2 sauk2 merged commit 9617e46 into develop Dec 9, 2025
3 of 4 checks passed
@sauk2 sauk2 deleted the feat/dev-state-manager branch December 9, 2025 08:55
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