-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idiomatic way to loop tree logic #62
Comments
Hi there! Regarding the given options I will be able to take a look in the evening. |
Yeah, It is hard to estimate the best solution here as I don't know the goal of the task. Can you elaborate on it maybe?
Meanwhile, my thoughts:
The idea, in its turn, seems pretty good in general.
But those are just details.
If you think, it should be decorator, we can add it as well.
|
Circling back to this issue as I think it should block part of #65. First some context. The workaround I found for this issue was simply to not use the daemons at all. Since there were no daemons, clean up is trivial and doesn't take too much time. This actually turned out to be a huge win for me, as it meant I could reuse patterns from the rest of my codebase for the work the daemons would otherwise do. I now have a very strong preference to use Forester as a component of my application (e.g. as a library) rather than the core of my application (e.g. as a framework). The link to #65 relates to preventing the Now for the solution. I'd like to propose we add three new functions to the API of
This design allows for:
I'm very interested to get your thoughts on the above. |
Yeah, the thing was initially to decouple writing bt code from Rust and it is more like a framework approach rather than a library. In that paradigm, the daemons are vital to provide the background ops. But of course, having it as a library, you can handle all background processes independently as well.
Yeah, I agree, it does not look good. But the whole delay decorator is slightly our of the conception of the tree since it does not operate the real time. The methods:
I agree, the method will enable to use Forester as a lib.
Will the restart lose the information about the current state? For instance, there's a
maybe rename to clean() or finalize() operation and stop the HTTP server also? I recon, the idea is very strong and seems to be super useful. |
That's a very good point about To do it properly I suspect a call to Since I don't personally have any current need to Combined with your other suggestion that leaves two new functions:
P.S. I've just realised we might have a running node if a reactive check returns |
That sounds very good to me. |
Hi there,
I've been using forester for the last few days, nice work creating a library that's well documented with a full feature set.
My use case will involve re-running the same tree several times a second, and so it would be excellent for the library to support this in an efficient way. Crucially, I would like to avoid restarting the daemons each time the tree is re-run.
I've outlined a few potential designs for how this might be achieved below, roughly in order of usability I think they'd expose to the user:
forester_rs::runtime::forester::Forester
to separate ticking the tree from cleaning up the tree, which could be done either by:Forester
struct to avoid shutting down the HTTP server and daemons afterrun()
returns (I think this would be the easiest to implement), e.g.KeepRunningUntilFailure
decorator, as implemented by BehaviorTree.CPP.forester.run()
was made available to daemons.I'm more than happy to contribute this change as a PR myself, I just wanted to collaborate on which method you thought would be most idiomatic for Forester. I'm personally in favour of 1.ii followed by 1.i.
I've also got a handful of minor improvements I've noted while using the library, if you're receptive to it I'm happy to submit these as PRs.
The text was updated successfully, but these errors were encountered: