From 6981e20731b5b8329e4a1da05d706026e081c8fc Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 18 May 2024 17:17:00 +0000 Subject: [PATCH 01/34] ogma-cli: Introduce CI test job. Refs #139. Ogma doesn't currently rely on Travis CI for testing, because Travis is setup to run on all NASA repositories and we run out of cycles very quickly. We need to automate the testing process as much as possible regardless, and follow our own guide for compliance with NPR7150.2D but using Github instead of Travis CI. This commit introduces a Github Actions file that builds the source code in every push action and with every pull requests. --- .github/workflows/repo-ghc-8.6-cabal-2.4.yml | 63 ++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/repo-ghc-8.6-cabal-2.4.yml diff --git a/.github/workflows/repo-ghc-8.6-cabal-2.4.yml b/.github/workflows/repo-ghc-8.6-cabal-2.4.yml new file mode 100644 index 00000000..4eaa7bbc --- /dev/null +++ b/.github/workflows/repo-ghc-8.6-cabal-2.4.yml @@ -0,0 +1,63 @@ +name: install-hackage-ghc-8.6-cabal-2.4 + +# Trigger the workflow on push or pull request +on: + - pull_request + - push + +jobs: + cabal: + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + cabal: ["2.4"] + ghc: + - "8.6" + + steps: + + - uses: haskell-actions/setup@main + id: setup-haskell-cabal + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Prepare environment + run: | + echo "$HOME/.ghcup/bin" >> $GITHUB_PATH + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + + - uses: actions/checkout@v4 + + - name: Create sandbox + run: | + echo "$PWD/.cabal-sandbox/bin" >> $GITHUB_PATH + cabal v1-sandbox init + + - name: Install dependencies + run: | + cabal v1-install alex happy + + - name: Install ogma + run: | + # Some tests need the ogma executable to be in the path, which won't + # happen until installation completes successfully (which only happens + # after tests if running tests is enabled). We therefore need to run + # the installation twice: once without --run-tests, and again with + # --run-tests. + # + # We still --enable-tests in the first compilation to make sure that + # the dependencies do not change and cabal does not change the + # installation plan (which would mean we'd be running the tests with a + # version of ogma compiled with different dependencies). + cabal v1-install ogma-**/ --enable-tests + + - name: Test all packages + run: | + # We want to document the build process, and get detailed information + # if there is a problem (or if all goes well). We therefore execute the + # installation with -j1. + cabal v1-install ogma-**/ --enable-tests --run-tests -j1 From 2b461d284b03421050c19b2873e48a36915310f3 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 03:47:50 +0000 Subject: [PATCH 02/34] ogma-cli: Remove old travis file. Refs #139. A prior commit has introduced a Github Actions file to build Ogma with every push and every pull request. This commit removes the corresponding Travis CI file, since it no longer makes sense to keep it. --- .travis.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c15cddc8..00000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: haskell - -ghc: - - "8.8.4" - -env: - - PATH=${HOME}/.cabal/bin:${PATH} - -before_install: - - travis_retry sudo apt-get update - -install: - - travis_retry cabal install alex happy - - travis_retry cabal install --enable-tests --only-dependencies ogma-**/ - -script: - # We want to document the build process, and get detailed information if - # there is a problem (or if all goes well). We therefore execute the - # installation with -j1. - # - # Some tests need the ogma executable to be in the path, which won't happen - # until installation completes successfully (which only happens after tests - # if running tests is enabled). We therefore need to run the installation - # twice: once without --run-tests, and again with --run-tests. - # - # We still --enable-tests in the first compilation to make sure that the - # dependencies do not change and cabal does not change the installation plan - # (which would mean we'd be running the tests with a version of ogma compiled - # with different dependencies). - - cabal install --enable-tests -j1 ogma-**/ - - cabal install --run-tests -j1 ogma-**/ - -after_script: - -branches: - only: - - master - - /^develop.*$/ - - /^hotfix.*$/ - - /^release.*$/ From 6fa05dd159d4952d6aa2e4bbc8867f7183e9d561 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 02:58:15 +0000 Subject: [PATCH 03/34] ogma-cli: Document changes in CHANGELOG. Refs #139. --- ogma-cli/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index 0a59d3f3..f02196b6 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -1,5 +1,8 @@ # Revision history for ogma-cli +## [1.X.X] - 2024-05-19 +* Introduce CI test job (#139). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From cbbe7a750a3fb8b526b88059839db04c7bd90116 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 13:02:38 +0000 Subject: [PATCH 04/34] ogma-core: Move files to subdirectory. Refs #136. Moves the files generated by Ogma into a subdirectory, to make it easier to place them conforming to the expected structure in a ROS application inside a docker image. --- ogma-core/ogma-core.cabal | 6 +++--- ogma-core/src/Command/ROSApp.hs | 4 ++-- ogma-core/templates/ros/{ => copilot}/CMakeLists.txt | 0 ogma-core/templates/ros/{ => copilot}/package.xml | 0 ogma-core/templates/ros/{ => copilot}/src/.keep | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename ogma-core/templates/ros/{ => copilot}/CMakeLists.txt (100%) rename ogma-core/templates/ros/{ => copilot}/package.xml (100%) rename ogma-core/templates/ros/{ => copilot}/src/.keep (100%) diff --git a/ogma-core/ogma-core.cabal b/ogma-core/ogma-core.cabal index 8a06c118..6a2be7cc 100644 --- a/ogma-core/ogma-core.cabal +++ b/ogma-core/ogma-core.cabal @@ -60,9 +60,9 @@ data-files: templates/copilot-cfs/CMakeLists.txt templates/copilot-cfs/fsw/src/copilot_cfs_version.h templates/copilot-cfs/fsw/src/copilot_cfs.h templates/copilot-cfs/fsw/src/copilot_cfs_events.h - templates/ros/CMakeLists.txt - templates/ros/src/.keep - templates/ros/package.xml + templates/ros/copilot/CMakeLists.txt + templates/ros/copilot/src/.keep + templates/ros/copilot/package.xml templates/fprime/CMakeLists.txt templates/fprime/Dockerfile templates/fprime/instance-copilot diff --git a/ogma-core/src/Command/ROSApp.hs b/ogma-core/src/Command/ROSApp.hs index d53dc0b8..8d13280f 100644 --- a/ogma-core/src/Command/ROSApp.hs +++ b/ogma-core/src/Command/ROSApp.hs @@ -136,7 +136,7 @@ rosApp' targetDir varNames varDB monitors = foldr f ([], [], [], []) varNames let rosFileName = - targetDir "src" "copilot_monitor.cpp" + targetDir "copilot" "src" "copilot_monitor.cpp" rosFileContents = unlines $ rosMonitorContents varNames vars ids infos datas monitors @@ -144,7 +144,7 @@ rosApp' targetDir varNames varDB monitors = writeFile rosFileName rosFileContents let rosFileName = - targetDir "src" "copilot_logger.cpp" + targetDir "copilot" "src" "copilot_logger.cpp" rosFileContents = unlines $ rosLoggerContents varNames vars ids infos datas monitors diff --git a/ogma-core/templates/ros/CMakeLists.txt b/ogma-core/templates/ros/copilot/CMakeLists.txt similarity index 100% rename from ogma-core/templates/ros/CMakeLists.txt rename to ogma-core/templates/ros/copilot/CMakeLists.txt diff --git a/ogma-core/templates/ros/package.xml b/ogma-core/templates/ros/copilot/package.xml similarity index 100% rename from ogma-core/templates/ros/package.xml rename to ogma-core/templates/ros/copilot/package.xml diff --git a/ogma-core/templates/ros/src/.keep b/ogma-core/templates/ros/copilot/src/.keep similarity index 100% rename from ogma-core/templates/ros/src/.keep rename to ogma-core/templates/ros/copilot/src/.keep From 9e6ee423d2fbdc287c2a72c18817fe9c5361e5a5 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Tue, 21 May 2024 07:13:26 +0000 Subject: [PATCH 05/34] ogma-cli: Adjust documentation. Refs #136. Adjust README to match new locations of files generated by the `ros` command. --- ogma-cli/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ogma-cli/README.md b/ogma-cli/README.md index b008a051..55ff726d 100644 --- a/ogma-cli/README.md +++ b/ogma-cli/README.md @@ -214,11 +214,11 @@ $ ogma ros --handlers filename --variable-file variables --variable-db ros-varia The application generated by Ogma contains the following files: ``` -ros_demo/CMakeLists.txt -ros_demo/src/copilot_monitor.cpp -ros_demo/src/copilot_logger.cpp -ros_demo/src/.keep -ros_demo/package.xml +ros_demo/copilot/CMakeLists.txt +ros_demo/copilot/src/copilot_monitor.cpp +ros_demo/copilot/src/copilot_logger.cpp +ros_demo/copilot/src/.keep +ros_demo/copilot/package.xml ``` ### Current limitations From c3c506372d8ccf31137b545ab891888aa6fdf523 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 13:07:24 +0000 Subject: [PATCH 06/34] ogma-core: Add dockerfile. Refs #136. Ogma doesn't currently generate a Dockerfile with the ROS packages. That makes it harder for users to know how to use the produce of Ogma. This commit adds a Dockerfile to the ROS template used by Ogma, and to the list of files installed with Ogma. The dockerfile simply compiles the monitoring application inside Space ROS. --- ogma-core/ogma-core.cabal | 1 + ogma-core/templates/ros/Dockerfile | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 ogma-core/templates/ros/Dockerfile diff --git a/ogma-core/ogma-core.cabal b/ogma-core/ogma-core.cabal index 6a2be7cc..dbd95c17 100644 --- a/ogma-core/ogma-core.cabal +++ b/ogma-core/ogma-core.cabal @@ -60,6 +60,7 @@ data-files: templates/copilot-cfs/CMakeLists.txt templates/copilot-cfs/fsw/src/copilot_cfs_version.h templates/copilot-cfs/fsw/src/copilot_cfs.h templates/copilot-cfs/fsw/src/copilot_cfs_events.h + templates/ros/Dockerfile templates/ros/copilot/CMakeLists.txt templates/ros/copilot/src/.keep templates/ros/copilot/package.xml diff --git a/ogma-core/templates/ros/Dockerfile b/ogma-core/templates/ros/Dockerfile new file mode 100644 index 00000000..5c14dbd4 --- /dev/null +++ b/ogma-core/templates/ros/Dockerfile @@ -0,0 +1,16 @@ +FROM osrf/space-ros:latest + +ARG USER=spaceros-user +ARG PACKAGE_PATH=/home/${USER}/monitors +ARG ROS_PATH=/home/${USER}/spaceros/ + +RUN mkdir -p ${PACKAGE_PATH}/src/ +ADD copilot ${PACKAGE_PATH}/src/copilot +USER root +RUN chown -R ${USER} ${PACKAGE_PATH} +USER ${USER} + +SHELL ["/bin/bash", "-c"] +WORKDIR ${PACKAGE_PATH} +RUN source ${ROS_PATH}/install/setup.bash && \ + colcon build From d6ccecc735b6b2875b65972e24f89558534a10f1 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Tue, 21 May 2024 07:21:23 +0000 Subject: [PATCH 07/34] ogma-cli: Document new Dockerfile. Refs #136. A prior commit has modified the `ros` command to generate an additional Dockerfile. This commit adjusts the documentation in the README to let users know what the Dockerfile is for and how to build the image. --- ogma-cli/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ogma-cli/README.md b/ogma-cli/README.md index 55ff726d..c7e73093 100644 --- a/ogma-cli/README.md +++ b/ogma-cli/README.md @@ -219,6 +219,16 @@ ros_demo/copilot/src/copilot_monitor.cpp ros_demo/copilot/src/copilot_logger.cpp ros_demo/copilot/src/.keep ros_demo/copilot/package.xml +ros_demo/Dockerfile +``` + +The Dockerfile can be used to compile the application inside the base image for +the Space ROS distribution. To build the image, first place the core +implementation of the monitors in C inside the directory +`ros_demo/copilot/src/` (see 'Current limitations' for details). After, you can +compile the image with: +``` +docker build . ``` ### Current limitations From d4cff67f034bd0ce89ca24d78ca927d3453b6840 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 14:45:51 +0000 Subject: [PATCH 08/34] ogma-cli: Demo job for CI. Refs #136. This commit adds a CI Job that checks that Ogma can generate a ROS monitoring package, and the package compiles correctly using the dockerfile generated with the ROS package. --- .../workflows/repo-ghc-8.6-cabal-2.4-ros.yml | 54 +++++++++++++++++++ ogma-cli/examples/ros-copilot/ROS.hs | 20 +++++++ ogma-cli/examples/ros-copilot/handlers | 1 + ogma-cli/examples/ros-copilot/variables | 1 + ogma-cli/examples/ros-copilot/vars-db | 1 + 5 files changed, 77 insertions(+) create mode 100644 .github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml create mode 100644 ogma-cli/examples/ros-copilot/ROS.hs create mode 100644 ogma-cli/examples/ros-copilot/handlers create mode 100644 ogma-cli/examples/ros-copilot/variables create mode 100644 ogma-cli/examples/ros-copilot/vars-db diff --git a/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml b/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml new file mode 100644 index 00000000..be899c4f --- /dev/null +++ b/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml @@ -0,0 +1,54 @@ +name: ros-ghc-8.6-cabal-2.4 + +# Trigger the workflow on push or pull request +on: + - pull_request + - push + +jobs: + cabal: + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + cabal: ["2.4"] + ghc: + - "8.6" + + steps: + + - uses: haskell-actions/setup@main + id: setup-haskell-cabal + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Prepare environment + run: | + echo "$HOME/.ghcup/bin" >> $GITHUB_PATH + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + + - uses: actions/checkout@v4 + + - name: Create sandbox + run: | + echo "$PWD/.cabal-sandbox/bin" >> $GITHUB_PATH + cabal v1-sandbox init + + - name: Install dependencies + run: | + cabal v1-install alex happy + + - name: Install ogma + run: | + cabal v1-install copilot ogma-**/ --constraint="copilot >= 3.19.1" + + - name: Generate ROS app + run: | + ogma ros --app-target-dir demo --variable-db ogma-cli/examples/ros-copilot/vars-db --variable-file ogma-cli/examples/ros-copilot/variables --handlers-file ogma-cli/examples/ros-copilot/handlers + cabal v1-exec -- runhaskell ogma-cli/examples/ros-copilot/ROS.hs + find demo/ + cd demo/ + docker build . diff --git a/ogma-cli/examples/ros-copilot/ROS.hs b/ogma-cli/examples/ros-copilot/ROS.hs new file mode 100644 index 00000000..034d4291 --- /dev/null +++ b/ogma-cli/examples/ros-copilot/ROS.hs @@ -0,0 +1,20 @@ +import Copilot.Compile.C99 +import Copilot.Language +import Language.Copilot (reify) +import Prelude hiding (not, (>=)) + +inputSignal :: Stream Int64 +inputSignal = extern "input_signal" Nothing + +propTestCopilot :: Stream Bool +propTestCopilot = inputSignal >= 5 + +spec :: Spec +spec = do + trigger "handlerTestCopilot" (not propTestCopilot) [] + +main :: IO () +main = reify spec >>= compileWith settings "monitor" + where + settings = mkDefaultCSettings + { cSettingsOutputDirectory = "demo/copilot/src/" } diff --git a/ogma-cli/examples/ros-copilot/handlers b/ogma-cli/examples/ros-copilot/handlers new file mode 100644 index 00000000..b56f01b4 --- /dev/null +++ b/ogma-cli/examples/ros-copilot/handlers @@ -0,0 +1 @@ +handlerTestCopilot diff --git a/ogma-cli/examples/ros-copilot/variables b/ogma-cli/examples/ros-copilot/variables new file mode 100644 index 00000000..4c4c321e --- /dev/null +++ b/ogma-cli/examples/ros-copilot/variables @@ -0,0 +1 @@ +input_signal diff --git a/ogma-cli/examples/ros-copilot/vars-db b/ogma-cli/examples/ros-copilot/vars-db new file mode 100644 index 00000000..fd94daa0 --- /dev/null +++ b/ogma-cli/examples/ros-copilot/vars-db @@ -0,0 +1 @@ +("input_signal","int64_t","/demo/topic","int64_t") From 333704a0fe44a54ce48c65e6e768199d8d630738 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 17:19:15 +0000 Subject: [PATCH 09/34] ogma-core: Document changes in CHANGELOG. Refs #136. --- ogma-core/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-core/CHANGELOG.md b/ogma-core/CHANGELOG.md index f8795c86..f37c3d25 100644 --- a/ogma-core/CHANGELOG.md +++ b/ogma-core/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-core +## [1.X.X] - 2024-05-20 + +* Make ros command generate dockerfile (#136). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 5d226c96623f76417c5c1f23043d40fec423ae53 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 20 May 2024 17:19:38 +0000 Subject: [PATCH 10/34] ogma-cli: Document changes in CHANGELOG. Refs #136. --- ogma-cli/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index f02196b6..4a9adb38 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -1,7 +1,9 @@ # Revision history for ogma-cli -## [1.X.X] - 2024-05-19 +## [1.X.X] - 2024-05-20 + * Introduce CI test job (#139). +* Introduce test job for ROS package generation (#136). ## [1.3.0] - 2024-03-21 From 87bd5e847651fcb712fd0a64c532c0952fc94fdc Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Tue, 21 May 2024 16:20:48 +0000 Subject: [PATCH 11/34] ogma-core: Map float and double to the same types in C++. Refs #138. The ROS backend is, by default, assuming that the data carried by std_msgs::msg::Float32 is of type float32, when it appears to be just a float. The same is happening for Float64, float64 and double. The code currently produced for those cases does not compile. The type mappings are described in http://docs.ros.org/en/humble/Concepts/Basic/About-Interfaces.html, which states that, in C++, float and double should be used. This commit modifies the ROS backend so that it expects global variables of input types `float` and `double` in the variable DB to have the types `float` and `double`, respectively, in the generated C++ code. --- ogma-core/src/Command/ROSApp.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ogma-core/src/Command/ROSApp.hs b/ogma-core/src/Command/ROSApp.hs index 8d13280f..9528b34f 100644 --- a/ogma-core/src/Command/ROSApp.hs +++ b/ogma-core/src/Command/ROSApp.hs @@ -403,8 +403,8 @@ rosMonitorContents varNames variables msgIds msgNames msgDatas monitors = "int16_t" -> "std::int16_t" "int32_t" -> "std::int32_t" "int64_t" -> "std::int64_t" - "float" -> "std::float32" - "double" -> "std::float64" + "float" -> "float" + "double" -> "double" def -> def msgSubscriptionS = unlines From 554518f6f8ef6510094bb638950d31de89b51cd5 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 06:10:56 +0000 Subject: [PATCH 12/34] ogma-cli: Add a float and a double input variable to ROS example. Refs #138. This commit modifies an example to use also an input variable of type float and one of type double, both of which were failing in the ROS backend. The example in question is currently being used by a CI script to test the ROS backend, making the new example serve as a regression test. --- ogma-cli/examples/ros-copilot/ROS.hs | 10 +++++++++- ogma-cli/examples/ros-copilot/variables | 2 ++ ogma-cli/examples/ros-copilot/vars-db | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ogma-cli/examples/ros-copilot/ROS.hs b/ogma-cli/examples/ros-copilot/ROS.hs index 034d4291..a035a8a2 100644 --- a/ogma-cli/examples/ros-copilot/ROS.hs +++ b/ogma-cli/examples/ros-copilot/ROS.hs @@ -1,13 +1,21 @@ import Copilot.Compile.C99 import Copilot.Language import Language.Copilot (reify) -import Prelude hiding (not, (>=)) +import Prelude hiding (not, (&&), (>=)) inputSignal :: Stream Int64 inputSignal = extern "input_signal" Nothing +inputSignalFloat :: Stream Float +inputSignalFloat = extern "input_signal_float" Nothing + +inputSignalDouble :: Stream Double +inputSignalDouble = extern "input_signal_double" Nothing + propTestCopilot :: Stream Bool propTestCopilot = inputSignal >= 5 + && inputSignalFloat >= 5 + && inputSignalDouble >= 5 spec :: Spec spec = do diff --git a/ogma-cli/examples/ros-copilot/variables b/ogma-cli/examples/ros-copilot/variables index 4c4c321e..aeab3f10 100644 --- a/ogma-cli/examples/ros-copilot/variables +++ b/ogma-cli/examples/ros-copilot/variables @@ -1 +1,3 @@ input_signal +input_signal_float +input_signal_double diff --git a/ogma-cli/examples/ros-copilot/vars-db b/ogma-cli/examples/ros-copilot/vars-db index fd94daa0..5fb4e854 100644 --- a/ogma-cli/examples/ros-copilot/vars-db +++ b/ogma-cli/examples/ros-copilot/vars-db @@ -1 +1,3 @@ ("input_signal","int64_t","/demo/topic","int64_t") +("input_signal_float","float","/demo/topicf","float") +("input_signal_double","double","/demo/topicd","double") From 7cb7aaba12625763898acf710605e28ae58fcd75 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Tue, 21 May 2024 16:22:32 +0000 Subject: [PATCH 13/34] ogma-core: Document changes in CHANGELOG. Refs #138. --- ogma-core/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogma-core/CHANGELOG.md b/ogma-core/CHANGELOG.md index f37c3d25..debc9305 100644 --- a/ogma-core/CHANGELOG.md +++ b/ogma-core/CHANGELOG.md @@ -1,8 +1,9 @@ # Revision history for ogma-core -## [1.X.X] - 2024-05-20 +## [1.X.X] - 2024-05-21 * Make ros command generate dockerfile (#136). +* Map float and double to the same types in C++ (#138). ## [1.3.0] - 2024-03-21 From b20fdafc4324804f4c398b82174aba9421ceac5d Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 06:14:47 +0000 Subject: [PATCH 14/34] ogma-cli: Document changes in CHANGELOG. Refs #138. --- ogma-cli/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index 4a9adb38..9f59a423 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -1,9 +1,10 @@ # Revision history for ogma-cli -## [1.X.X] - 2024-05-20 +## [1.X.X] - 2024-05-21 * Introduce CI test job (#139). * Introduce test job for ROS package generation (#136). +* Add a float and a double input variable to ROS example (#138). ## [1.3.0] - 2024-03-21 From 9e4b4c1e675e8c1a249852a2687255b901a17468 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:37:20 +0000 Subject: [PATCH 15/34] ogma-cli: Document format of variable DB. Refs #143. The README does not explain the structure that the variable DB files for ROS should have. Because ogma doesn't give much information to users when a variable cannot be found in the var DB, users do not know what to put in each field in the variable DB, and what effect it will have in the program. This commit adds a subsection to the ROS section of the README explaining the structure and format of the variable DB. --- ogma-cli/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ogma-cli/README.md b/ogma-cli/README.md index c7e73093..6d22e140 100644 --- a/ogma-cli/README.md +++ b/ogma-cli/README.md @@ -231,6 +231,34 @@ compile the image with: docker build . ``` +### Format of the Variables DB File + +The argument variable DB passed to the ROS backend should contain a list of +variables, together with their types and the corresponding ROS topic in which +those variables are passed. Each line in that file has the format: + +``` +("","","","") +``` + +For example, an input variable called "temperature" of type 64-bit signed +integer coming in a ROS topic called "/battery/temperature" should have a +matching entry in the variable DB file like the following: + +``` +("temperature","int64_t","/battery/temperature","ignore") +``` + +There should never be two lines in the same file with the same variable name. +Variables in the DB that are not not used in any of the properties being +monitored and/or are not listed in the variable file passed as argument to the +ROS command will be ignored. + +For a more concrete example, see the files in `ogma-cli/examples/ros-copilot/` +and the last step of the script +`.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml`, which generates a ROS +monitor with multiple variables and compiles the resulting code. + ### Current limitations The user must place the code generated by Copilot monitors in two files, From ab8e8ac7294a9c25237d08dd302690fd6f05e39d Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:39:01 +0000 Subject: [PATCH 16/34] ogma-cli: Document changes in CHANGELOG. Refs #143. --- ogma-cli/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index 9f59a423..5a49fc9e 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -5,6 +5,7 @@ * Introduce CI test job (#139). * Introduce test job for ROS package generation (#136). * Add a float and a double input variable to ROS example (#138). +* Document format of variable DB (#143). ## [1.3.0] - 2024-03-21 From c003fc215026b8c553d9529ba7cd545c84c7a6c1 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 17/34] ogma-extra: Version bump (1.4.0). Refs #145. --- ogma-extra/ogma-extra.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogma-extra/ogma-extra.cabal b/ogma-extra/ogma-extra.cabal index 1c0029b6..f0abfb0f 100644 --- a/ogma-extra/ogma-extra.cabal +++ b/ogma-extra/ogma-extra.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Simple name: ogma-extra -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf From 174b005bf31b541cb8709666d9543258d4874210 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 18/34] ogma-spec: Version bump (1.4.0). Refs #145. --- ogma-spec/ogma-spec.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogma-spec/ogma-spec.cabal b/ogma-spec/ogma-spec.cabal index 26d7ece5..b9e0722f 100644 --- a/ogma-spec/ogma-spec.cabal +++ b/ogma-spec/ogma-spec.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Simple name: ogma-spec -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf From 162871462bf5f0e0638e51eb41d39b94f913ae33 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 19/34] ogma-language-smv: Version bump (1.4.0). Refs #145. --- ogma-language-smv/ogma-language-smv.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogma-language-smv/ogma-language-smv.cabal b/ogma-language-smv/ogma-language-smv.cabal index 236f39d2..51c79e66 100644 --- a/ogma-language-smv/ogma-language-smv.cabal +++ b/ogma-language-smv/ogma-language-smv.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Custom name: ogma-language-smv -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf From 2a692a8730099f13f0c0018138faba10f57f3661 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 20/34] ogma-language-jsonspec: Version bump (1.4.0). Refs #145. --- ogma-language-jsonspec/ogma-language-jsonspec.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ogma-language-jsonspec/ogma-language-jsonspec.cabal b/ogma-language-jsonspec/ogma-language-jsonspec.cabal index 74e5bf04..8817c133 100644 --- a/ogma-language-jsonspec/ogma-language-jsonspec.cabal +++ b/ogma-language-jsonspec/ogma-language-jsonspec.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Simple name: ogma-language-jsonspec -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf @@ -70,7 +70,7 @@ library , megaparsec , bytestring - , ogma-spec >= 1.3.0 && < 1.4 + , ogma-spec >= 1.4.0 && < 1.5 hs-source-dirs: src From a87302e7afcde6b8c11904f2572b84d64a7ccae4 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 21/34] ogma-language-copilot: Version bump (1.4.0). Refs #145. --- ogma-language-copilot/ogma-language-copilot.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogma-language-copilot/ogma-language-copilot.cabal b/ogma-language-copilot/ogma-language-copilot.cabal index 1ca72f57..4ee0539c 100644 --- a/ogma-language-copilot/ogma-language-copilot.cabal +++ b/ogma-language-copilot/ogma-language-copilot.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Simple name: ogma-language-copilot -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf From 64755d5ceb5a067299fa306fd7317b953948b721 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 22/34] ogma-language-cocospec: Version bump (1.4.0). Refs #145. --- ogma-language-cocospec/ogma-language-cocospec.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogma-language-cocospec/ogma-language-cocospec.cabal b/ogma-language-cocospec/ogma-language-cocospec.cabal index b51094e4..b5814afd 100644 --- a/ogma-language-cocospec/ogma-language-cocospec.cabal +++ b/ogma-language-cocospec/ogma-language-cocospec.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Custom name: ogma-language-cocospec -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf From a6aeedfc8318c20d720f76ca7d12cabda38301d7 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 23/34] ogma-language-c: Version bump (1.4.0). Refs #145. --- ogma-language-c/ogma-language-c.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogma-language-c/ogma-language-c.cabal b/ogma-language-c/ogma-language-c.cabal index b2fce136..a7d8ebd4 100644 --- a/ogma-language-c/ogma-language-c.cabal +++ b/ogma-language-c/ogma-language-c.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Custom name: ogma-language-c -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf From 28aff9fbca9fc832dfdd573d8960efce0a59e298 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 24/34] ogma-core: Version bump (1.4.0). Refs #145. --- ogma-core/ogma-core.cabal | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ogma-core/ogma-core.cabal b/ogma-core/ogma-core.cabal index dbd95c17..a89d79e1 100644 --- a/ogma-core/ogma-core.cabal +++ b/ogma-core/ogma-core.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Simple name: ogma-core -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf @@ -110,13 +110,13 @@ library , IfElse , mtl - , ogma-extra >= 1.3.0 && < 1.4 - , ogma-language-c >= 1.3.0 && < 1.4 - , ogma-language-cocospec >= 1.3.0 && < 1.4 - , ogma-language-copilot >= 1.3.0 && < 1.4 - , ogma-language-jsonspec >= 1.3.0 && < 1.4 - , ogma-language-smv >= 1.3.0 && < 1.4 - , ogma-spec >= 1.3.0 && < 1.4 + , ogma-extra >= 1.4.0 && < 1.5 + , ogma-language-c >= 1.4.0 && < 1.5 + , ogma-language-cocospec >= 1.4.0 && < 1.5 + , ogma-language-copilot >= 1.4.0 && < 1.5 + , ogma-language-jsonspec >= 1.4.0 && < 1.5 + , ogma-language-smv >= 1.4.0 && < 1.5 + , ogma-spec >= 1.4.0 && < 1.5 hs-source-dirs: src From 993bb8b212826dab28389ba266abe486303fa5d7 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 07:58:45 -0700 Subject: [PATCH 25/34] ogma-cli: Version bump (1.4.0). Refs #145. --- ogma-cli/ogma-cli.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ogma-cli/ogma-cli.cabal b/ogma-cli/ogma-cli.cabal index 8ca756fe..3aea7df1 100644 --- a/ogma-cli/ogma-cli.cabal +++ b/ogma-cli/ogma-cli.cabal @@ -32,7 +32,7 @@ cabal-version: 2.0 build-type: Simple name: ogma-cli -version: 1.3.0 +version: 1.4.0 homepage: http://nasa.gov license: OtherLicense license-file: LICENSE.pdf @@ -141,7 +141,7 @@ executable ogma build-depends: base >= 4.11.0.0 && < 5 , optparse-applicative - , ogma-core >= 1.3.0 && < 1.4 + , ogma-core >= 1.4.0 && < 1.5 hs-source-dirs: src From 576f7419806d282970b81467a0f90159fc48cb31 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 26/34] ogma-extra: Document changes in CHANGELOG. Refs #145. --- ogma-extra/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-extra/CHANGELOG.md b/ogma-extra/CHANGELOG.md index f9b55e2c..43c8a28f 100644 --- a/ogma-extra/CHANGELOG.md +++ b/ogma-extra/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-extra +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 55224f985fadedbfdf301339df1841a0f1d66068 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 27/34] ogma-spec: Document changes in CHANGELOG. Refs #145. --- ogma-spec/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-spec/CHANGELOG.md b/ogma-spec/CHANGELOG.md index 046a16fc..8340a7c2 100644 --- a/ogma-spec/CHANGELOG.md +++ b/ogma-spec/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-spec +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From e7e667d8c5d2eeded6fa7bbd98b653b26e42107c Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 28/34] ogma-language-smv: Document changes in CHANGELOG. Refs #145. --- ogma-language-smv/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-language-smv/CHANGELOG.md b/ogma-language-smv/CHANGELOG.md index 586ea3dc..ef69fe12 100644 --- a/ogma-language-smv/CHANGELOG.md +++ b/ogma-language-smv/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-language-smv +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 5f117115e5e8002cafdafc12fb92619df548c63c Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 29/34] ogma-language-jsonspec: Document changes in CHANGELOG. Refs #145. --- ogma-language-jsonspec/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-language-jsonspec/CHANGELOG.md b/ogma-language-jsonspec/CHANGELOG.md index 370c86b8..ed9d1f79 100644 --- a/ogma-language-jsonspec/CHANGELOG.md +++ b/ogma-language-jsonspec/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-language-jsonspec +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 01f35429c211e102b37918fd5122244a1d3cb81d Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 30/34] ogma-language-copilot: Document changes in CHANGELOG. Refs #145. --- ogma-language-copilot/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-language-copilot/CHANGELOG.md b/ogma-language-copilot/CHANGELOG.md index 0c7ede90..0c18191e 100644 --- a/ogma-language-copilot/CHANGELOG.md +++ b/ogma-language-copilot/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-language-copilot +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 4b02156db202647669eeb439a24e29e3eec72a06 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 31/34] ogma-language-cocospec: Document changes in CHANGELOG. Refs #145. --- ogma-language-cocospec/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-language-cocospec/CHANGELOG.md b/ogma-language-cocospec/CHANGELOG.md index cde71b23..504b729e 100644 --- a/ogma-language-cocospec/CHANGELOG.md +++ b/ogma-language-cocospec/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-language-cocospec +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 6fedb8ca3ccaab61b0991a1417d61a6e2e0565c7 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 32/34] ogma-language-c: Document changes in CHANGELOG. Refs #145. --- ogma-language-c/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogma-language-c/CHANGELOG.md b/ogma-language-c/CHANGELOG.md index f5525fbc..e07fdcf5 100644 --- a/ogma-language-c/CHANGELOG.md +++ b/ogma-language-c/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ogma-language-c +## [1.4.0] - 2024-05-21 + +* Version bump 1.4.0 (#145). + ## [1.3.0] - 2024-03-21 * Version bump 1.3.0 (#133). From 6fe574bafc1949096c79291aae777495cac14162 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 33/34] ogma-core: Document changes in CHANGELOG. Refs #145. --- ogma-core/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogma-core/CHANGELOG.md b/ogma-core/CHANGELOG.md index debc9305..1090c405 100644 --- a/ogma-core/CHANGELOG.md +++ b/ogma-core/CHANGELOG.md @@ -1,7 +1,8 @@ # Revision history for ogma-core -## [1.X.X] - 2024-05-21 +## [1.4.0] - 2024-05-21 +* Version bump 1.4.0 (#145). * Make ros command generate dockerfile (#136). * Map float and double to the same types in C++ (#138). From 2071ab0240eb7bb8863dc7cde2a935d5a96c095d Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Wed, 22 May 2024 08:01:37 -0700 Subject: [PATCH 34/34] ogma-cli: Document changes in CHANGELOG. Refs #145. --- ogma-cli/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index 5a49fc9e..d0b405d5 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -1,7 +1,8 @@ # Revision history for ogma-cli -## [1.X.X] - 2024-05-21 +## [1.4.0] - 2024-05-21 +* Version bump 1.4.0 (#145). * Introduce CI test job (#139). * Introduce test job for ROS package generation (#136). * Add a float and a double input variable to ROS example (#138).