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

Prepare features before integration week #26

Merged
merged 6 commits into from
Sep 5, 2024
Merged

Prepare features before integration week #26

merged 6 commits into from
Sep 5, 2024

Conversation

MarcoLm993
Copy link
Collaborator

@MarcoLm993 MarcoLm993 commented Aug 19, 2024

Features in this PR:

  • ROS Actions
  • BT Ports (only static input ports supported)
  • Arrays in ROS and plain SCXML

To be implemented in a next PR:

  • BT Blackboard: Will be handled in a next PR
  • BT Output ports

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
@MarcoLm993 MarcoLm993 requested a review from ct2034 September 2, 2024 12:51
@MarcoLm993 MarcoLm993 marked this pull request as ready for review September 2, 2024 12:51
…hreads

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
@MarcoLm993 MarcoLm993 requested review from MKlauck and ste93 September 3, 2024 09:36
Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example involves real values, that are currently not supported by STORM.
Use modest for testing this, as in the following:

scxml_to_jani main.xml
modest modes main.jani -R Uniform -T -TF file.csv

-R Uniform is used to resolve non-determinism in the resulting state machine, and is required.
-T -TF file.csv is used to generate a file collecting all the generated traces (in case debugging is required), and can be omitted.

Workarounds to make smc_storm able to deal with this kind of model will be implemented.

Copy link
Member

@ct2034 ct2034 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the amazing work @MarcoLm993. I did not find any blockers. Just some things we can discuss in our next Wednesday hackathon.

from scxml_converter.scxml_entries.utils import SCXML_DATA_STR_TO_TYPE


class RosCommunicationHandler:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💓

Comment on lines +70 to +80
# Additional self-loop in the waiting state, allowing the global timer to tick
# only if all events have been processed
event_automaton.add_edge(JaniEdge({
"location": "waiting",
"destinations": [{
"location": "waiting",
"probability": {"exp": 1.0},
"assignments": []
}],
"action": "global_timer_enable"
}))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used to ensure we do not have any unprocessed event (that means, there are no event-automata in the "received" state) before advancing the global timer / processing the timer callbacks. In a way, we can say it gives priority to events over timers

@@ -33,31 +33,39 @@


def convert_scxml_root_to_jani_automaton(
scxml_root: ScxmlRoot, jani_automaton: JaniAutomaton, events_holder: EventsHolder
scxml_root: ScxmlRoot, jani_automaton: JaniAutomaton, events_holder: EventsHolder,
max_array_size: int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this should be defined globally. We should think about making this per array

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need a mix of both: ROS interfaces might contain unbounded arrays, and there we would definitely need to enforce a bound ourselves (e.g. in the Fibonacci example)

@ct2034 ct2034 merged commit 7bd699b into main Sep 5, 2024
17 checks passed
@ct2034 ct2034 deleted the develop branch September 5, 2024 15:43
@MarcoLm993
Copy link
Collaborator Author

@ste93 The reason for adding you to the PR was mostly to make you aware of the ROS-SCXML format updates in the various examples. Sorry for not mentioning it explicitly earlier.

ct2034 pushed a commit that referenced this pull request Sep 25, 2024
* Add support to BT Input Ports

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>

* Implement scxml action interface. No conversion to Jani yet

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>

* Add array support in scxml and jani

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>

* Complete action implementation with fibonacci test with one and two threads

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>

* Update basic ROS example

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>

* Introduce robot controller example, fixing issues with real numbers

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>

---------

Signed-off-by: Marco Lampacrescia <marco.lampacrescia@de.bosch.com>
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants