by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 27 20:18

    andrew-gresyk on 1_5

    (compare)

  • Jun 27 20:14

    andrew-gresyk on experimental

    (compare)

  • Jun 27 20:14

    andrew-gresyk on master

    + hid plan-related functionalit… Merge pull request #19 from and… (compare)

  • Jun 27 20:14
    andrew-gresyk closed #19
  • Jun 27 19:00
    andrew-gresyk ready_for_review #19
  • Jun 27 19:00
    andrew-gresyk edited #19
  • Jun 27 18:59
    andrew-gresyk opened #19
  • Jun 27 18:58

    andrew-gresyk on experimental

    + hid plan-related functionalit… (compare)

  • Jun 26 06:57

    andrew-gresyk on 1_4

    (compare)

  • Jun 26 06:57

    andrew-gresyk on access

    (compare)

  • Jun 26 06:57

    andrew-gresyk on build

    (compare)

  • Jun 26 06:53

    andrew-gresyk on experimental

    (compare)

  • Jun 26 06:53

    andrew-gresyk on master

    Experimental (#18) + documente… (compare)

  • Jun 26 06:53
    andrew-gresyk closed #18
  • Jun 26 06:51
    andrew-gresyk ready_for_review #18
  • Jun 26 06:18
    andrew-gresyk opened #18
  • Jun 26 06:15

    andrew-gresyk on experimental

    * fixed linking issues with fea… (compare)

  • Jun 21 14:41

    andrew-gresyk on experimental

    + documented most methods and c… (compare)

  • Jun 21 14:23

    andrew-gresyk on experimental

    (compare)

  • May 26 07:45

    andrew-gresyk on master

    Create FUNDING.yml (compare)

Alexis Paques
@AlexisTM
@andrew-gresyk Is there any reason for the "all in one file machine.hpp"?
Andrew Gresyk
@andrew-gresyk
@AlexisTM seems to be the standard among the header-only libraries
e.g. https://github.com/catchorg/Catch2/tree/master/single_include/catch2
Alexis Paques
@AlexisTM

I have to say that I am not used to doing so; It is indeed handy to use if we copy-paste the code into the project, but that is forbidden (company policy) and that (copying the code) also makes it unmaintainable/hard to find licenses.
We are using Eigen, for example, https://gitlab.com/libeigen/eigen and there is no such thing as a single file include. Instead, you include what you use, making it compiling faster.

For the build tool, we use catkin (overlay over cmake) and we install all out headers and header-only libraries in our install space such as /workspace/include/hfsm2/...

It might help some people that use the project so I am not against merging it but I felt it was strange to do. (it is much smaller than Eigen for example)

Is there a way to output the transitions? I explored the STRUCTURE_REPORT, but that only gives the current state (which is already nice to have).
Andrew Gresyk
@andrew-gresyk
Maybe I don't understand which the issue you're referring to by "single include".
It's just a file with all the HFSM2 sources merged into a single file for user convenience.
Andrew Gresyk
@andrew-gresyk
#define HFSM_ENABLE_STRUCTURE_REPORT also enables const ActivityHistory& Root::activityHistory() const
With HFSM_ENABLE_LOG_INTERFACE and optionally HFSM_ENABLE_VERBOSE_DEBUG_LOG you can use https://github.com/andrew-gresyk/HFSM2/blob/master/include/hfsm2/detail/debug/logger_interface.hpp to log the method calls.
Andrew Gresyk
@andrew-gresyk
Thirdly, I'm currently working on the exposing the last transitions and replaying them for the purposes of network replication.
.. including the ability to serialize FSM 'state', e.g. for save / load support
DJuego
@DJuego
Wow, that sounds like very promising news @andrew-gresyk !!
Alexis Paques
@AlexisTM
That is great!
Andrew Gresyk
@andrew-gresyk

As a part of the replication-related package, I've added:

#ifdef HFSM_ENABLE_TRANSITION_HISTORY
    const TransitionHistory& transitionHistory() const;

    void replayTransition (const Transition& transition);
    void replayTransitions(const Transition* const transitions, const uint64_t count);
#endif

.. to the Root

Alexis Paques
@AlexisTM

We receive events such as GenerateEvent{SomeParameters} in the state Idle, and want to:

  • Change the state to Generating
  • Use the payload of the event to do logic in Generating.

Is this only doable by saving the data to the context and then use changeTo<Generating>()?

Andrew Gresyk
@andrew-gresyk
You can use state access for that
Andrew Gresyk
@andrew-gresyk
Have a look at andrew-gresyk/HFSM2#14, @jfflak had a similar scenario I think
Alexis Paques
@AlexisTM
Thanks!
Andrew Gresyk
@andrew-gresyk
@/all 1.3 adds serialization support.
Together with transition history, it can be used to implement efficient FSM network replication.
DJuego
@DJuego
Now that's fantastic news, @andrew-gresyk . Thank you! Although I don't have an immediate application for that feature, I sense its potential. I've seen the example it provides. It seems very straightforward. :-)
Do you plan to implement any other features imminently for 1.4? :-}
Andrew Gresyk
@andrew-gresyk
Thanks @DJuego
There's a high priority andrew-gresyk/HFSM2#17 that needs fixing
I've got an idea for a small memory optimization by storing internal bookkeeping info more efficentinly
Planning to add a behavior tree style region and matching transition (Root::select<TState>())
Build an example for a replicated actor in Unreal Engine 4 using recently added serialization and transition history features
Long term I'm working on a visual editor, but that's very far ahead
I'll be spending more time documenting HFSM2 API using in-line method comments and building up https://doc.hfsm.dev/, and https://doc.hfsm.dev/practical-topics in particular
Is there anything specific you'd like to see in HFSM2?
DJuego
@DJuego
Well. Right now I'm at a stage where I'm trying to adapt to what HFMS2 already offers.
. I don't have a developed criteria about finite state machines like thinking of correct ways to modify your work.
DJuego
@DJuego
That said; The selector region seems to me a pretty intuitive idea. :-)
Thank you for your efforts in documentation!
Alexis Paques
@AlexisTM
@andrew-gresyk Did you ever get problems by building an HFSM in a library and use it in an executable?
At first, I tested HFSM2 making a header only (except main) app with logging enabled.
I now build the HFSM in a library (header + cpp) which is then linked to the main executable. When doing so, I currently get a Segmentation fault when the logger is enabled in Release mode and works in Debug/RelWithDebugInfo.
I'll upgrade to 1.3.1 and tell you how it goes
Alexis Paques
@AlexisTM
This happens on 1.3.1 with an empty Logger; I will try to create the minimal example
Alexis Paques
@AlexisTM
I fail to reproduce it (and cannot share the code :/ )
Andrew Gresyk
@andrew-gresyk
@AlexisTM The entire HFSM2 including all states and bookkeeping info is just one struct, and the logger is about the only 'external' pointer in that struct.
One option could be to add some other code to access the logger pointer from the side of the library and see if that's causing any issues?
DJuego
@DJuego
Congrats for the last release 1.4, @andrew-gresyk .
Andrew Gresyk
@andrew-gresyk
Thanks @DJuego
The official announcement will follow with some docs to explain the chanes
Let me say for now, I've documented most of the API using doxygen-style comments as @AlexisTM suggested
And in the effort to cut down build times, the advanced functionality has been hidden under respective macros
Btw, @AlexisTM which IDE / plugins are you using to show the API comments?
Alexis Paques
@AlexisTM
I am using VSCode with standard Intellisense. This works for all methods that depend on the machine/context/...; If no Doxygen (or other) is available, it will show the comment directly on top of the declaration (if available, thus should be in the header);
image.png
image.png
This is incredibly powerful for teams working on different interlocked projects.
Andrew Gresyk
@andrew-gresyk
Gotcha, ty!
dotkt
@dotkt
hi
is there any way to translate a xmind file into c++ code?
i mean state machine
write state machine code is painful
Andrew Gresyk
@andrew-gresyk
hey @dotkt
I haven't thought of it, but this is an awesome idea
if you want to take on such project - I'll be happy to assist
Alexis Paques
@AlexisTM
@dotkt With HFSM2, making the machine is not that painful ;)
The opposite is also possible, output the StateMachine from C++ code (python, clang & graphviz)
Andrew Gresyk
@andrew-gresyk

@AlexisTM

@dotkt With HFSM2, making the machine is not that painful ;)

<3

The opposite is also possible, output the StateMachine from C++ code (python, clang & graphviz)

Yes. Several people already suggested I wrote a code generator / editor for HFSM2.
That would require a dedicated effort, which is not something I can afford with a full-time job :)
Also, supporting that tool would be an on-going commitment.
That said, if anyone wanted to take on such project - I'd support them (with advice / guidance) to the best of my ability.

Andrew Gresyk
@andrew-gresyk
BTW, I'm working on transition payloads. The API is likely going to look like this:
FSM::Instance::changeWith<TState>(const TPayload& payload)
and
FSM::Instance::changeWith(const StateID stateId, const TPayload& payload)
for all existing transition methods (resume(), restart(), utilize(), randomize() and schedule())
Alexis Paques
@AlexisTM
@dotkt also, no generator fits them all. I cannot find how we can generate a nice code for HFSM2 as we have to do transitions in the code itself. Meaning your logic would be overwritten.