Skip to content

Commit

Permalink
Remove json-like formatting of YAML | Autoformat all YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotochleb committed Sep 23, 2024
1 parent 6994ac6 commit bb4f94b
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 252 deletions.
105 changes: 53 additions & 52 deletions .github/workflows/happypose_ros_build_and_test.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: "Humble: Build and Test"
---
name: 'Humble: Build and Test'

on:
on :
push:
branches:
- "main"
- main
pull_request:
branches:
- "*"
- '*'

jobs:
test_happypose_ros:
Expand All @@ -16,61 +17,61 @@ jobs:
HAPPYPOSE_DATA_DIR: /tmp/local_data

steps:
- name: Install EGL mesa - required for Panda3D renderer
run: |
sudo apt-get update
sudo apt-get install -qqy libegl1-mesa libegl1-mesa-dev
- name: Install EGL mesa - required for Panda3D renderer
run: |
sudo apt-get update
sudo apt-get install -qqy libegl1-mesa libegl1-mesa-dev
- name: Install Python C headers and remove Blinker version conflicting with HappyPose
run: |
sudo apt-get update
sudo apt-get install -qqy python3-dev
sudo apt purge -qqy python3-blinker
- name: Install Python C headers and remove Blinker version conflicting with HappyPose
run: |
sudo apt-get update
sudo apt-get install -qqy python3-dev
sudo apt purge -qqy python3-blinker
- name: Caching of the HappyPose installation and data
uses: actions/cache@v4
with:
path: /tmp/local_data
key: data
- name: Caching of the HappyPose installation and data
uses: actions/cache@v4
with:
path: /tmp/local_data
key: data

- name: Update pip
run: pip install -U pip
- name: Update pip
run: pip install -U pip

- name: Download HappyPose source
working-directory: /tmp
run: |
git clone --branch dev --recurse-submodules https://github.com/agimus-project/happypose.git
- name: Download HappyPose source
working-directory: /tmp
run: |
git clone --branch dev --recurse-submodules https://github.com/agimus-project/happypose.git
- name: Build and install HappyPose
working-directory: /tmp/happypose
run: pip install ".[cpu,pypi,evaluation,multiview]" --extra-index-url https://download.pytorch.org/whl/cpu
- name: Build and install HappyPose
working-directory: /tmp/happypose
run: pip install ".[cpu,pypi,evaluation,multiview]" --extra-index-url https://download.pytorch.org/whl/cpu

- name: Download pre-trained models required for tests
run: |
mkdir -p /tmp/local_data
python -m happypose.toolbox.utils.download \
--bop_dataset ycbv \
--cosypose_models \
detector-bop-ycbv-pbr--970850 \
coarse-bop-ycbv-pbr--724183 \
refiner-bop-ycbv-pbr--604090
- name: Download pre-trained models required for tests
run: |
mkdir -p /tmp/local_data
python -m happypose.toolbox.utils.download \
--bop_dataset ycbv \
--cosypose_models \
detector-bop-ycbv-pbr--970850 \
coarse-bop-ycbv-pbr--724183 \
refiner-bop-ycbv-pbr--604090
- name: Unzip HappyPose YCBV models
working-directory: /tmp/local_data/bop_datasets/ycbv
run: |
unzip -n -qq ycbv_base.zip
unzip -n -qq ycbv_models.zip
- name: Unzip HappyPose YCBV models
working-directory: /tmp/local_data/bop_datasets/ycbv
run: |
unzip -n -qq ycbv_base.zip
unzip -n -qq ycbv_models.zip
- name: Remove incompatible PyTest version
run: pip uninstall -y pytest
- name: Remove incompatible PyTest version
run: pip uninstall -y pytest

- name: Install ROS 2 Humble
uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble
- name: Install ROS 2 Humble
uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble

- name: Build and test happypose_ros
uses: ros-tooling/[email protected]
with:
package-name: happypose_ros
target-ros2-distro: humble
- name: Build and test happypose_ros
uses: ros-tooling/[email protected]
with:
package-name: happypose_ros
target-ros2-distro: humble
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
Expand Down Expand Up @@ -29,5 +30,10 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
args: ['--write-changes']
args: [--write-changes]
exclude: resources/happypose_ros_diagram.drawio.svg
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '2', --offset, '0', --colons, --width, '86']
15 changes: 8 additions & 7 deletions happypose_examples/config/camera_info.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
image_width: 640
image_height: 480
camera_name: webcam
camera_matrix:
---
image_width : 640
image_height : 480
camera_name : webcam
camera_matrix :
rows: 3
cols: 3
data: [1066.778, 0.0, 312.9869, 0.0, 1067.487, 241.3109, 0.0, 0.0, 1.0]
distortion_model: plumb_bob
distortion_model : plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [0.0, 0.0, 0.0, 0.0, 0.0]
rectification_matrix:
rectification_matrix :
rows: 3
cols: 3
data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
projection_matrix:
projection_matrix :
rows: 3
cols: 4
data: [1.0, 0.0, 320.0, 0.0, 0.0, 1.0, 240.0, 0.0, 0.0, 0.0, 1.0, 0.0]
3 changes: 2 additions & 1 deletion happypose_examples/config/cosypose_params.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
/**:
ros__parameters:
# Device to which the models will be loaded. Supported options are 'cpu' and 'cuda:x' where 'x' is the GPU number.
Expand Down Expand Up @@ -38,7 +39,7 @@

# List of camera names to subscribe to. Those names are internal to happypose_ros node
# and can be chosen arbitrarily as long as they are valid YAML keys to be used later
camera_names: ["cam_1"]
camera_names: [cam_1]
cameras:
# Timeout, after which a frame from a camera is considered too old. Value '0.0' disables timeout
timeout: 0.0
Expand Down
3 changes: 2 additions & 1 deletion happypose_examples/config/cosypose_params_multiview.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
/**:
ros__parameters:
# Device to which the models will be loaded. Supported options are 'cpu' and 'cuda:x' where 'x' is the GPU number.
Expand Down Expand Up @@ -52,7 +53,7 @@

# List of camera names to subscribe to. Those names are internal to happypose_ros node
# and can be chosen arbitrarily as long as they are valid YAML keys to be used later
camera_names: ["cam_1", "cam_2", "cam_3"]
camera_names: [cam_1, cam_2, cam_3]
cameras:
# Timeout, after which a frame from a camera is considered too old. Value '0.0' disables timeout
timeout: 0.0
Expand Down
2 changes: 1 addition & 1 deletion happypose_msgs/examples/meshcat_viz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"\n",
"python_version = f\"python{sys.version_info.major}.{sys.version_info.minor}\"\n",
"dist_package_path = Path(\"local\") / \"lib\" / python_version / \"dist-packages\"\n",
"ros_path = Path(\"/opt\") / \"ros\" / os.environ['ROS_DISTRO'] / dist_package_path\n",
"ros_path = Path(\"/opt\") / \"ros\" / os.environ[\"ROS_DISTRO\"] / dist_package_path\n",
"colson_ws_path = my_colcon_ws_path / \"install\" / \"happypose_msgs\" / dist_package_path\n",
"sys.path.append(ros_path.as_posix())\n",
"sys.path.append(colson_ws_path.as_posix())"
Expand Down
Loading

0 comments on commit bb4f94b

Please sign in to comment.