Skip to content

C++ State Machine Library - #56

Open
jbrhm wants to merge 28 commits into
mainfrom
JRA/state-machine
Open

C++ State Machine Library#56
jbrhm wants to merge 28 commits into
mainfrom
JRA/state-machine

Conversation

@jbrhm

@jbrhm jbrhm commented Nov 25, 2024

Copy link
Copy Markdown
Contributor

Summary

Closes #34

What features did you add, bugs did you fix, etc?
Added a C++ State Machine Library

Did you add documentation to the wiki?

No

How was this code tested?

Created a test state machine with two states which had non-trivial constructors. They then transitioned between themselves. Made sure all of the static asserts caught invalid states. Updated visualizer.py to interface with multiple state publishers.

Did you test this in sim?

No, sim is not explicitly involved in a state machine

Did you test this on the rover?

No, the rover is not explicitly involved in a state machine

Did you add unit tests?

No

@jbrhm jbrhm self-assigned this Nov 25, 2024
Comment thread state_machine/state.hpp
Comment thread state_machine/state.hpp Outdated
Comment thread state_machine/state_machine.hpp
Comment thread state_machine/state_machine.hpp Outdated
Comment thread state_machine/state_publisher_server.hpp Outdated
Comment thread state_machine/state_publisher_server.hpp Outdated

std::vector<std::reference_wrapper<std::type_info const>> types{std::ref(typeid(To))...};
for(auto const& type : types){
demangledName = abi::__cxa_demangle(type.get().name(), nullptr, nullptr, &status);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wtf

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its c++filt... but in C++ 💯

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is unholy. Just have states carry a static member for the name...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

unholy is harsh... 😢 but it is p cool 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create C++ State Lib for Letter Detection

4 participants