Where communities thrive


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

    andrew-gresyk on 1.11.0

    (compare)

  • Oct 18 18:14

    andrew-gresyk on experimental

    (compare)

  • Oct 18 18:14
    andrew-gresyk closed #52
  • Oct 18 18:14

    andrew-gresyk on master

    1.11.0 ^ `constexpr` friendlie… (compare)

  • Oct 18 18:14
    andrew-gresyk synchronize #52
  • Oct 18 18:14

    andrew-gresyk on experimental

    added a line break after build … (compare)

  • Oct 18 18:07
    andrew-gresyk opened #52
  • Oct 18 18:07

    andrew-gresyk on experimental

    1.11.0 ^ `constexpr` friendlie… (compare)

  • Oct 17 11:09

    andrew-gresyk on 1.10.2

    (compare)

  • Oct 17 11:07

    andrew-gresyk on experimental

    (compare)

  • Oct 17 11:07

    andrew-gresyk on master

    1.10.2 fixed AppleClang build … (compare)

  • Oct 17 11:07
    andrew-gresyk closed #51
  • Oct 17 10:45
    andrew-gresyk synchronize #51
  • Oct 17 10:45

    andrew-gresyk on experimental

    minor tweaks (compare)

  • Oct 17 10:35
    andrew-gresyk synchronize #51
  • Oct 17 10:35

    andrew-gresyk on experimental

    disabled examples/calculator (compare)

  • Oct 17 10:20
    andrew-gresyk synchronize #51
  • Oct 17 10:20

    andrew-gresyk on experimental

    converted multiple projects fro… (compare)

  • Oct 17 09:57
    andrew-gresyk synchronize #51
  • Oct 17 09:57

    andrew-gresyk on experimental

    separate gcc and clang on ubunt… (compare)

Andrew Gresyk
@andrew-gresyk
I'll need to allocate more time to building https://docs.hfsm.dev
kyle
@tastesliketriangle
Hello. I'm trying to integrate HFSM2 into my code and I'm running into a problem. I can't get the Context from a Control, only a FullControl. The docs say I should be able to, but it creates this error: the object has type qualifiers that are not compatible with the member function
Andrew Gresyk
@andrew-gresyk
Hi @tastesliketriangle please open an issue https://github.com/andrew-gresyk/HFSM2/issues/new with a minimal code sample so I can verify on my end
DJuego
@DJuego
Again. congrats for your new update, @andrew-gresyk! . Are you planning a new release soon?
Andrew Gresyk
@andrew-gresyk
Thanks, @DJuego !
Focusing on bringing https://gitter.im/andrew-gresyk/FFSM2 to close feature parity with HFSM2
Currently, only serialization and state access remain to be done
The recent updates to HFSM2 were mostly formatting and minor tweaks with very minimal functional changes
At this point the highest priority work is around a multiplayer UE4-based demo and docs
DJuego
@DJuego
I see. Thank you for your extended answer, @andrew-gresyk. :-)
DJuego
@DJuego
a new, certainly aggressive logo. :-)
Andrew Gresyk
@andrew-gresyk
Wasn't meant to be agressive, just blocky programmer art :)
DJuego
@DJuego
:-P
Andrew Gresyk
@andrew-gresyk
How's the new logo, @DJuego ?
DJuego
@DJuego
Well. I'm not an art designer. :-P
That said, the previous logo didn't displease me per se.
It's true that the new logo seems more friendly to me. Why yellow and blue?
DJuego
@DJuego
It is a delicate matter. Other projects even open logo contests, you know.
However this project probably doesn't have such a large community for that.
Whatever your soul decides will be fine, for that you are the supreme author.
In my case I have a weakness for symbolic logos. I would probably recreate myself in the recognizable/familiar scheme of a finite-state machine such as:
I would try in the HFSM2 logo to refer to its "hierarchy" or "regions" nature and in the FFSM2 logo to its "flat" nature.
DJuego
@DJuego
But it's quite a personal matter. It depends on what you want to achieve with the logo.
Andrew Gresyk
@andrew-gresyk
The colors are for some reason very pleasing to me, that's it :)
It's not as aggressive anymore, is it?
DJuego
@DJuego
Well. Yeah. More colorful, less aggressive. :-)
DJuego
@DJuego
Wow! I work in Visual Studio 2019 precisely. Thank you for improving the support, @andrew-gresyk :-)
Andrew Gresyk
@andrew-gresyk
Of course, I had the warning this morning myself, so rolled out the fix before anyone else would :)
kyle
@tastesliketriangle
so I've got a bit of a basic question. I want to have the fsm Instance as a member variable in my class, but every way I've tried to organize that has failed. part of the issue is that Instance doesn't accept a forward declaration of a state, it needs the full the from the cpp file. I guess I'm just wondering if there's an obvious way I'm missing or if there's another way I should be organizing my code?
Andrew Gresyk
@andrew-gresyk
Yup
the way I do it is I create a dedicated namespace before the class declaration
e.g. if you're in UE4, and have an AMyActor- I'd create a MyActor namespace and put all of the FSM code into it
Then I prefer letting AMyActor do all the heavy work, exposed via public API, and have the FSM call actor's functions
FSM being more of a 'brain' for the actor
DJuego
@DJuego
Wow. A new release seems imminent! I am delighted that this project (and FFSM2) is still alive. It's been a while since I've worked with your library, and I can't wait to get back to it and push it to its limits!
Andrew Gresyk
@andrew-gresyk
It is indeed :)
Of course both are alive, I'm just running out of ideas for changes.
Charles Cross
@spiderkeys_gitlab
Hi @andrew-gresyk, just wanted to follow up on your advice to @tastesliketriangle to clarify one thing about adding an instance as a class member. When you describe letting the fsm call the actor's functions, is your strategy to pass a reference/pointer to the Actor through the context, i.e. a Context struct with a reference to an Actor instance inside of it? Or is there a more direct way to just use Actor& as the Machine's context type and directly construct the FSM instance passing *this as the context object? I'm wondering if this sort of forces you to declare the FSM instance member as a pointer and create it in a deferred manner, since the Actor class would not be fully constructed at time of creation?
Andrew Gresyk
@andrew-gresyk
Hey @spiderkeys_gitlab
I'd normally just use the actor reference as context, just like you're suggesting:
class AMyActor {
using M = hfsm2::MachineT<
    hfsm2::Config::ContextT<AMyActor&>
>;

using FSM = M::Root<...>;

FSM::Instance fsm;
};
AMyActor::AMyActor()
    : fsm(*this)
Andrew Gresyk
@andrew-gresyk
Gitter wouldn't allow me to edit the above example any more for some reason to fix it a bit further, but the idea is there I think.
Latest HFSM2 / FFSM2 support references, pointers and value types as contexts, so using a pointer to an actor is also an option.
Charles Cross
@spiderkeys_gitlab
@andrew-gresyk awesome, thanks for the clarification
one more quick question, as I didn't find much info in the docs on orthogonal regions: would I be correct in intuiting that they always update their states in the order declared in the region's template?
Andrew Gresyk
@andrew-gresyk
they do, yes
DJuego
@DJuego
Well, @andrew-gresyk . Congratulations for the new version 1.9.0 of HFSM2!! It's been a while since I've worked with any project involving a finite state machine. But you can believe me: I'm looking forward to it. It is my desire to use HFSM2 in the context of a robotic platform I am working with. :-)
1 reply
Charles Cross
@spiderkeys_gitlab
Hi @andrew-gresyk, I've gotten a bit further into integrating HFSM2 into our robotics project; really nice to work with. There is one slightly unexpected behaviour that I encountered and I just wanted to check with you if there is a way of avoiding it. I modeled my overall HFSM into a 2-level state+substate, using Composite regions (with head states) as the states, and just states as the substates. There is some logic that i want to call every for every update of the region, so I overrode the head state's update() method and performed that logic there. This logic contains error checks, like loss of connectivity, timeouts expiring, etc, and is meant to pre-emptively exit the region upon detection of these issues. While this works, I noticed that when one of these errors occurred and I called changeTo<SomeOtherRegion> from the head's update method, the currently active substate update method got called immediately afterwards, despite the request to exit the region. Is this expected, and is there any way to "force" deactivation of a region immediately to avoid the region's substates getting updated? Perhaps there is a better way to achieve this? I'm trying to avoid putting the same error-checking code in every substate, since this logic is common to all of them.
Charles Cross
@spiderkeys_gitlab
I've tried a lot of alternative methods, like composing the "State" as an orthogonal region containing the "pre-update check" state and the original Composite region containing the substates (same behaviour as just doing the check/transition in the Composite's head state), as well as trying to use an Injection's preUpdate() method to call a lambda with a reference to the FSM that evokes the transition (the inner state's update methods still get called here as well).
Apologies if this just sounds like word soup to you :sweat_smile:
Charles Cross
@spiderkeys_gitlab
So far my only working approach is to create a map of StateID->PreUpdate std::functions and evoke "state_preupdate_functions fsm.stateId() ;" before each fsm.update() in the main loop.
But I was hoping to find a way to embed the logic into the FSM transition-related code self-contained
Andrew Gresyk
@andrew-gresyk

Hey @spiderkeys_gitlab
Thank you!
What you can do - is use event handling for handling errors.
There's an example in https://github.com/andrew-gresyk/HFSM2/blob/master/examples/advanced_event_handling/main.cpp for that.

You can have your FSM react() to CheckForErrors event before the recursive update()

Charles Cross
@spiderkeys_gitlab
Thanks, that seems to work pretty well!
Andrew Gresyk
@andrew-gresyk
Awesome ;)
DJuego
@DJuego
I have not used HFSM for some time but I am delighted that the development is still alive. :-) Thanks @andrew-gresyk. For me your HFSM2 still holds the gold medal in the FSM specialty.
Andrew Gresyk
@andrew-gresyk
thanks @DJuego ;)