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

Consider multiple input_accepted topics #15

Open
MattWindsor91 opened this issue Jul 26, 2023 · 0 comments
Open

Consider multiple input_accepted topics #15

MattWindsor91 opened this issue Jul 26, 2023 · 0 comments

Comments

@MattWindsor91
Copy link
Collaborator

Right now, the tester generates only one callback (and ROS subscription) for input acceptance. Discussion with @pefribeiro suggests we may need to generalise this when we start accepting multiple inputs, so that we can understand which input has been received.

Some relevant bits of code that might need to change are as follows. Generally, wherever we have .Transitions.HasIn, we'd need to range over the input channels (.Transitions.In should work, since we hopefully don't need to consider the possibility of the system acknowledging inputs we don't control, unlike the situation with #14 and output transitions).

Here (callback prototypes):

{{- if .Transitions.HasIn }}
void inputAcceptedCallback({{ template "in_callback_args" }}); // Called when the SUT accepts an input.
{{- end }}

And here (callback definitions; maybe we can get rid of InMerged):

{{- if .Transitions.HasIn }}
void StateMachine::inputAcceptedCallback({{ template "in_callback_args" }})
{
{{- block "in_callback" .Transitions.InMerged }}
{{- template "in_callback.cpp.tmpl" . }}
{{- end -}}
}
{{- end }}

And, in the animator, here (generalise to one menu item per input channel?):

{{- if .Transitions.HasIn }}
else if (choice == "accept" && s == rtcg::Status::WAIT_IN)
stm.inputAcceptedCallback();
{{- end }}

And, in ROS, here (generalise to one subscriber per input channel?):

{{- if .Transitions.HasIn }}
auto input_accepted_sub = nh.subscribe("input_accepted", 10, &StateMachine::inputAcceptedCallback, &stm);
{{- end }}

The situation with the input delay callbacks may also need some reworking, but I'm not yet sure how.

@MattWindsor91 MattWindsor91 changed the title Consider multiple input_accepted topic Consider multiple input_accepted topics Jul 26, 2023
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