Skip to content

Commit

Permalink
Release Version 6.0.0
Browse files Browse the repository at this point in the history
Version 6.0.0 refactors the StateType enum in state representation to be more descriptive and widely useful as well as 
the dynamical systems factory for easier creation of these classes. This major change breaks implementations using
StateType enums explicitly (e.g. for parameters) and dynamical systems from the prior version.

See the updated documentation for usage guidelines for the DynamicalSystemsFactory.

This release also includes a few new features, fixes and improvements as well as updated documentation in 
all parts of the control libraries.
  • Loading branch information
domire8 authored Jun 9, 2022
2 parents fd606a6 + 7aaafe9 commit de553a9
Show file tree
Hide file tree
Showing 154 changed files with 3,020 additions and 3,088 deletions.
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG

Release Versions:
- [6.0.0](#600)
- [5.2.0](#520)
- [5.1.0](#510)
- [5.0.0](#500)
Expand All @@ -11,6 +12,65 @@ Release Versions:
- [2.0.0](#200)
- [1.0.0](#100)

## 6.0.0

Version 6.0.0 refactors the StateType enum in state representation to be more descriptive and widely useful as well as
the dynamical systems factory for easier creation of these classes. This major change breaks implementations using
StateType enums explicitly (e.g. for parameters) and dynamical systems from the prior version.

See the updated documentation for usage guidelines for the DynamicalSystemsFactory.

This release also includes a few new features, fixes and improvements as well as updated documentation in
all parts of the control libraries.

### Breaking changes

This release contains the following breaking changes:
- Refactor `StateType` enum and `ParameterType` enum (#277, #278, #280, #284)
- Relocate the `DYNAMICAL_SYSTEM_TYPE` enum to the general `dynamical_systems` namespace (#288)

**state_representation**

To make the `StateType` enum more descriptive and useful, individual spatial state types have been added
and the `ParameterType` moved to a separate enum. This change helps with the translation of parameters and
encoded states in downstream projects by allowing for greater introspection of data types from this enum.

Any implementations that use `StateType` from a prior version to create parameters or compare state types should be
updated.

**dynamical_systems**

The previous `DYNAMICAL_SYSTEM` enum has been removed from the dynamical system factory class and put directly in the
general `dynamical_systems` namespace and renamed to `DYNAMICAL_SYSTEM_TYPE` to shorten the creation and to have the
same structure as the controllers factory.

Any implementations that use the previous enum have to be updated. See the documentation for more information.

### Features

**state_representation**
- Add CartesianState attribute setters from std vector and coefficients (#291)

**python**
- Use pyquaternion in bindings (#283)

**protocol**
- Add encode/decode options for shared pointer of State (#287)
- Add CMake config for clproto (#292)

### Fixes and improvements

**state_representation**
- Mark Parameter getters as const (#289)
- Throw exception upon parameter validation in controllers (#290)

**python**
- Fix if else conditions in setup.py to correctly install modules (#285)

**general**
- Update and extend demos with Python examples and migrate ROS demos away (#293)
- Update documentation (#294)

## 5.2.0

Version 5.2.0 contains a few fixes and a new feature for the Impedance controller.
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</td>
</tr>
<tr>
<td width="25%"><a href="https://github.com/epfl-lasa/control-libraries/tree/develop">Development</a></td>
<td width="25%"><a href="https://github.com/epfl-lasa/control-libraries/tree/develop">Develop</a></td>
<td width="75%"><img src="https://github.com/epfl-lasa/control-libraries/actions/workflows/build-test.yml/badge.svg?branch=develop"></td>
</tr>
</table>
Expand All @@ -21,18 +21,30 @@
A set of libraries to facilitate the creation of full control loop algorithms,
including trajectory planning, kinematics, dynamics and control.

Documentation is available at <a href="https://epfl-lasa.github.io/control-libraries/versions/main/">epfl-lasa.github.io/control-libraries</a>
Documentation is available at <a href="https://epfl-lasa.github.io/control-libraries/versions/">epfl-lasa.github.io/control-libraries</a>.

## Core libraries

For the implementation, installation and documentation of the core libraries, see the
<a href="https://github.com/epfl-lasa/control-libraries/tree/main/source">source</a> folder.
For the implementation, installation and documentation of the core libraries, see the [source](./source) folder.

## Protocol

There is a module that defines the protocol for sending and receiving messages containing control libraries
data across any network, based on the Google Protocol Buffer. For its implementation, installation and
documentation, see the [protocol](./protocol) folder.

## Python bindings

There exist Python bindings for core control library modules. See the <a href="https://github.com/epfl-lasa/control-libraries/tree/main/python">python</a>
folder for installation instructions and currently supported libraries.
There exist Python bindings for the control library modules and the protocol module. See the [python](./python)</a>
folder for installation instructions.

## Demos

For examples and demos in plain C++, ROS, and ROS2, refer to the <a href="https://github.com/epfl-lasa/control-libraries/tree/main/demos">demos</a> folder.
For examples and demos in C++ and Python, refer to the [demos](./demos) folder.
TODO link ros demos repo

## External resources

- C++ remote development in CLion [here](https://github.com/eeberhard/docker-clion-cpp-env)
- ROS and ROS2 demos using control libraries [here](https://github.com/domire8/control-libraries-ros-demos)
- ROS and ROS2 control libraries images [here](https://github.com/aica-technology/docker-images)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.0
6.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ set(DEMOS_SCRIPTS
)

set(FIXTURE_INSTALL_PATH /etc/fixtures/)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/fixtures/ DESTINATION ${FIXTURE_INSTALL_PATH})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fixtures/ DESTINATION ${FIXTURE_INSTALL_PATH})

foreach(SCRIPT ${DEMOS_SCRIPTS})
add_executable(${SCRIPT} scripts/${SCRIPT}.cpp)
add_executable(${SCRIPT} cpp_scripts/${SCRIPT}.cpp)
target_link_libraries(${SCRIPT} ${control_libraries_LIBRARIES})
target_compile_definitions(${SCRIPT} PRIVATE SCRIPT_FIXTURES="${FIXTURE_INSTALL_PATH}")
install(TARGETS ${SCRIPT}
RUNTIME DESTINATION bin
)
endforeach()
16 changes: 16 additions & 0 deletions demos/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies

WORKDIR /tmp
ARG CONTROL_LIBRARIES_BRANCH=develop
RUN git clone -b ${CONTROL_LIBRARIES_BRANCH} --depth 1 https://github.com/epfl-lasa/control-libraries.git
RUN cd control-libraries/source && ./install.sh --auto
RUN cd control-libraries/protocol && ./install.sh --auto
RUN pip3 install control-libraries/python

RUN rm -rf /tmp/*

USER developer
WORKDIR ${HOME}/control_loop_examples
COPY ./ ./

RUN mkdir build && cd build && cmake .. && sudo make -j all && sudo make install
94 changes: 94 additions & 0 deletions demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# `control_loop_examples` demonstration scripts

## Table of contents:
* [Running a demo script](#running-demonstration-scripts)
* [Task Space control loop example](#task_space_control_loop)
* [Robot kinematics control loop example](#robot_kinematics_control_loop)

## Running demonstration scripts
This package contains a set of demonstration scripts in both C++ and Python that showcase the functionalities introduced
in the different libraries of `control-libraries`.
The easiest way to run them is to use the `run-demo.sh` file.
Without arguments, this script creates a container and opens in interactive mode, allowing you to browse the different
demo scripts and run the one of your choice:

```console
./run-demo-script.sh
# Run a python script
developer@xxxxxxxxx:~/control_loop_examples$ python3 python_scripts/<script>.py
# Run a cpp script from the build folder
developer@xxxxxxxxx:~/control_loop_examples$ ./build/<script>
```

The available scripts are:

### `task_space_control_loop`
- **Showcased libraries:** `state_representation`, `dynamical_systems`

This simple demonstration shows how to create a control loop with a `PointAttractor` dynamical system in task space
(`CartesianState`). It moves a pose towards a random attractor in a `100Hz` control loop.
The script outputs the current pose and distance to the attractor at each timestep, and the final pose on reaching it:

```console
...
frame CartesianPose expressed in world frame
position: (0.596701, 0.822976, -0.604581)
orientation: (0.246491, -0.314866, -0.896822, 0.189239) <=> theta: 2.64348, axis: (-0.32489, -0.925375, 0.195264)
distance to attractor: 0.001004
-----------
frame CartesianPose expressed in world frame
position: (0.596702, 0.822979, -0.604584)
orientation: (0.246488, -0.314866, -0.896823, 0.189239) <=> theta: 2.64348, axis: (-0.324891, -0.925375, 0.195264)
distance to attractor: 0.000994
-----------
##### TARGET #####
frame CartesianPose expressed in world frame
position: (0.59688, 0.823295, -0.604897)
orientation: (0.246242, -0.314924, -0.896867, 0.189256) <=> theta: 2.64399, axis: (-0.324929, -0.92536, 0.195269)
##### CURRENT POSE #####
frame CartesianPose expressed in world frame
position: (0.596702, 0.822979, -0.604584)
orientation: (0.246488, -0.314866, -0.896823, 0.189239) <=> theta: 2.64348, axis: (-0.324891, -0.925375, 0.195264)
```

### `robot_kinematics_control_loop`
- **Showcased libraries:** `state_representation`, `dynamical_systems`, `robot_model`

This demonstration reuses the previous dynamical system control loop but adds the robot component.
The desired command, i.e. desired twist of the robot end-effector (eef) is sent to a dummy robot.
At each timestep, the new joint state and eef state of the robot is computed using the robot kinematics from the robot
model corresponding to the provided URDF.
The robot is assumed to perfectly follow the computed desired state matching the eef desired twist.
Similarly to the previous demonstration, the script outputs the current joint positions, eef pose and distance to the
attractor at each timestep, and the final joint positions and pose on reaching it:

```
franka JointPositions
names: [panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6, panda_joint7, ]
positions: [-1.39453, 0.34338, 1.78372, -1.21918, -0.365912, 1.1687, -2.88819, ]
panda_link8 CartesianPose expressed in panda_link0 frame
position: (0.500692, 4.30377e-05, 0.750494)
orientation: (-9.36521e-05, 8.70069e-05, 1, -0.000152405) <=> theta: 3.14141, axis: (-8.70069e-05, -1, 0.000152405)
distance to attractor: 0.001249
-----------
franka JointPositions
names: [panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6, panda_joint7, ]
positions: [-1.39627, 0.352394, 1.79511, -1.2227, -0.374677, 1.16757, -2.88157, ]
panda_link8 CartesianPose expressed in panda_link0 frame
position: (0.500192, 1.07333e-05, 0.750183)
orientation: (-1.9014e-05, 4.77102e-05, 1, -7.96025e-05) <=> theta: 3.14155, axis: (-4.77102e-05, -1, 7.96025e-05)
distance to attractor: 0.000455
-----------
##### TARGET #####
panda_link8 CartesianPose expressed in panda_link0 frame
position: (0.5, 0, 0.75)
orientation: (6.12323e-17, 0, 1, 0) <=> theta: 3.14159, axis: (0, 1, 0)
##### CURRENT STATES #####
franka JointPositions
names: [panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6, panda_joint7, ]
positions: [-1.39215, 0.362964, 1.80315, -1.22376, -0.385704, 1.16489, -2.87388, ]
panda_link8 CartesianPose expressed in panda_link0 frame
position: (0.500192, 1.07333e-05, 0.750183)
orientation: (-1.9014e-05, 4.77102e-05, 1, -7.96025e-05) <=> theta: 3.14155, axis: (-4.77102e-05, -1, 7.96025e-05)
```
12 changes: 0 additions & 12 deletions demos/control_loop_examples/Dockerfile

This file was deleted.

107 changes: 0 additions & 107 deletions demos/control_loop_examples/README.md

This file was deleted.

Loading

0 comments on commit de553a9

Please sign in to comment.