Skip to content

Commit

Permalink
Merge 598273e into bc82191
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed May 1, 2024
2 parents bc82191 + 598273e commit c842a83
Show file tree
Hide file tree
Showing 108 changed files with 438 additions and 334 deletions.
13 changes: 0 additions & 13 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ test --test_tag_filters=-lint
test:lint --build_tests_only
test:lint --test_tag_filters=lint

## Target platform: 32-bit Raspberry Pi OS

build:pi32 --compilation_mode=opt
build:pi32 --compiler=clang
build:pi32 --cpu=armeabihf
build:pi32 --crosstool_top=@rpi_bazel//tools/cc_toolchain:toolchain

test:pi32 --compilation_mode=opt
test:pi32 --compiler=clang
test:pi32 --cpu=armeabihf
test:pi32 --crosstool_top=@rpi_bazel//tools/cc_toolchain:toolchain
test:pi32 --test_output=errors

# Target platform: 64-bit Raspberry Pi OS

build:pi64 --compilation_mode=opt
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/bazel.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: CI

on:
push:
Expand All @@ -7,37 +7,48 @@ on:
branches: [ main ]

jobs:
build:
build_host:
name: "Build for ${{ matrix.os }} host platform"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: "Checkout sources"
uses: actions/checkout@v4
with:
submodules: recursive

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
- name: "Build the library with default configuration"
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.BAZELISK_GITHUB_TOKEN }}
run: |
tools/bazelisk build --compilation_mode=fastbuild //...
build_pi3hat:
name: "Build for the pi3hat target platform"
runs-on: ubuntu-latest

steps:
- name: "Checkout sources"
uses: actions/checkout@v4
with:
python-version: "${{ matrix.python-version }}"
submodules: recursive

- name: "Install PyPI dependencies"
- name: "Install build dependencies"
run: |
python -m pip install --upgrade pip
pip install msgpack
sudo apt-get update && sudo apt-get install -y libtinfo5
- name: "Build the library"
- name: "Build targets for the pi64 configuration"
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.BAZELISK_GITHUB_TOKEN }}
run: |
tools/bazelisk build --compilation_mode=fastbuild //...
tools/bazelisk build //vulp/actuation/tests:pi3hat_interface_test --config pi64
coverage:
name: "Coverage"
runs-on: ubuntu-latest
steps:
- name: "Checkout sources"
Expand Down Expand Up @@ -66,6 +77,7 @@ jobs:
path-to-lcov: ${{ github.workspace }}/bazel-out/_coverage/_coverage_report.dat

lint:
name: "Lint code"
runs-on: ubuntu-latest
steps:
- name: "Checkout sources"
Expand All @@ -84,6 +96,7 @@ jobs:
tools/bazelisk test --compilation_mode=fastbuild --config lint //...
test:
name: "Test for ${{ matrix.os }} with python-${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -116,6 +129,6 @@ jobs:
ci_success:
name: "CI success"
runs-on: ubuntu-latest
needs: [build, coverage, lint, test]
needs: [build_host, build_pi3hat, coverage, lint, test]
steps:
- run: echo "CI workflow completed successfully"
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docs
name: Documentation

on:
push:
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Build test for the pi3hat interface
- BulletInterface: internal ``get_link_index`` memoization
- BulletInterface: introduce "monitor" configuration dictionary
- BulletInterface: report contacts to bodies specified in configuration
- CICD: Add a workflow for the pi3hat build test
- Introduce ``observe`` method in actuation interfaces

### Changed

- CICD: Rename bazel.yml to ci.yml for consistency with other repos
- Pi3HatInterface: make ``get_angular_velocity`` private
- Pi3HatInterface: make ``get_attitude`` private
- Pi3HatInterface: make ``get_linear_acceleration`` private
- Pi3HatInterface: make ``imu_data`` private

### Fixed

- CICD: Clean up redundant Python build jobs

### Removed

- Clean up unused ``MockInterface::get_angular_velocity``
- Clean up unused ``MockInterface::get_attitude``
- Clean up unused ``MockInterface::get_linear_acceleration``
- Remove ``imu_data`` getter from actuation interfaces
- Remove ``observe_imu`` function from observations

## [2.2.2] - 2024-03-28

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There are many ways you can contribute to the project. Here are some ideas:

- Build a new robot using mjbots actuators and report any friction you encounter using it with Vulp
- Build a new robot using mjbots actuators and report your experience using Vulp on it
- Pick one of the [open issues](https://github.com/upkie/vulp/issues?q=is%3Aissue+is%3Aopen)
- Suggest improvements to the [documentation](https://upkie.github.io/vulp/)

Expand Down
3 changes: 2 additions & 1 deletion CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL

# Don't search for other CPPLINT.cfg files in parent directories.
set noparent
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vulp – Robot/simulation switch

[![CI](https://github.com/upkie/vulp/actions/workflows/bazel.yml/badge.svg)](https://github.com/upkie/vulp/actions/workflows/bazel.yml)
[![CI](https://github.com/upkie/vulp/actions/workflows/ci.yml/badge.svg)](https://github.com/upkie/vulp/actions/workflows/ci.yml)
[![Documentation](https://github.com/upkie/vulp/actions/workflows/docs.yml/badge.svg)](https://upkie.github.io/vulp/)
[![Coverage](https://coveralls.io/repos/github/upkie/vulp/badge.svg?branch=main)](https://coveralls.io/github/upkie/vulp?branch=main)
![C++ version](https://img.shields.io/badge/C++-17-blue.svg?style=flat)
Expand Down
3 changes: 2 additions & 1 deletion tools/lint/BUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- python -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL

package(default_visibility = ["//visibility:public"])

Expand Down
3 changes: 2 additions & 1 deletion tools/lint/clang_format_lint.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL

import os
import shutil
Expand Down
6 changes: 3 additions & 3 deletions tools/lint/cpplint.bzl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- python -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL

load("@rules_python//python:defs.bzl", "py_test")

Expand Down Expand Up @@ -39,8 +40,7 @@ def _extract_labels(srcs):
return list(srcs)

# The select() syntax returns an object we (apparently) can't inspect.
# TODO(jwnimmer-tri) Figure out how to cpplint these files. For now,
# folks will have to pass extra_srcs when calling cpplint() macro.
# Folks will have to pass extra_srcs when calling cpplint() macro.
return []

def _is_source_label(label):
Expand Down
3 changes: 2 additions & 1 deletion tools/lint/lint.bzl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- python -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL

load("//tools/lint:cpplint.bzl", "cpplint")
load("//tools/lint:python_lint.bzl", "python_lint")
Expand Down
5 changes: 3 additions & 2 deletions tools/lint/python_lint.bzl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- python -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2012-2016 Robot Locomotion Group @ CSAIL

load("@rules_python//python:defs.bzl", "py_test")

Expand Down Expand Up @@ -76,7 +77,7 @@ def python_lint(
]
else:
# The select() syntax returns an object we (apparently) can't
# inspect. TODO(jwnimmer-tri) Figure out how to lint these files.
# inspect.
files = []

# Add a lint test if necessary.
Expand Down
2 changes: 1 addition & 1 deletion tools/shm/clean.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2022 Stéphane Caron
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Stéphane Caron

#include <fcntl.h>
#include <spdlog/spdlog.h>
Expand Down
4 changes: 0 additions & 4 deletions tools/workspace/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
#
# This file makes our directory a Bazel package, allowing for neighboring *.bzl
# files to be loaded.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
4 changes: 0 additions & 4 deletions tools/workspace/bullet/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
#
# This file makes our directory a Bazel package, allowing for neighboring *.bzl
# files to be loaded.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
3 changes: 2 additions & 1 deletion tools/workspace/github_archive.bzl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- python -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Stéphane Caron
#
# This file incorporates work covered by the following copyright and
# permission notice:
#
# Copyright 2018 Josh Pieper, jjp@pobox.com.
# SPDX-License-Identifier: Apache-2.0
# Copyright 2018 Josh Pieper, jjp@pobox.com.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand Down
4 changes: 0 additions & 4 deletions tools/workspace/mpacklog/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
#
# This file makes our directory a Bazel package, allowing for neighboring *.bzl
# files to be loaded.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
4 changes: 0 additions & 4 deletions tools/workspace/palimpsest/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
#
# This file makes our directory a Bazel package, allowing for neighboring *.bzl
# files to be loaded.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
10 changes: 5 additions & 5 deletions tools/workspace/palimpsest/repository.bzl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- python -*-

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

def palimpsest_repository():
"""
Clone repository from GitHub and make its targets available for binding.
"""
http_archive(
git_repository(
name = "palimpsest",
sha256 = "244ffe888888bc12d6d5270020993a79e56ddb38f2beafa7647f17cf0192d4c9",
strip_prefix = "palimpsest-2.0.0",
url = "https://github.com/upkie/palimpsest/archive/refs/tags/v2.0.0.tar.gz",
remote = "https://github.com/upkie/palimpsest",
commit = "f52bcfeeda2da839107d6121e0c8ef1a0c42522e",
shallow_since = "1655469414 -0400"
)
4 changes: 0 additions & 4 deletions tools/workspace/pi3hat/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
#
# This file makes our directory a Bazel package, allowing for neighboring *.bzl
# files to be loaded.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
2 changes: 0 additions & 2 deletions tools/workspace/pi3hat/repository.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- python -*-
#
# Copyright 2022 Stéphane Caron

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

Expand Down
4 changes: 0 additions & 4 deletions tools/workspace/pycodestyle/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
#
# This file makes our directory a Bazel package, allowing for neighboring *.bzl
# files to be loaded.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
4 changes: 2 additions & 2 deletions tools/workspace/upkie_description/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ def upkie_description_repository():
git_repository(
name = "upkie_description",
remote = "https://github.com/upkie/upkie_description",
commit = "cbba6ddad34f640a09e436d76147494aee687a5e",
shallow_since = "1652897584 +0200"
commit = "b04b4dcb53eeb1af3ccabbfdcff00c5c88d548ac",
shallow_since = "1708617524 +0100"
)
1 change: 1 addition & 0 deletions vulp/actuation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ cc_library(
cc_library(
name = "bullet_interface",
hdrs = [
"BulletContactData.h",
"BulletImuData.h",
"BulletInterface.h",
"BulletJointProperties.h",
Expand Down
Loading

0 comments on commit c842a83

Please sign in to comment.