-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Enrico Ghiorzi <[email protected]>
- Loading branch information
1 parent
4121c29
commit f82541e
Showing
5 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<scxml | ||
version="1.0" | ||
xmlns="http://www.w3.org/2005/07/scxml" | ||
datamodel="ecmascript" | ||
name="fsm_1" | ||
initial="initial"> | ||
|
||
<datamodel> | ||
<!-- TYPE p:int32 --> | ||
<data id="p" expr="0"/> | ||
</datamodel> | ||
|
||
<state id="initial"> | ||
<transition target="finished" cond="p == 0"> | ||
<send event="message" target="fsm_2"> | ||
<!-- TYPE result:int32 --> | ||
<param name="result" expr="p + 1"/> | ||
</send> | ||
</transition> | ||
</state> | ||
|
||
<state id="finished"/> | ||
</scxml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<scxml | ||
version="1.0" | ||
xmlns="http://www.w3.org/2005/07/scxml" | ||
datamodel="ecmascript" | ||
name="fsm_2" | ||
initial="idle"> | ||
|
||
<state id="idle"> | ||
<transition event="message" target="finished" cond="_event.data.result == 1"/> | ||
<transition event="message" target="loop"/> | ||
</state> | ||
|
||
<state id="finished"/> | ||
|
||
<state id="loop"> | ||
<transition target="loop"/> | ||
</state> | ||
</scxml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<specification xmlns="..." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="..."> | ||
|
||
<model> | ||
|
||
<types path="./types.xml" /> | ||
|
||
<processList> | ||
<process id="fsm_1" moc="fsm" path="./fsm_1.scxml" /> | ||
<process id="fsm_2" moc="fsm" path="./fsm_2.scxml" /> | ||
</processList> | ||
|
||
</model> | ||
|
||
<properties path="./properties.xml"/> | ||
</specification> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<!-- Basic types from OMG IDL as utilized in ROS2 IDL | ||
and mapping from OMG IDL datatypes to ECMAScript 2023 | ||
See: https://www.omg.org/spec/IDL/4.2/About-IDL/ | ||
https://design.ros2.org/articles/idl_interface_definition.html | ||
https://wiki.ros.org/msg | ||
https://262.ecma-international.org/14.0/#sec-ecmascript-data-types-and-values | ||
void | ||
ECMAScript: Null | ||
int8 | ||
uint8 | ||
int16 | ||
uint16 | ||
int32 | ||
uint32 | ||
int64 | ||
uint64 | ||
ECMAScript: BigInt | ||
float32 | ||
float64 | ||
ECMAScript: Number | ||
char | ||
wchar | ||
ECMAScript: String | ||
boolean | ||
ECMAScript: Boolean | ||
sequence<type_spec> | ||
sequence<type_spec, N> | ||
<type_spec> [] | ||
ECMAScript: Array (??) | ||
string | ||
wstring | ||
ECMAScript: String | ||
time | ||
ECMAScript: BigInt | ||
NOTE: alias for uint32 | ||
duration | ||
ECMAScript: BigInt | ||
NOTE: alias for int32 | ||
URI | ||
ECMAScript: String | ||
NOTE: alias for string | ||
--> | ||
|
||
|
||
<dataTypeList> | ||
|
||
<!-- Here are some examples on how ROS2 data types can be encoded easily --> | ||
|
||
<!-- From https://wiki.ros.org/msg#headerSect --> | ||
<structure id="Header"> | ||
<field id="stamp" type="time"/> | ||
<field id="frame_id" type="string"/> | ||
</structure> | ||
|
||
<!-- From geometry_msgs/msg/Point.msg --> | ||
<structure id="Point"> | ||
<field id="x" type="float64"/> | ||
<field id="y" type="float64"/> | ||
<field id="z" type="float64"/> | ||
</structure> | ||
|
||
<!-- From geometry_msgs/msg/Point.msg --> | ||
<structure id="Point32"> | ||
<field id="x" type="float32"/> | ||
<field id="y" type="float32"/> | ||
<field id="z" type="float32"/> | ||
</structure> | ||
|
||
<!-- From geometry_msgs/msg/PointStamped.msg --> | ||
<structure id="PointStamped"> | ||
<field id="header" type="Header"/> | ||
<field id="point" type="Point"/> | ||
</structure> | ||
|
||
<!-- From geometry_msgs/msg/Polygon.msg --> | ||
<structure id="Polygon"> | ||
<field id="points" type="Point32[]"/> | ||
</structure> | ||
|
||
<!-- End of example section --> | ||
|
||
<!-- This is the only non-native data type required in this example --> | ||
|
||
<enumeration id="TickResponse"> | ||
<label id="RUNNING"/> | ||
<label id="SUCCESS"/> | ||
<label id="FAILURE"/> | ||
</enumeration> | ||
|
||
</dataTypeList> |