Skip to content
Draft
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
12 changes: 7 additions & 5 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ros:jazzy AS as2fm
FROM ros:jazzy AS moco
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install requirements
Expand All @@ -16,10 +16,12 @@ RUN cd /smc_storm_executable && \
rm -rf /var/lib/apt/lists/*
RUN ln /smc_storm_executable/bin/smc_storm /usr/local/bin

# Add AS2FM
# Add MOCO
RUN mkdir -p /colcon_ws/src
COPY . /colcon_ws/src/as2fm
RUN pip3 install --break-system-packages /colcon_ws/src/as2fm[dev]
COPY . /colcon_ws/src/moco
#TODO fix package name once release is up
RUN pip3 install --break-system-packages /colcon_ws/src/moco[dev]


# Make ROS workspace and build it
RUN source /opt/ros/jazzy/setup.bash && \
Expand All @@ -30,6 +32,6 @@ RUN source /opt/ros/jazzy/setup.bash && \
CMD /bin/bash
COPY .docker/entrypoint.sh /entrypoint.sh
RUN chmod +x entrypoint.sh
WORKDIR /colcon_ws/src/as2fm
WORKDIR /colcon_ws/src/moco

ENTRYPOINT [ "/entrypoint.sh" ]
12 changes: 9 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ on:
pull_request:

env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/as2fm
REGISTRY_IMAGE_LATEST: ghcr.io/${{ github.repository_owner }}/as2fm:latest

OWNER: '${{ github.repository_owner }}'

# TODO hardcoded, should instead get repository_owner and convert to lowercase
OWNER_LC: 'nevertools'

REGISTRY_IMAGE: ghcr.io/$OWNER_LC/moco
REGISTRY_IMAGE_LATEST: ghcr.io/$OWNER_LC/moco:latest
RAW_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build:
Expand Down Expand Up @@ -41,7 +47,7 @@ jobs:
docker push ${{ env.REGISTRY_IMAGE }}:$BRANCH_NAME
echo "TAG_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Testing
run: docker run ${{ env.REGISTRY_IMAGE_LATEST }} pytest /colcon_ws/src/as2fm
run: docker run ${{ env.REGISTRY_IMAGE_LATEST }} pytest /colcon_ws/src/moco
- name: Push to gh registry with latest if this is main
if: github.ref == 'refs/heads/main'
run: |
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Want to contribute? Great! You can do so through the standard GitHub pull
request model. For large contributions we do encourage you to file a ticket in
the GitHub issues tracking system prior to any code development to coordinate
with the as2fm development team early in the process.
with the moco development team early in the process.
Coordinating up front helps to avoid frustration later on.

Your contribution must be licensed under the Apache-2.0 license, the license
Expand Down Expand Up @@ -89,7 +89,7 @@ Often employers or academic institution have ownership over code that is
written in certain circumstances, so please do due diligence to ensure that
you have the right to submit the code.

If you are a developer who is authorized to contribute to as2fm
If you are a developer who is authorized to contribute to moco
on behalf of your employer, then please use your corporate email address in the
Signed-off-by tag. Otherwise please use a personal email address.

Expand All @@ -100,7 +100,7 @@ Each contributor is responsible for identifying themselves in the
Please add the respective information corresponding to the Signed-off-by tag
as part of your first pull request.

If you are a developer who is authorized to contribute to as2fm
If you are a developer who is authorized to contribute to moco
on behalf of your employer, then add your company / organization to the list of
copyright holders in the [NOTICE](NOTICE) file. As author of a corporate
contribution you can also add your name and corporate email address as in the
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is the official list of AS2FM copyright holders and authors.
# This is the official list of moco copyright holders and authors.
#
# Often employers or academic institutions have ownership over code that is
# written in certain circumstances, so please do due diligence to ensure that
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Autonomous Systems to Formal Models (AS2FM)
# Autonomous Systems to Formal Models (moco)

## Summary overview

This package provides tools to convert the high level representation of an autonomous system (implemented using a combination of BT XML + a ROS flavoured set of SCXML (also called ROS-SCXML) files) to a formal model (i.e. JANI).

## Documentation

Please access the documentation via [convince-project.github.io/AS2FM](https://convince-project.github.io/AS2FM)
Please access the documentation via [convince-project.github.io/moco](https://convince-project.github.io/moco)

## Further Information

Expand All @@ -16,8 +16,8 @@ See [Contributing](./CONTRIBUTING.md).

### Feedback

Feedback is highly appreciated. Please open issues on new ideas, bugs, etc. here at [as2fm/issues](https://github.com/convince-project/as2fm/issues) or reach out to the maintainers.
Feedback is highly appreciated. Please open issues on new ideas, bugs, etc. here at [moco/issues](https://github.com/convince-project/moco/issues) or reach out to the maintainers.

### License

AS2FM comes under the Apache-2.0 license, see [LICENSE](./LICENSE).
moco comes under the Apache-2.0 license, see [LICENSE](./LICENSE).
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

services:
base:
image: ghcr.io/convince-project/as2fm:latest
image: ghcr.io/nevertools/moco:latest # TODO fix link once release is up
build:
context: .
dockerfile: .docker/Dockerfile
target: as2fm
target: moco
# Ensures signals are actually passed and reaped in the container for shutdowns.
# https://docs.docker.com/compose/compose-file/compose-file-v3/#init
init: true
Expand All @@ -29,7 +29,7 @@ services:
- QTWEBENGINE_DISABLE_SANDBOX=1
volumes:
# Mount the workshop source code
- ./:/colcon_ws/src/as2fm:rw
- ./:/colcon_ws/src/moco:rw
# Allows graphical programs in the container
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XAUTHORITY:-$HOME/.Xauthority}:/root/.Xauthority
Expand All @@ -39,6 +39,6 @@ services:
extends: base
command: >
bash -c "
python3 -m pytest /colcon_ws/src/as2fm
python3 -m pytest /colcon_ws/src/moco
"
profiles: [test]
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Before you can build the documentation, you need to install the required packages as described above, since also the code API documentation of those packages is built.

```
pip install ../as2fm_common
pip install ../scxml_converter
pip install ../jani_generator
pip install ../moco_common
pip install ../roaml_converter
pip install ../roaml_generator
pip install -r requirements.txt
make html
```
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ API
:template: custom-module-template.rst
:recursive:

as2fm
moco
6 changes: 3 additions & 3 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ AS2FM Python Package

.. code-block:: bash

python3 -m pip uninstall as2fm_common
python3 -m pip uninstall jani_generator
python3 -m pip uninstall scxml_converter
python3 -m pip uninstall moco_common
python3 -m pip uninstall roaml_generator
python3 -m pip uninstall roaml_converter
python3 -m pip uninstall jani_visualizer
python3 -m pip uninstall trace_visualizer

Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Reference Model: Fetch & Carry Robot
For this tutorial we use the model defined here: `tutorial_fetch_and_carry <https://github.com/convince-project/AS2FM/tree/main/examples/tutorial_fetch_and_carry>`_.
A classical fetch and carry task is implemented there. A robot should drive to the pantry where food is stored, pick up snacks, drive to the table and place the snacks there. The robot should be done with this task after at most 100 seconds.

The model consists of a `main.xml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/main.xml>`_ file, referencing the BT `bt_tree.xml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/bt_tree.xml>`_ running in the system and the SCXML files modeling the BT plugins for navigating `bt_navigate_action.scxml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/bt_navigate_action.scxml>`_, picking `bt_pick_action.scxml <https://github.com/convince-project/AS2FM/blob/main/test/jani_generator/
The model consists of a `main.xml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/main.xml>`_ file, referencing the BT `bt_tree.xml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/bt_tree.xml>`_ running in the system and the SCXML files modeling the BT plugins for navigating `bt_navigate_action.scxml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/bt_navigate_action.scxml>`_, picking `bt_pick_action.scxml <https://github.com/convince-project/AS2FM/blob/main/test/roaml_generator/
_test_data/tutorial_fetch_and_carry/bt_pick_action.scxml>`__, and placing `bt_place_action.scxml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/bt_place_action.scxml>`_, as well as the world model `world.scxml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/world.scxml>`_. Finally, there is the property to check later with SMC Storm in JANI format in `properties.jani <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/properties.jani>`_.

All of those components are summarized and collected in the `main.xml <https://github.com/convince-project/AS2FM/blob/main/examples/tutorial_fetch_and_carry/main.xml>`_ file.
Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0.0", "wheel", "pip>=24.2"]
build-backend = "setuptools.build_meta"

[project]
name = "as2fm"
name = "moco"
version = "0.0.1"
description = ""
readme = "README.md"
Expand All @@ -19,30 +19,30 @@ classifiers = [
keywords = []
# TODO: Check dependencies to remove
dependencies = [
# as2fm_common
# moco_common
"lxml",
# jani_generator
# roaml_generator
"jsonschema",
"esprima",
"escodegen",
# scxml_converter
# roaml_converter
"typing-extensions>=4.12.2",
]
requires-python = ">=3.10"

# Comment these lines out, since they prevent the package from being found in code
# [tool.setuptools.packages.find]
# where = ["src"]
# include = ["as2fm", "as2fm.*"]
# include = ["moco", "moco.*"]
#
# [tool.setuptools.package-dir]
# "as2fm" = "src/as2fm"
# "moco" = "src/moco"

[tool.setuptools.package-data]
"as2fm.resources" = ["bt_control_nodes/*.scxml"]
"moco.resources" = ["bt_control_nodes/*.scxml"]

[project.scripts]
as2fm_scxml_to_jani = "as2fm.jani_generator.main:main_scxml_to_jani" # TODO: rename this function
moco_roaml_to_scxml = "moco.roaml_generator.main:main_roaml_to_scxml" # TODO: rename this function

[project.optional-dependencies]
dev = [
Expand Down
2 changes: 1 addition & 1 deletion ros_support_interfaces/grid_robot_interfaces/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Used in `test/jani_generator/_test_data/grid_robot_blackboard`
Used in `test/roaml_generator/_test_data/grid_robot_blackboard`
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(as2fm_test_ros_interfaces)
project(moco_test_ros_interfaces)

# find dependencies
find_package(ament_cmake REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>as2fm_test_ros_interfaces</name>
<name>moco_test_ros_interfaces</name>
<version>0.0.0</version>
<description>Meta package depending on all interface we use in the tests.</description>
<maintainer email="[email protected]">Marco Lampacrescia</maintainer>
<license>Apache License 2.0</license>
<author email="[email protected]">Marco Lampacrescia</author>

<exec_depend>as2fm_test_srvs</exec_depend>
<exec_depend>moco_test_srvs</exec_depend>
<exec_depend>example_interfaces</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(as2fm_test_srvs)
project(moco_test_srvs)

# Default to C99
if(NOT CMAKE_C_STANDARD)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>as2fm_test_srvs</name>
<name>moco_test_srvs</name>
<version>0.0.0</version>
<description>Test interface for ensuring Float support in ROS.</description>
<maintainer email="[email protected]">Marco Lampacrescia</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion ros_support_interfaces/nested_interfaces/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Used in `test/jani_generator/_test_data/nested_data_ros`
Used in `test/roaml_generator/_test_data/nested_data_ros`
1 change: 0 additions & 1 deletion src/as2fm/jani_generator/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from dataclasses import dataclass
from typing import List, MutableSequence, Optional, Tuple, Type, Union, get_args

from as2fm.as2fm_common.common import ValidPlainScxmlTypes
from moco.moco_common.common import ValidPlainScxmlTypes

ARRAY_BASE_TYPES = (int, float, None)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
from esprima.syntax import Syntax
from lxml.etree import _Element as XmlElement

from as2fm.as2fm_common.ecmascript_interpretation_functions import (
from moco.moco_common.ecmascript_interpretation_functions import (
ValidECMAScriptTypes,
get_ast_expression_type,
get_dict_from_object_expression,
get_list_from_array_expr,
)
from as2fm.as2fm_common.logging import check_assertion, get_error_msg
from moco.moco_common.logging import check_assertion, get_error_msg


class ArrayAccess:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import esprima
from esprima.syntax import Syntax

from as2fm.as2fm_common.array_type import ArrayInfo, array_value_to_type_info
from as2fm.as2fm_common.common import ValidPlainScxmlTypes
from moco.moco_common.array_type import ArrayInfo, array_value_to_type_info
from moco.moco_common.common import ValidPlainScxmlTypes

# Definition of a valid ECMAScript expression type
ValidECMAScriptTypes = Union[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from lxml.etree import _Element as XmlElement

from as2fm.as2fm_common.common import is_comment
from moco.moco_common.common import is_comment

LOCATION_INFO = Tuple[str, int] # filename, line_number
SUPPORTED_LOCATIONS = Union[XmlElement, LOCATION_INFO, str]
Expand Down Expand Up @@ -73,7 +73,7 @@ def _get_xml_location(element: XmlElement) -> LOCATION_INFO:
)
assert INTERNAL_FILEPATH_ATTR in element.attrib.keys(), (
"The element must have a filepath attribute. This is set by "
"`as2fm_common.logging.set_filepath_for_all_elements`."
"`moco_common.logging.set_filepath_for_all_elements`."
)
path = element.attrib[INTERNAL_FILEPATH_ATTR]
sourceline = element.sourceline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from lxml import etree as ET
from lxml.etree import _Element as XmlElement

from as2fm.as2fm_common.array_type import get_default_expression_for_type, value_to_string_expr
from as2fm.scxml_converter.data_types.struct_definition import StructDefinition
from as2fm.scxml_converter.data_types.type_utils import SCXML_DATA_STR_TO_TYPE
from as2fm.scxml_converter.scxml_entries import (
from moco.moco_common.array_type import get_default_expression_for_type, value_to_string_expr
from moco.roaml_converter.data_types.struct_definition import StructDefinition
from moco.roaml_converter.data_types.type_utils import SCXML_DATA_STR_TO_TYPE
from moco.roaml_converter.scxml_entries import (
BtChildTickStatus,
BtTickChild,
RosRateCallback,
Expand All @@ -42,7 +42,7 @@
ScxmlState,
ScxmlTransition,
)
from as2fm.scxml_converter.scxml_entries.bt_utils import (
from moco.roaml_converter.scxml_entries.bt_utils import (
BT_BLACKBOARD_EVENT_VALUE,
BT_BLACKBOARD_GET,
BT_BLACKBOARD_REQUEST,
Expand Down Expand Up @@ -127,7 +127,7 @@ def load_available_bt_plugins(
bt_plugin_scxml = ScxmlRoot.from_scxml_file(path, custom_data_types)
available_bt_plugins.update({bt_plugin_scxml.get_name(): bt_plugin_scxml})
internal_bt_plugins_path = (
resource_files("as2fm").joinpath("resources").joinpath("bt_control_nodes")
resource_files("moco").joinpath("resources").joinpath("bt_control_nodes")
)
for plugin_path in internal_bt_plugins_path.iterdir():
if plugin_path.is_file() and plugin_path.suffix == ".scxml":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import os
from typing import Any, Dict, List, Tuple

from as2fm.as2fm_common.logging import log_warning
from as2fm.scxml_converter.data_types.struct_definition import StructDefinition
from moco.moco_common.logging import log_warning
from moco.roaml_converter.data_types.struct_definition import StructDefinition

ARRAY = "array"
OBJECT = "object"
Expand Down
Loading
Loading