forked from francescodelduchetto/sentor
-
Notifications
You must be signed in to change notification settings - Fork 9
First version working for ROS2 #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e20ec4a
Replace repository content with ROS2 packages
Cyano0 719f67d
Update node monitor
Cyano0 3753120
Updat README.md
Cyano0 db29705
Updat README.md
Cyano0 ec020a2
Update sentor/sentor/TopicMonitor.py
Cyano0 761bc72
restructure for devcontainer etc
marc-hanheide 6e1cd40
Revert "restructure for devcontainer etc"
marc-hanheide 6bdc01c
Merge branch 'master' of https://github.com/Cyano0/sentor into ros2-r…
marc-hanheide a56fba1
restructure for dev container and CI
marc-hanheide e9b05b1
Update Dockerfile and devcontainer configuration; change Python sheba…
marc-hanheide df74cfa
Update Dockerfile and devcontainer.json; install black and flake8, an…
marc-hanheide e1c8d45
Merge pull request #1 from LCAS/ros2-restructure
Cyano0 855a8d0
Update package.xml
Cyano0 a5b5dee
Update SafetyMonitor.py
Cyano0 d72af8c
Update Executor.py
Cyano0 3553dae
Update Dockerfile add ros-humble-controller-manager-msgs
Cyano0 f9aa32a
Update package.xml with ROS dependencies for sentor
d0a8f9f
Update src/sentor/sentor/ROSTopicHz.py
Cyano0 724688b
Update src/sentor/scripts/test_sentor.py
Cyano0 b4c1ad0
Update cache to avoid repeating expensive look‑ups
c8706b6
Add launch files and update package.xml for Sentor monitoring system
marc-hanheide 184176d
Merge pull request #2 from LCAS/pr/marc-hanheide/60
Cyano0 54acaa6
Update sentor_node for proper naming
0e8ad06
delete test_sentor
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,34 @@ | ||
| ARG BASE_IMAGE=lcas.lincoln.ac.uk/lcas/ros-docker-images:humble-2 | ||
|
|
||
| FROM ${BASE_IMAGE} AS base | ||
|
|
||
| USER root | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -qq -y --no-install-recommends \ | ||
| git \ | ||
| python3-pip \ | ||
| ros-humble-controller-manager-msgs \ | ||
| python3-rosdep | ||
|
|
||
| # get the source tree and analyse it for its package.xml only | ||
| FROM base AS sourcefilter | ||
| COPY ./src /tmp/src | ||
| # remove everything that isn't package.xml | ||
| RUN find /tmp/src -type f \! -name "package.xml" -print | xargs rm -rf | ||
|
|
||
| # install all dependencies listed in the package.xml | ||
| FROM base AS depbuilder | ||
| # copy the reduced source tree (only package.xml) from previous stage | ||
| COPY --from=sourcefilter /tmp/src /tmp/src | ||
| RUN rosdep update --rosdistro ${ROS_DISTRO} && apt-get update | ||
| RUN cd /tmp/src && rosdep install --from-paths . --ignore-src -r -y && cd && rm -rf /tmp/src | ||
|
|
||
| FROM depbuilder AS final | ||
|
|
||
| RUN pip install black flake8 | ||
|
|
||
| # add sudo without password | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
This file contains hidden or 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,29 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
| // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
| { | ||
| "name": "L-CAS ROS Humble Devcontainer for Sentor", | ||
| "build": { | ||
| "dockerfile": "./Dockerfile", | ||
| "args": { | ||
| "BASE_IMAGE": "lcas.lincoln.ac.uk/lcas/ros-docker-images:humble-2" | ||
| }, | ||
| "context": ".." | ||
| }, | ||
|
|
||
| "postStartCommand": "/opt/entrypoint.sh /bin/true; .devcontainer/post-create.sh", | ||
|
|
||
| "updateRemoteUserUID": true, // ensure internal user has the same UID as the host user and update file permissions | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "ms-python.python", | ||
| "GitHub.vscode-pull-request-github", | ||
| "ms-vscode.cpptools", | ||
| "JaehyunShim.vscode-ros2", | ||
| "nonanonno.vscode-ros2", | ||
| "deitry.colcon-helper", | ||
| "github.vscode-github-actions" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,34 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -xe | ||
|
|
||
|
|
||
| function add_config_if_not_exist { | ||
| if ! grep -F -q "$1" $HOME/.bashrc; then | ||
| echo "$1" >> $HOME/.bashrc | ||
| fi | ||
| } | ||
|
|
||
| function add_git_config_if_not_exist { | ||
| if ! git config --global --get "$1" > /dev/null; then | ||
| git config --global "$1" "$2" | ||
| fi | ||
| } | ||
|
|
||
| add_config_if_not_exist "source /opt/ros/$ROS_DISTRO/setup.bash" | ||
|
|
||
| source /opt/ros/$ROS_DISTRO/setup.bash | ||
|
|
||
| colcon build --symlink-install --continue-on-error || true | ||
|
|
||
| LOCAL_SETUP_FILE=`pwd`/install/setup.bash | ||
| add_config_if_not_exist "if [ -r $LOCAL_SETUP_FILE ]; then source $LOCAL_SETUP_FILE; fi" | ||
|
|
||
|
|
||
| add_git_config_if_not_exist "core.autocrlf" "input" | ||
| add_git_config_if_not_exist "core.safecrlf" "warn" | ||
| add_git_config_if_not_exist "pull.rebase" "false" | ||
| add_git_config_if_not_exist "user.name" "Anonymous L-CAS DevContainer User" | ||
| add_git_config_if_not_exist "user.email" "[email protected]" | ||
| add_git_config_if_not_exist "init.defaultBranch" "main" | ||
|
|
This file contains hidden or 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,31 @@ | ||
| name: 'devcontainer CI' | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: | ||
| - ros2-devel | ||
| - master | ||
| push: | ||
| branches: | ||
| - ros2-devel | ||
| - master | ||
|
|
||
| jobs: | ||
| build_devcontainer: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout from github | ||
| uses: actions/checkout@v3 | ||
| - name: extract the github reference | ||
| run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
| - name: "image name from repo name" | ||
| id: docker_image_name | ||
| run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT} | ||
| - name: Build and run dev container task | ||
| uses: devcontainers/[email protected] | ||
| with: | ||
| imageName: devcontainer/${{ steps.docker_image_name.outputs.docker_image }} | ||
| configFile: ./.devcontainer/devcontainer.json | ||
| push: never | ||
| #imageTag: ${{ matrix.config }}-${{ env.BRANCH }} | ||
| #runCmd: "bash .devcontainer/run-ci.sh" |
This file contains hidden or 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,70 @@ | ||
| name: ros CI | ||
|
|
||
| on: | ||
| push: | ||
| # you may want to configure the branches that this should be run on here. | ||
| branches: [ "master", "ros2-devel" ] | ||
| pull_request: | ||
| branches: [ "master", "ros2-devel" ] | ||
|
|
||
| jobs: | ||
| test_docker: # On Linux, iterates on all ROS 1 and ROS 2 distributions. | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| ros_distribution: | ||
| # - noetic | ||
| - humble | ||
| # - iron | ||
|
|
||
| # Define the Docker image(s) associated with each ROS distribution. | ||
| # The include syntax allows additional variables to be defined, like | ||
| # docker_image in this case. See documentation: | ||
| # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build | ||
| # | ||
| # Platforms are defined in REP 3 and REP 2000: | ||
| # https://ros.org/reps/rep-0003.html | ||
| # https://ros.org/reps/rep-2000.html | ||
| include: | ||
| # Noetic Ninjemys (May 2020 - May 2025) | ||
| # - docker_image: ubuntu:focal | ||
| # ros_distribution: noetic | ||
| # ros_version: 1 | ||
|
|
||
| # Humble Hawksbill (May 2022 - May 2027) | ||
| - docker_image: ubuntu:jammy | ||
| ros_distribution: humble | ||
| ros_version: 2 | ||
|
|
||
| # Iron Irwini (May 2023 - November 2024) | ||
| # - docker_image: ubuntu:jammy | ||
| # ros_distribution: iron | ||
| # ros_version: 2 | ||
|
|
||
| # # Rolling Ridley (No End-Of-Life) | ||
| # - docker_image: ubuntu:jammy | ||
| # ros_distribution: rolling | ||
| # ros_version: 2 | ||
|
|
||
| container: | ||
| image: ${{ matrix.docker_image }} | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: setup ROS environment | ||
| uses: LCAS/setup-ros@master | ||
| with: | ||
| required-ros-distributions: ${{ matrix.ros_distribution }} | ||
| - name: build and test ROS 1 | ||
| if: ${{ matrix.ros_version == 1 }} | ||
| uses: ros-tooling/[email protected] | ||
| with: | ||
| import-token: ${{ github.token }} | ||
| target-ros1-distro: ${{ matrix.ros_distribution }} | ||
| skip-tests: true | ||
| - name: build and test ROS 2 | ||
| if: ${{ matrix.ros_version == 2 }} | ||
| uses: ros-tooling/[email protected] | ||
| with: | ||
| import-token: ${{ github.token }} | ||
| target-ros2-distro: ${{ matrix.ros_distribution }} | ||
| skip-tests: true |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,101 +1,52 @@ | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| env/ | ||
| devel/ | ||
| log/ | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| bin/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
|
|
||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| .hypothesis/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Django stuff: | ||
| *.log | ||
| local_settings.py | ||
|
|
||
| # Flask stuff: | ||
| instance/ | ||
| .webassets-cache | ||
|
|
||
| # Scrapy stuff: | ||
| .scrapy | ||
|
|
||
| # Sphinx documentation | ||
| docs/_build/ | ||
|
|
||
| # PyBuilder | ||
| target/ | ||
|
|
||
| # Jupyter Notebook | ||
| .ipynb_checkpoints | ||
|
|
||
| # pyenv | ||
| .python-version | ||
|
|
||
| # celery beat schedule file | ||
| celerybeat-schedule | ||
|
|
||
| # SageMath parsed files | ||
| *.sage.py | ||
|
|
||
| # dotenv | ||
| .env | ||
|
|
||
| # virtualenv | ||
| .venv | ||
| venv/ | ||
| ENV/ | ||
|
|
||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
|
|
||
| # Rope project settings | ||
| .ropeproject | ||
|
|
||
| # mkdocs documentation | ||
| /site | ||
|
|
||
| # mypy | ||
| .mypy_cache/ | ||
| install/ | ||
| msg_gen/ | ||
| srv_gen/ | ||
| msg/*Action.msg | ||
| msg/*ActionFeedback.msg | ||
| msg/*ActionGoal.msg | ||
| msg/*ActionResult.msg | ||
| msg/*Feedback.msg | ||
| msg/*Goal.msg | ||
| msg/*Result.msg | ||
| msg/_*.py | ||
| build_isolated/ | ||
| devel_isolated/ | ||
|
|
||
| # Generated by dynamic reconfigure | ||
| *.cfgc | ||
| /cfg/cpp/ | ||
| /cfg/*.py | ||
|
|
||
| # Ignore generated docs | ||
| *.dox | ||
| *.wikidoc | ||
|
|
||
| # eclipse stuff | ||
| .project | ||
| .cproject | ||
|
|
||
| # qcreator stuff | ||
| CMakeLists.txt.user | ||
|
|
||
| srv/_*.py | ||
| *.pcd | ||
| *.pyc | ||
| qtcreator-* | ||
| *.user | ||
|
|
||
| /planning/cfg | ||
| /planning/docs | ||
| /planning/src | ||
|
|
||
| *~ | ||
|
|
||
| # Emacs | ||
| .#* | ||
|
|
||
| # Catkin custom files | ||
| CATKIN_IGNORE |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.