Skip to content

Commit

Permalink
release: version 7.4.0
Browse files Browse the repository at this point in the history
Version 7.4.0 brings Analog and Digital IO State types as a new feature to the `state_representation` module.
  • Loading branch information
domire8 authored Apr 17, 2024
2 parents 8b3ae5b + d9c1a4b commit eddd9b7
Show file tree
Hide file tree
Showing 40 changed files with 1,784 additions and 42 deletions.
13 changes: 4 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
{
"name": "control libraries",
"remoteUser": "ros2",
"remoteUser": "developer",
"build": {
"dockerfile": "../Dockerfile.ci",
"dockerfile": "../Dockerfile",
"context": "..",
"target": "development",
"args": {
"ROS2_VERSION": "humble",
"PINOCCHIO_TESTS": "OFF"
}
"target": "development"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind,consistency=cached",
"workspaceFolder": "/src",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"eamodio.gitlens"
"ms-vscode.cpptools-extension-pack"
]
}
}
Expand Down
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
source/*build*
./build*
./docs/
./.*
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
image_name: aica-technology/control-libraries
image_tags: ${{ steps.merge-tags.outputs.list }}
dockerfile_path: Dockerfile.ci
dockerfile_path: Dockerfile
token: ${{ secrets.GITHUB_TOKEN }}

multi-arch:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cmake.sourceDirectory": "/src/source",
"cmake.configureArgs": [ "-DBUILD_TESTING=ON" ],
"C_Cpp.clang_format_style": "file:/home/ros2/.clang-format"
"C_Cpp.clang_format_style": "file:/guidelines/.clang-format"
}
33 changes: 27 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CHANGELOG

Release Versions:
Release Versions

- [7.4.0](#740)
- [7.3.0](#730)
- [7.2.0](#720)
- [7.1.1](#711)
Expand All @@ -10,6 +12,23 @@ Release Versions:
- [6.3.0](#630)
- [6.2.0](#620)

## 7.4.0

Version 7.4.0 brings Analog and Digital IO State types as a new feature to the `state_representation` module.

### Features

`AnalogIOState` and `DigitalIOState` classes have been added as new state types in `state_representation`.

### Full changelog

- feat: add IO states to state representation (py) (#173)
- feat: add IO states to state representation (proto) (#172)
- feat: add IO states to state representation (cpp) (#158)
- build: update dockerfiles (#153)
- build: copy python packages into /usr instead of ~ros2 to avoid permission issues (#155)
- feat: Add ParameterType conversion functions to go from enum to type label and the inverse (#154)

## 7.3.0

Version 7.3.0 contains new improvements and a fix to the control libraries.
Expand Down Expand Up @@ -64,7 +83,7 @@ minor improvements and fixes to state_representation.

- Update push hooks in build-release.yaml (#127)
- feat(ci): add prebuilt control-libraries image akin to network-interfaces (#125)
- Add overloaded `make_shared_parameter` with no parameter (#123)
- Add overloaded `make_shared_parameter` with no parameter (#123)
- Catch out of range exception in `ParameterMap::assert_parameter_valid` (#122)
- Construct zero matrices in compliant twist controller (#120)

Expand All @@ -78,6 +97,7 @@ and safe to use.
**state_representation**

The `State` class has been reworked, with the following breaking changes to the API:

- `State::initialize` has been reworked as `State::reset`.
- `State::is_compatible` has been removed in favor of the new `State::is_incompatible`.
- `State::set_empty` and `State::set_filled` have been removed from the public API.
Expand All @@ -104,7 +124,7 @@ All header files now use the `.hpp` extension.

**state_representation**

The timestamp of a `State` object is now consistently reset by every non-const method, so that it always indicates the
The timestamp of a `State` object is now consistently reset by every non-const method, so that it always indicates the
time of last modification. The method `State::get_age()` can be used to get the time since last modification in seconds.

The emptiness of a state is handled more consistently, and accessing data on an empty state will now throw an exception.
Expand All @@ -123,6 +143,7 @@ of a feedback state is passed through to the command as a feed-forward force or
**Python**

The Python bindings now include the exceptions for each module. For example:

- `from state_representation.exceptions import EmptyStateError`

The bindings have also been updated to include the breaking changes in `state_representation`.
Expand Down Expand Up @@ -156,7 +177,7 @@ A contributor license agreement and signature workflow have been added to protec
- Update python bindings after Jacobian refactor (#105)
- Set reference frame of Jacobian with string instead of pose (#103)
- Refactor Jacobian methods and operators (#101)
- Remove rows_ and cols_ and improve constructors (#100)
- Remove rows* and cols* and improve constructors (#100)
- Revise clproto to remove StateType and timestamp from State message (#104)
- Raise exception in getters if state is empty (#97)
- Bind error objects of all library modules with Pybind (#98)
Expand Down Expand Up @@ -184,7 +205,7 @@ A contributor license agreement and signature workflow have been added to protec
- Bind operators of Cartesian states (#60)
- Fix quaternion differentiation (#58)
- Refactor operators in CartesianState for addition (#23), subtraction (#33, #40), transformation (#28, #45),
division (#41) and multiplication (#43)
division (#41) and multiplication (#43)
- Add a Contributor License Agreement (#61)
- Uniformly sample orientation with UnitRandom (#56)
- Refactor get/set variable helpers in Cartesian and joint state (#39, #57)
Expand Down Expand Up @@ -235,4 +256,4 @@ and granted to AICA under a non-exclusive license agreement. All subsequent cont
AICA employees and are the property of AICA SA. For a full history of changes prior to version 6.2, refer to
the original project here:

- https://github.com/epfl-lasa/control-libraries/tree/v6.2.0
- https://github.com/epfl-lasa/control-libraries/tree/v6.2.0
75 changes: 60 additions & 15 deletions Dockerfile.ci → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
ARG ROS2_VERSION=humble
FROM ghcr.io/aica-technology/ros2-ws:${ROS2_VERSION} as base
USER ${USER}
ARG BASE_TAG=22.04
FROM ubuntu:${BASE_TAG} as base
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
cmake \
g++ \
git \
libgtest-dev \
libeigen3-dev \
python3-pip \
ssh \
sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN echo "Set disable_coredump false" >> /etc/sudo.conf

# create the credentials to be able to pull private repos using ssh
RUN mkdir /root/.ssh/ && ssh-keyscan github.com | tee -a /root/.ssh/known_hosts

FROM base as apt-dependencies
COPY apt-packages.tx[t] /
Expand All @@ -13,7 +30,7 @@ fi

mkdir -p /tmp/apt

sudo apt-get update
apt-get update
# We then do a dry-run and parse the output of apt to gather the list of packages to be installed
# Example output:
# ```
Expand Down Expand Up @@ -44,7 +61,7 @@ xargs -a /apt-packages.txt apt-get install --dry-run \
| grep -e '^Inst ' \
| sed -E 's/^Inst (\S+) .*$/\1/' > /tmp/new-packages.txt
# Then we install apt packages like normal
xargs -a /apt-packages.txt sudo apt-get install -y
xargs -a /apt-packages.txt apt-get install -y
# Finally we use dpkg to get all files installed by those packages and copy them to a new root
# - get list of files installed by all the packages
# - remove empty lines
Expand All @@ -64,7 +81,7 @@ COPY --from=apt-dependencies /tmp/apt /
ARG TARGETPLATFORM
ARG CACHEID
ARG PINOCCHIO_TAG=v2.6.9
ARG PINOCCHIO_TESTS=ON
ARG PINOCCHIO_TESTS=OFF
# FIXME: it would be nicer to have it all in the root CMakelists.txt but:
# * `pinocchio` doesn't provide an include directory we can easily plug into `target_include_directories` and thus needs to be installed first
# * `pinocchio` uses hacks relying on undocumented CMake quirks which break if you use `FetchContent`
Expand Down Expand Up @@ -101,9 +118,39 @@ FROM base as code
WORKDIR /src
COPY --from=apt-dependencies /tmp/apt /
COPY --from=dependencies /tmp/deps /usr
COPY --chown=${USER}:${USER} . /src
COPY . /src

FROM code as development
# create and configure a new user
ARG UID=1000
ARG GID=1000
ENV USER developer
ENV HOME /home/${USER}

RUN addgroup --gid ${GID} ${USER}
RUN adduser --gecos "Remote User" --uid ${UID} --gid ${GID} ${USER} && yes | passwd ${USER}
RUN usermod -a -G dialout ${USER}
RUN echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget
RUN chmod 0440 /etc/sudoers.d/99_aptget && chown root:root /etc/sudoers.d/99_aptget

# Configure sshd server settings
RUN ( \
echo 'LogLevel DEBUG2'; \
echo 'PubkeyAuthentication yes'; \
echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \
) > /etc/ssh/sshd_config_development \
&& mkdir /run/sshd

# Configure sshd entrypoint to authorise the new user for ssh access and
# optionally update UID and GID when invoking the container with the entrypoint script
COPY ./docker/sshd_entrypoint.sh /sshd_entrypoint.sh
RUN chmod 744 /sshd_entrypoint.sh

RUN chown -R ${USER}:${USER} /src
RUN mkdir /guidelines && cd /guidelines \
&& wget https://raw.githubusercontent.com/aica-technology/.github/v0.9.0/guidelines/.clang-format

USER ${USER}

FROM code as build
ARG TARGETPLATFORM
Expand Down Expand Up @@ -132,17 +179,16 @@ COPY --from=install /tmp/cl /usr
COPY --chown=${USER}:${USER} ./python /python
RUN --mount=type=cache,target=${HOME}/.cache,id=pip-${TARGETPLATFORM}-${CACHEID},uid=1000 \
python3 -m pip install --prefix=/tmp/python /python
RUN mkdir -p /tmp/python-home/${USER}/.local/lib/python3.10/ \
&& mv /tmp/python/local/lib/python3.10/dist-packages/ /tmp/python-home/${USER}/.local/lib/python3.10/site-packages/
RUN mv /tmp/python/local /tmp/python-usr

FROM base as python-stubs
ARG TARGETPLATFORM
ARG CACHEID
COPY --from=apt-dependencies /tmp/apt /
COPY --from=dependencies /tmp/deps /usr
COPY --from=install /tmp/cl /usr
COPY --from=python /tmp/python-home /home
RUN sudo pip install pybind11-stubgen
COPY --from=python /tmp/python-usr /usr
RUN pip install pybind11-stubgen
RUN --mount=type=cache,target=${HOME}/.cache,id=pip-${TARGETPLATFORM}-${CACHEID},uid=1000 \
<<HEREDOC
for PKG in state_representation dynamical_systems robot_model controllers clproto; do
Expand Down Expand Up @@ -170,12 +216,11 @@ EoF
fi
done
HEREDOC
RUN mkdir -p /tmp/python-home/${USER}/.local/lib/python3.10/ \
&& mv /tmp/python/local/lib/python3.10/dist-packages/ /tmp/python-home/${USER}/.local/lib/python3.10/site-packages/
RUN mv /tmp/python/local /tmp/python-usr

FROM scratch as production
COPY --from=apt-dependencies /tmp/apt /
COPY --from=dependencies /tmp/deps /usr
COPY --from=install /tmp/cl /usr
COPY --from=python /tmp/python-home /home
COPY --from=python-stubs /tmp/python-home /home
COPY --from=python /tmp/python-usr /usr
COPY --from=python-stubs /tmp/python-usr /usr
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.0
7.4.0
2 changes: 1 addition & 1 deletion demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(control_libraries 7.3.0 CONFIG REQUIRED)
find_package(control_libraries 7.4.0 CONFIG REQUIRED)

set(DEMOS_SCRIPTS
task_space_control_loop
Expand Down
8 changes: 7 additions & 1 deletion docker/sshd_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ while [ "$#" -gt 0 ]; do
esac
done

# define the home directory of the specified user
HOME="/home/${USERNAME}"

# update the USER_ID and GROUP_ID of the specified user
if [ -n "${USER_ID}" ] && [ -n "${GROUP_ID}" ]; then
groupmod -g "${GROUP_ID}" "${USERNAME}"
Expand All @@ -38,12 +41,15 @@ fi

if [ -n "${PUBLIC_KEY}" ]; then
# authorise the specified user for ssh login
HOME="/home/${USERNAME}"
mkdir -p "${HOME}"/.ssh
echo "${PUBLIC_KEY}" >"${HOME}"/.ssh/authorized_keys
chmod -R 755 "${HOME}"/.ssh
chown -R "${USERNAME}:${USERNAME}" "${HOME}"/.ssh
fi

# save all environment variables to a file (except those listed below) and source it when the specified user logs in
env | egrep -v "^(HOME=|USER=|MAIL=|LC_ALL=|LS_COLORS=|LANG=|HOSTNAME=|PWD=|TERM=|SHLVL=|LANGUAGE=|_=)" >> /etc/environment
echo "source /etc/environment" | cat - "${HOME}/.bashrc" > tmp && mv tmp "${HOME}/.bashrc"

# start the ssh server
/usr/sbin/sshd -D -e -f /etc/ssh/sshd_config_development
2 changes: 1 addition & 1 deletion doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Control Libraries"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 7.3.0
PROJECT_NUMBER = 7.4.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion protocol/clproto_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(clproto VERSION 7.3.0)
project(clproto VERSION 7.4.0)

# Default to C99
if(NOT CMAKE_C_STANDARD)
Expand Down
4 changes: 3 additions & 1 deletion protocol/clproto_cpp/include/clproto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ enum MessageType {
JOINT_TORQUES_MESSAGE = 13,
SHAPE_MESSAGE = 14,
ELLIPSOID_MESSAGE = 15,
PARAMETER_MESSAGE = 16
PARAMETER_MESSAGE = 16,
DIGITAL_IO_STATE_MESSAGE = 17,
ANALOG_IO_STATE_MESSAGE = 18
};

/**
Expand Down
4 changes: 4 additions & 0 deletions protocol/clproto_cpp/include/clproto/encoders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <google/protobuf/repeated_field.h>

#include <state_representation/State.hpp>
#include <state_representation/AnalogIOState.hpp>
#include <state_representation/DigitalIOState.hpp>
#include <state_representation/space/SpatialState.hpp>
#include <state_representation/space/cartesian/CartesianState.hpp>
#include <state_representation/space/Jacobian.hpp>
Expand Down Expand Up @@ -62,6 +64,8 @@ state_representation::proto::Quaterniond encoder(const Eigen::Quaterniond& quate
state_representation::proto::CartesianState encoder(const state_representation::CartesianState& cartesian_state);
state_representation::proto::Jacobian encoder(const state_representation::Jacobian& jacobian);
state_representation::proto::JointState encoder(const state_representation::JointState& joint_state);
state_representation::proto::AnalogIOState encoder(const state_representation::AnalogIOState& analog_io_state);
state_representation::proto::DigitalIOState encoder(const state_representation::DigitalIOState& digital_io_state);

/*
* Definitions for templated RepeatedField methods
Expand Down
Loading

0 comments on commit eddd9b7

Please sign in to comment.