Skip to content

Commit

Permalink
add scripts to generate c headers and python from DSDL and worfklow t…
Browse files Browse the repository at this point in the history
…o test them
  • Loading branch information
PonomarevDA committed Nov 23, 2024
1 parent 50fd637 commit b403138
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/dsdl_generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: dsdl_generation
on: [push]

jobs:
generate_dsdl:
strategy:
matrix:
language: [cpp, python]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install requirements
run: pip install yakut

- name: Catkin build
run: ./scripts/generate_${{ matrix.language }}_from_dsdl.sh
10 changes: 10 additions & 0 deletions scripts/generate_cpp_from_dsdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# This software is distributed under the terms of the GPL v3 License.
# Copyright (c) 2022-2023 Dmitry Ponomarev.
# Author: Dmitry Ponomarev <[email protected]>

CRNT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPO_DIR="$(dirname "$CRNT_DIR")"
OUTPUT_DIR=${REPO_DIR}/src/nunavut_out

$REPO_DIR/Libs/cyphal_application/scripts/nnvg_generate_c_headers.sh ${OUTPUT_DIR}
18 changes: 18 additions & 0 deletions scripts/generate_python_from_dsdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# This software is distributed under the terms of the GPL v3 License.
# Copyright (c) 2022-2023 Dmitry Ponomarev.
# Author: Dmitry Ponomarev <[email protected]>

CRNT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPO_DIR="$(dirname "$CRNT_DIR")"
YAKUT_COMPILE_OUTPUT=$REPO_DIR/compile_output

cd $REPO_DIR

DSDL_PATH=$REPO_DIR/Libs/cyphal_application/Libs/public_regulated_data_types
yakut compile $DSDL_PATH/uavcan $DSDL_PATH/reg -O $YAKUT_COMPILE_OUTPUT

ZUBAX_DSDL_PATH=$REPO_DIR/Libs/cyphal_application/Libs/zubax_dsdl
git clone https://github.com/Zubax/zubax_dsdl.git ${ZUBAX_DSDL_PATH}
cd ${ZUBAX_DSDL_PATH} && git checkout b14f6c8 && cd ${REPO_DIR}
yakut compile $DSDL_PATH/uavcan $ZUBAX_DSDL_PATH/zubax -O $YAKUT_COMPILE_OUTPUT

0 comments on commit b403138

Please sign in to comment.