Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/check_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Validate SCXML File

on:
- push

jobs:
find-files:
runs-on: ubuntu-latest
outputs:
files: ${{ steps.set-files.outputs.files }}
steps:
- uses: actions/checkout@v3
- name: Find SCXML files
id: set-files
run: |
FILES=$(find examples/UC1-vacuum-cleaner/high-level-models -type f \( -name "*.ascxml" -o -name "*.scxml" -o -name "*.xml" \) | jq -R . | jq -s .)
FILES=$(echo "$FILES" | tr -d '\n') # Ensure single-line JSON
echo "Files found: $FILES"
echo "files=$FILES" >> $GITHUB_OUTPUT
validate-xml:
strategy:
matrix:
path:
- ${{ fromJson(needs.find-files.outputs.files) }}
fail-fast: false
needs: find-files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install xmllint
run: sudo apt-get install -y libxml2-utils
- name: Validate SCXML file
run: |
SCHEMA_PATH=$(xmllint --xpath 'string(//@*[local-name()="noNamespaceSchemaLocation"])' "${{ matrix.path }}")
if [ -z "$SCHEMA_PATH" ]; then
echo "No schema found for file: ${{ matrix.path }}. Skipping validation."
exit 0
fi
SCHEMA_DIR=$(dirname "${{ matrix.path }}")
SCHEMA_PATH="$SCHEMA_DIR/$SCHEMA_PATH"
echo "Using schema: $SCHEMA_PATH"
xmllint --noout --schema "$SCHEMA_PATH" "${{ matrix.path }}";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="convince_mc_tc">
<xs:element name="roaml">
<xs:complexType>
<xs:sequence>
<xs:element name="mc_parameters">
Expand Down Expand Up @@ -72,4 +72,5 @@
</xs:complexType>
</xs:element>

</xs:schema>

</xs:schema>
6 changes: 6 additions & 0 deletions data-format-specifications/RoAML-XML/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [x] Change tag convince_mc_tc into roaml or something like it
- [ ] Check the issue of xmlns
- [x] Change the extension of high level files from scxml to ascxml
- [ ] Check xsd for BT: standard reference?
- [ ] Only one xsd for components and skills? Also plugins?
- [ ] What are the ROSprotocols in the examples?
6 changes: 0 additions & 6 deletions data-format-specifications/RoAML/todo.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="scxml">
<xs:element name="ascxml">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="bt_declare_port_in">
Expand Down
136 changes: 0 additions & 136 deletions data-format-specifications/main-XML/specifications.xsd

This file was deleted.

73 changes: 0 additions & 73 deletions data-format-specifications/property-specification-XML/property.xsd

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="scxml">
<xs:element name="ascxml">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="bt_declare_port_in">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="scxml">
<xs:element name="ascxml">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="bt_declare_port_in">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="BackUp"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<ros_topic_publisher name="cmd" topic="/cmd_vel" type="std_msgs/Int16" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="IsBumpDetected"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<datamodel>
<data id="state" expr="false" type="bool" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="IsCharging"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<datamodel>
<data id="msg_received" expr="false" type="bool" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="PerformDockingManeuver"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<ros_topic_publisher name="cmd" topic="/cmd_vel" type="std_msgs/Int16" />
<ros_topic_subscriber name="dock_dist" topic="/dist_to_dock" type="std_msgs/Int16" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="PerformDockingManeuver"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<ros_topic_publisher name="cmd" topic="/cmd_vel" type="std_msgs/Int16" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="ResetBumperState"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<ros_service_client name="reset_bump" service_name="/reset_bump" type="std_srvs/Empty" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
initial="initial"
name="SimpleWait"
model_src=""
xmlns="http://www.w3.org/2005/07/scxml">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../data-format-specifications/skill-components-(A)SCXML/ascxml_component.xsd">

<datamodel>
<data id="waiting" expr="false" type="bool" />
Expand Down
10 changes: 7 additions & 3 deletions examples/UC1-vacuum-cleaner/high-level-models/main.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<roaml>
<parameters>
<?xml version="1.0" encoding="UTF-8"?>
<roaml
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../data-format-specifications/RoAML-XML/main.xsd">

<mc_parameters>
<max_time value="40" unit="s" />
<bt_tick_rate value="5.0" />
<bt_tick_if_not_running value="true" />
</parameters>
</mc_parameters>

<behavior_tree>
<input type="bt.cpp-xml" src="./bt_policies/policy.xml" />
Expand Down
Loading
Loading