Skip to content
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

Constant userdata passing (or constant remapping) #89

Open
jk-ethz opened this issue May 20, 2022 · 0 comments
Open

Constant userdata passing (or constant remapping) #89

jk-ethz opened this issue May 20, 2022 · 0 comments

Comments

@jk-ethz
Copy link

jk-ethz commented May 20, 2022

Is it possible to define transitions between states with constant userdata?

I want the input variable var1 of FOO to be set to test every time after executing BAR, without modifying the internals of BAR.
Something along the lines of:

smach.StateMachine.add('BAR', Bar(), 
                       transitions={'outcome1':'FOO'},
                       remapping={'bar_counter_in':'sm_counter'},
                       constants={'var1':'test'})

Or even making the remappings aware that if some key does not exist as an input or output of BAR, it should be treated as a constant:

smach.StateMachine.add('BAR', Bar(), 
                       transitions={'outcome1':'FOO'},
                       remapping={'bar_counter_in':'sm_counter', 'test': 'var1'})

Or even:

smach.StateMachine.add('BAR', Bar(), 
                       transitions={'outcome1':['FOO',{'var1': 'test'}]},
                       remapping={'bar_counter_in':'sm_counter'})

This would be VERY useful to me, as I have different instances of the same state pointing to another state, but depending on which instance I am coming from, I want different data to be passed in a constant manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant