Skip to content

Commit

Permalink
fix: pre-commit and spell checking (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
aohsato authored Nov 28, 2023
1 parent d5ebe3b commit b1c8150
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .ansible-galaxy-requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
collections:
- name: ansible.posix
- name: community.general
157 changes: 157 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"version": "0.2",
"language": "en",
"allowCompoundWords": false,
"ignorePaths": [
"**/*.caffemodel",
"**/*.cpr",
"**/*.cspell.json",
"**/*.css",
"**/*.cu",
"**/*.dae",
"**/*.html",
"**/*.m4a",
"**/*.mp3",
"**/*.onnx",
"**/*.osm",
"**/*.pcd",
"**/*.pt",
"**/*.stl",
"**/*.wav",
"**/*.zip",
"**/*.zst",
"**/.git/**",
"**/.gitignore",
"**/.idea/**",
"**/.mypy_cache/**",
"**/.vscode/**",
"**/__pycache__/**",
"**/build/**",
"**/CPPLINT.cfg",
"**/dist/**",
"**/external/**",
"**/install/**",
"**/log/**",
"**/package-lock.json",
"**/public/**",
"**/reports*/**"
],
"ignoreRegExpList": [
"\\[.*/.*\\]\\(https://github.com",
"github.com[/:][\\w._\\-]+(/[\\w._\\-]+)?"
],
"overrides": [
{
"filename": "**/*.md",
"ignoreRegExpList": [
"\\(Contribution by .+?\\)",
"\\]\\(#.+?\\)",
"^\\| GPU Name.+$",
"^gdown .+$",
"uses: .+/.+@.+"
]
},
{
"filename": "**/*.py",
"ignoreRegExpList": ["author(_email)?=.*$", "maintainer(_email)?=.*$"]
},
{
"filename": "**/*.rst",
"ignoreRegExpList": [
"^.*Co-authored-by:.+$",
"^.*Contributors:.+$",
"^.*Merge branch.+$",
"^.*Merge pull request .*$"
]
},
{
"filename": "**/*.toml",
"ignoreRegExpList": ["authors = .*?$", "maintainers = .*?$"]
},
{
"filename": "**/*.txt",
"ignoreRegExpList": ["download\\(.+\\)"]
},
{
"filename": "**/*.xosc",
"ignoreRegExpList": ["author=\".*?\""]
},
{
"filename": "**/*.yaml",
"ignoreRegExpList": ["author: .+$", "git_email: .+$", "git_user: .+$", "uses: .+$"]
},
{
"filename": "**/package.json",
"ignoreRegExpList": ["\"author\": .*"]
},
{
"filename": "**/package.xml",
"ignoreRegExpList": ["<author.*?</author>", "<maintainer.*?</maintainer>"]
},
{
"filename": "**/sync-files.yaml",
"ignoreRegExpList": ["dest: .*", "repository: .*", "source: .*"]
},
{
"filename": "**/{*.cpp,*.hpp,*.py,*.sh,*.xml,*.yaml,CMakeLists.txt}",
"ignoreRegExpList": ["Copyright (\\(c\\))?.+$", "FIXME( )?\\(.+?\\)", "TODO( )?\\(.+?\\)"]
},
{
"filename": "**/{*.cpp,*.hpp}",
"ignoreRegExpList": ["@author .*$", "\\author .*$", "Author(s)?( )?: .*$"]
},
{
"filename": "**/{*.drawio,*.svg}",
"ignoreRegExpList": [
"<text .*?>.*?\\.\\.\\.</text>",
"^.*?\\.\\.\\.(</text>)?$",
"data:image/png,.*;",
"etag=&quot;[a-zA-Z0-9 +-/_]+&quot;",
"filter=\"[a-zA-Z0-9 +-/_#()]+\"",
"id=\"[a-zA-Z0-9 +-/_]+\"",
"id=&quot;[a-zA-Z0-9 +-/_]+&quot;",
"name=&quot;[^>]+"
]
},
{
"filename": "**/{*.js,*.ts}",
"ignoreRegExpList": ["owner: .*$", "repo:: .*$"]
}
],
"flagWords": [],
"words": [
"ADLINK",
"apriltags",
"arcyhive",
"backrefs",
"connextdds",
"DBUILD",
"ddirectory",
"debhelper",
"debmake",
"devscripts",
"DRANGE",
"drirections",
"gmsl",
"GMSL",
"imgproc",
"ipfrag",
"kitware",
"libasio",
"libbullet",
"libcunit",
"libflann",
"libpython",
"libtinyxml",
"libyaml",
"linuxptp",
"pyside",
"rmem",
"rosinstall",
"ruamel",
"soruce",
"TIERIV",
"txqueue",
"txqueuelen"
]
}
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit-ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Ansible Galaxy depends for ansible-lint
run: |
ansible-galaxy collection install -f -r .ansible-galaxy-requirements.yaml
- name: Run pre-commit
uses: autowarefoundation/autoware-github-actions/pre-commit@v1
with:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# edge-auto-jetson

This repository provides a sample ROS2 environment working on a Jetson-based ECU and GMSL2-compatible cameras.
This repository provides a sample ROS 2 environment working on a Jetson-based ECU and GMSL2-compatible cameras.

As a sample application, the following images show object detection results using the contents of this repository. Various perception applications will be added in
the future and you can develop them in this provided environment.
Expand All @@ -9,11 +9,11 @@ the future and you can develop them in this provided environment.

![object detection example](docs/sample.png "edge-auto-jetson object detection example")

# Prerequisites
## Prerequisites

### System Overview

This repository is based on a natively built ROS2 environment. The system overview is shown below.
This repository is based on a natively built ROS 2 environment. The system overview is shown below.

![system overview](docs/overview.drawio.svg "edge-auto-jetson overview")

Expand All @@ -22,7 +22,7 @@ This repository is based on a natively built ROS2 environment. The system overvi
- Camera: v4l2 compatible cameras, including [TIER IV Automotive HDR Camera C1](https://sensor.tier4.jp/automotive-hdr-camera)
- ECU: Jetson AGX Xavier based ECU, including [RQX-58G](https://www.adlinktech.com/Products/ROS2_Solution/ROS2_Controller/RQX-580_58G) from ADLINK Technology Inc. and [Developer Kit](https://www.nvidia.com/ja-jp/autonomous-machines/embedded-systems/jetson-agx-xavier) from NVIDIA Corp.
- NVIDIA L4T: R32.6.1 (including Ubuntu 18.04)
- ROS: ROS2 Humble (native build)
- ROS: ROS 2 Humble (native build)

## Getting Started

Expand All @@ -41,13 +41,13 @@ Please see [Tutorials](https://github.com/tier4/edge-auto/tree/main/docs/tutoria
- [tier4/edge_auto_individual_params](https://github.com/tier4/edge_auto_individual_params)
- Repository for managing system parameters including camera parameters, driver parameters, etc.
- [tier4/nebula](https://github.com/tier4/nebula)
- ROS2 package for unified ethernet-based LiDAR driver.
- ROS 2 package for unified ethernet-based LiDAR driver.
- [tier4/tier4_automotive_hdr_camera](https://github.com/tier4/tier4_automotive_hdr_camera)
- Kernel driver for using TIER IV cameras with Video4Linux2 interface.
- [tier4/ros2_v4l2_camera](https://github.com/tier4/ros2_v4l2_camera)
- ROS2 package for camera driver using Video4Linux2.
- ROS 2 package for camera driver using Video4Linux2.
- [tier4/sensor_trigger](https://github.com/tier4/sensor_trigger)
- ROS2 package for generating sensor trigger signals.
- ROS 2 package for generating sensor trigger signals.
- [tier4/calibration_tools](https://github.com/tier4/CalibrationTools)
- Repository for calibration tools to estimate parameters on autonomous driving systems.
- [autowarefoundation/autoware.universe](https://github.com/autowarefoundation/autoware.universe)
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/ros2/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ROS2
# ROS 2

This role installs [ROS 2](https://docs.ros.org) under `/opt/ros`. Because apt binaries for the latest ROS 2 distribution are not available on some NVIDIA L4T environments, such as L4T R32.6.1 (based on Ubuntu18.04), this role installs dependencies, clones ROS 2 source codes, and builds them.

Expand Down
22 changes: 11 additions & 11 deletions ansible/roles/ros2/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- apt-transport-https
install_recommends: false
update_cache: true
- name: Add ROS2 source list
- name: Add ROS 2 source list
shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
- name: Download gpg key
ansible.builtin.uri:
Expand Down Expand Up @@ -54,7 +54,7 @@
- name: add CUDA into PATH
set_fact:
environment:
PATH: "/usr/local/cuda/bin:{{ ansible_env.PATH }}"
PATH: /usr/local/cuda/bin:{{ ansible_env.PATH }}

- name: Python parts
ansible.builtin.pip:
Expand Down Expand Up @@ -98,7 +98,7 @@
ansible.builtin.unarchive:
src: https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz
dest: "{{ source_build_dir }}"
remote_src: yes
remote_src: true
- name: "{{ block_name }}: Build boost"
shell: ./bootstrap.sh --prefix=/usr/local --with-python=python3 && ./b2 install -j7
args:
Expand All @@ -119,7 +119,7 @@
ansible.builtin.unarchive:
src: https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.12.1/source.tar.gz
dest: "{{ source_build_dir }}"
remote_src: yes
remote_src: true
- set_fact:
pcl_build_dir: "{{ source_build_dir }}/pcl/build"
- name: "{{ block_name }}: Create build directory"
Expand All @@ -131,7 +131,7 @@
args:
chdir: "{{ pcl_build_dir }}"
environment:
PATH: "/usr/local/cuda/bin:{{ ansible_env.PATH }}"
PATH: /usr/local/cuda/bin:{{ ansible_env.PATH }}
- name: "{{ block_name }}: build"
shell: make -j7 install
args:
Expand All @@ -152,7 +152,7 @@
ansible.builtin.unarchive:
src: https://github.com/fmtlib/fmt/archive/refs/tags/8.1.1.tar.gz
dest: "{{ source_build_dir }}"
remote_src: yes
remote_src: true
- set_fact:
fmt_build_dir: "{{ source_build_dir }}/fmt-8.1.1/build"
- name: "{{ block_name }}: Create build directory"
Expand Down Expand Up @@ -268,7 +268,7 @@
# Follow drirections here: https://apt.kitware.com/
- name: "{{ block_name }}: update repository info"
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main"
repo: deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main
filename: kitware
- name: "{{ block_name }}: apt update"
ansible.builtin.apt:
Expand Down Expand Up @@ -325,7 +325,7 @@
- name: Build ROS
block:
- set_fact:
ros_base_dir: "/opt/ros/{{ ros_distro }}"
ros_base_dir: /opt/ros/{{ ros_distro }}
- set_fact:
ros_src_dir: "{{ ros_base_dir }}/src"
- name: "{{ block_name }}: Create base directory"
Expand All @@ -339,14 +339,14 @@
state: directory
become: true
- name: "{{ block_name }}: generate repository list using rosinstall_generator"
shell: "rosinstall_generator --deps --rosdistro {{ ros_distro }} ros_base launch_xml launch_yaml launch_testing launch_testing_ament_cmake demo_nodes_cpp demo_nodes_py example_interfaces camera_calibration_parsers camera_info_manager cv_bridge vision_opencv vision_msgs image_geometry image_pipeline image_transport compressed_image_transport compressed_depth_image_transport pcl_msgs perception_pcl --exclude rmw_connextdds > /tmp/ros2.{{ ros_distro }}.ros_base.rosinstall"
shell: rosinstall_generator --deps --rosdistro {{ ros_distro }} ros_base launch_xml launch_yaml launch_testing launch_testing_ament_cmake demo_nodes_cpp demo_nodes_py example_interfaces camera_calibration_parsers camera_info_manager cv_bridge vision_opencv vision_msgs image_geometry image_pipeline image_transport compressed_image_transport compressed_depth_image_transport pcl_msgs perception_pcl --exclude rmw_connextdds > /tmp/ros2.{{ ros_distro }}.ros_base.rosinstall
- name: "{{ block_name }}: copy repository list to target ddirectory"
ansible.builtin.copy:
src: "/tmp/ros2.{{ ros_distro }}.ros_base.rosinstall"
src: /tmp/ros2.{{ ros_distro }}.ros_base.rosinstall
dest: "{{ ros_base_dir }}/ros2.{{ ros_distro }}.ros_base.rosinstall"
become: true
- name: "{{ block_name }}: clone all repositories via vcs"
shell: "vcs import src < ros2.{{ ros_distro }}.ros_base.rosinstall"
shell: vcs import src < ros2.{{ ros_distro }}.ros_base.rosinstall
args:
chdir: "{{ ros_base_dir }}"
become: true
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
colcon build \
--symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release \
-DPython3_EXECUTABLE=$(which python3.6) -DCMAKE_CUDA_STANDARD=14 \
-DPython3_EXECUTABLE="$(which python3.6)" -DCMAKE_CUDA_STANDARD=14 \
--packages-up-to edge_auto_jetson_launch

0 comments on commit b1c8150

Please sign in to comment.