Comments (2)
Hello.
We already talked about that idea two years ago. And that is not hard to implement.
Personally, I like the proposal and follows the UML state machine standard.
The main argument why we did not implemented that is because it overlaps the functionality and responsibility of the StateReactors that potentially can receive events and generate other events. The suggested way to do that at the moment is to make a state reactor or use the conditional state reactor.
The good point of state reactors is that they are reusable pieces of code (against inline transition guards).
Nonetheless I think we could find a way to integrate this feature.
from smacc2.
Very fair. I'm currently working with the SrConditional
approach. The main downsides are:
-
The SMACC RTA display does not work. From memory, it shows something like
internal_event
with no lines from the state reactor inputs. Better RTA support for State Reactors or Guards would help. -
Verbosity. Here is a rather minimal example... I'm not sure if there is a better way to write this. I've had to write others where the state reactors depend on events from other state reactors - at this point, the code gets pretty tricky to follow.
// TRANSITION TABLE
typedef mpl::list<
Transition<EvSomeInputEventWithGuard, StGuardedState, GUARDED_STATE>
> reactions;
...
void runtimeConfigure()
{
auto guard = [ = ](auto * ev) {
(void)ev;
// as an example, a behavior which contains some state used as a guard
auto cbSomeBehaviorWithState =
this->getOrthogonal<OrSomeOrthogonal>()->getClientBehavior<CbSomeBehavior>();
// this is used to publish notifications of transitions onto a ros topic
auto cbPublisher =
this->getOrthogonal<OrSomePublisher>()->getClientBehavior<CbSomePublisher>();
// guard checks
if (!cbSomeBehaviorWithState->value) {
cbPublisher->publish("Cannot transition because the state stored in CbSomeBehavior says so");
return false;
}
return true;
};
this->createStateReactor<
SrConditional<EvSomeInputEvent>,
EvSomeInputEventWithGuard,
mpl::list<EvSomeInputEvent>
>(guard);
}
- doing things like
cbPublisher->publish
(using theSmaccPublisherClient
) does not work reliably - I'm not sure why.
from smacc2.
Related Issues (20)
- [BUG] ros2launch state machine node cannot shutdown gracefully with Ctrl-C(SIGINT). HOT 3
- Something Bad
- Test1
- Something Bad
- Something Bad
- Test1
- No comprehensive documentation (especially for concepts)
- Build Errors HOT 7
- How to use Action events HOT 5
- warning format occorred. HOT 2
- Look at getting Nvidia GPU to run docker image
- Investigate running UE5 with AMD and Fedora
- Set up ROS2 on Fedora
- feature/sm_dancebot_ue ./run_docker_container_editor.sh doesnt work
- feature/sm_dancebot_ue ./run_editor_smacc.sh-readme
- Update from 0.4.0 to 2.3.18 on 22.04 Humble not transitioning to next inner state HOT 19
- Confusion about rationale behind orthogonal implementation
- Migrate to modern Gazebo HOT 1
- Nav2z client's waypoint Navigator sends goals in odom frame. HOT 2
- Adding manually compiled SMACC2 packages files to /opt/foxy folder HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smacc2.