Skip to main content

A Python implementation of an example of 'Adaptive Constrained Kinematic Control using Partial or Complete Task-Space Measurements'

Project description

Adaptive Constrained Kinematic Control using Partial or Complete Task-Space Measurements

Python Users

venv

    python3 -m venv venv
    source venv/bin/activate
    python3 -m pip install dqrobotics --pre
    python3 -m pip install marinholab-papers-tro2022-adaptivecontrol

When you cannot use a venv (e.g. ROS2)

    python3 -m pip install dqrobotics --pre --break-system-packages
    python3 -m pip install marinholab-papers-tro2022-adaptivecontrol --break-system-packages

Reference

Sample code and minimal example for our TRO2022 paper.

@Article{marinhoandadorno2022adaptive,
  author       = {Marinho, M. M. and Adorno, B. V.},
  title        = {Adaptive Constrained Kinematic Control using Partial or Complete Task-Space Measurements},
  journal      = {IEEE Transactions on Robotics (T-RO)},
  year         = {2022},
  month        = dec,
  doi          = {10.1109/TRO.2022.3181047},
  volume       = {38},
  number       = {6},
  pages        = {3498--3513}
}

Standalone Example

  • The red object represents the estimated robot, initially very wrong on purpose to evaluate the adaptation.
  • The estimation usually converges within a few seconds using measurements from a simulated sensor.
  • Simultaneously, the robot proceeds through the box, toward the target poses, without collisions.
  • You can change the pose of the xd0 and xd1 objects in the scene, as long as you do it before the simulation starts.

https://github.com/mmmarinho/tro2022_adaptivecontrol/assets/46012516/2abe0b0b-6e48-46e9-9a86-061ba013b355

Usage

Download & extract the standalone version (only do this once)

cd ~
sudo apt install curl jq -y
wget $(curl -sL https://api.github.com/repos/mmmarinho/tro2022_adaptivecontrol/releases/latest | jq -r '.assets[].browser_download_url')
tar -xvf tro2022_adaptivecontrol_example.tar.xz

Running

  1. Open the example scene, namely tro2022_adaptivecontrol_example/TRO2022_MarinhoAdorno_ReferenceScene.ttt on CoppeliaSim.
  2. Run
cd ~/tro2022_adaptivecontrol_example
./run_example.sh

Troubleshooting

If you have the error below when running the pre-compiled example, please use Ubuntu 22.04 or later.

./run_example.sh
bin/adaptive_control_example: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by bin/adaptive_control_example) bin/adaptive_control_example: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by bin/adaptive_control_example)
bin/adaptive_control_example: /lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.29' not found (required by bin/adaptive_control_example) bin/adaptive_control_example: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by lib/libdqrobotics.so)
bin/adaptive_control_example: /lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.29' not found (required by lib/libdqrobotics-interface-vrep.so) bin/adaptive_control_example: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by lib/libdqrobotics-interface-vrep.so)
bin/adaptive_control_example: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by lib/libdqrobotics-interface-vrep.so)

Known limitations of this example/TODO list/Extra info

  • The stopping criterion is elapsed time, so it might not converge for all initial parameters.
  • The initial convergence to measurements mentioned in the paper TODO for this example.
  • The estimated model is randomized so it might start in an implausible zone. Fixing this is TODO for this example.
  • Sample code for partial measurements is included, but they have not been tested in this example, only in the physical robot. The adaptation is supposed to move the parameters of the estimated_robot towards the ideal kinematic model defined by real_robot in the code. The robot model in CoppeliaSim is for visualization only.
  • A different solver was used in the paper's experiments, in this example we use an open-source solver, so the behavior might be somewhat different.
  • The final target position is, ON PURPOSE, chosen as somewhere the robot cannot reach. It serves to show that even in such case the robot does not collide with the environment.

Build from source

Just in case

sudo apt install g++ cmake git libeigen3-dev

macos

brew install cmake eigen cppzmq boost

Download the repo

cd ~
mkdir git
cd git
git clone https://github.com/mmmarinho/tro2022_adaptivecontrol.git --recursive

Build

With all dependencies correctly configured,

cd ~/git/tro2022_adaptivecontrol
chmod +x .build.sh
./.build.sh

Running

  1. Open the example scene, namely TRO2022_MarinhoAdorno_ReferenceScene.ttt on CoppeliaSim.
  2. Run
cd ~/git/tro2022_adaptivecontrol
chmod +x .run.sh
./.run.sh

Example console output of the results

Running on an 8 core Ubuntu VM.

Not considering the setup step prints

Reference timeout for xd0
  Average computational time = 0.00126314 seconds.
  Clock overruns =7 (Too many, i.e. hundreds, indicate that the sampling time is too low for this CPU).
  Final task pose error norm 2.37699e-15 (Dual quaternion norm).
  Final task translation error norm 0 (in meters).
  Final measurement error norm 9.3756e-16 (Dual quaternion norm).
  Final measurement translation error norm 0 (in meters).
Reference timeout for xd1
  Average computational time = 0.000902905 seconds.
  Clock overruns =7 (Too many, i.e. hundreds, indicate that the sampling time is too low for this CPU).
  Final task pose error norm 0.0225817 (Dual quaternion norm).
  Final task translation error norm 0.044178 (in meters).
  Final measurement error norm 0.000940036 (Dual quaternion norm).
  Final measurement translation error norm 0.001836 (in meters).

Tested on

  • Ubuntu 22.04 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
  • g++ --version g++ (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
  • CoppeliaSim EDU 5.4.1 (rev4)
  • DQ Robotics cpp as shown in the submodule information.
  • DQ Robotics cpp-interface-vrep as shown in the submodule information.
  • DQ Robotics cpp-interface-qpoases as shown in the submodule information.
  • qpOASES as shown in the submodule information.
  • sas_core as shown in the submodule information.

Python binding installation

All dependencies MUST be installed as system-wide packages. Also

sudo apt install pybind11-dev

Supposing there is a venv installed as

~/git/tro2022_adaptivecontrol
python3 -m venv venv

Once

At the root of this directory

~/git/tro2022_adaptivecontrol
source venv/bin/activate
python3 -m pip install ./python_wrapper

Using it

python3
>>> from adaptive_control_example import *

Changelog

  • 2025.05. Updating code to work with DQ_CoppeliaSimInterfaceZMQ.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-macosx_14_0_arm64.whl (356.9 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-macosx_14_0_arm64.whl (356.8 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-macosx_14_0_arm64.whl (355.9 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-macosx_14_0_arm64.whl (354.8 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74839e363d829faae8be3ca5d3d484b291441d95ff28e0a759b60a4bca172b83
MD5 7a30b8186eda08781345045cd81edb6d
BLAKE2b-256 f204747e3e76f3061e5cd7c1b134937a73fec0446b4f12adff090ac14b4833d4

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5e70c2c1f910ef2d8fee17897694a22bc5c19a65f60d0e69e36030a54d7c22d0
MD5 dfcac356908fdc2fce6347270fa867a3
BLAKE2b-256 7d83ea9b32f79ad843561bcf4b785856a0cf4885009158d3358b41bd95a06fba

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a8db1bd60004fa52f0ccdb0acb436ee335d2b2473a217888c845c7b60cea1276
MD5 de201b71b3839c4fb199caa74378186f
BLAKE2b-256 46830071c19b3c41803e616577a7dd4fbd0f8a0cc341d6cde18a1710f05fc3ed

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 06d92351ae2eadbf1bc2b5cb6a677e4fb7b30e9e047e9d4d728732f1f9342130
MD5 39b88d9c42d4b19b7f6b8043821628de
BLAKE2b-256 86dea3d13d4d06451b760b3906eef0eb2925ed6f56bb360e1e82ac60e181e34a

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 654a196fe92e4999f5e40c6c87dbe36a86512ad624d8ebe6d722452ee95ccde4
MD5 0161df37dffc3c52f14ba8f73c4091b7
BLAKE2b-256 0c98e3fe8be61f6692bfc95389611dd62955502859a4c005aad162dc3f8067cf

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f19759ff8c99007512525e7974de784b0667efc93df6b4c95a71d3a45d39efdc
MD5 8e221aabc101159039dafe794cacbb21
BLAKE2b-256 f643bd08bff67880177f3e5a03ce48f01ab8fad23933bc5e2647a9ae636ca922

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5981b82e16906ac2659585707b9d859ed2467345c9867e270e364a254a2ca03a
MD5 e870f8b1f9bf1e3f72821331839dbd23
BLAKE2b-256 c9cd520edf3a358c438ddc159152f8dce3c67e2c5764534a0e20e8b8defbd3b5

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8a07b00d70a176e85c68bee427584ead12cacae2bda52b100173024cdf98047d
MD5 d1a9ea97c20d6f1f04978ae6f21d6d09
BLAKE2b-256 355a9aec5f92cf5dfc6cd70d360d6f27fd23c3fe338d7c94a24cf069e7c0f0be

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 09f9809e3ab2f28133771b05b5156307c818b0465368a77914ce7fffa3497ecc
MD5 1a5e2a47bae9caa6f5b1cb0e0e158462
BLAKE2b-256 cb80f41ad785f853da68ea86f864eda17d828c338850be63041ac6e906380137

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf6e3f328e424fa9ed11c2321b0f451d8bd7ee49f08a98608a89bd68bf9c0aba
MD5 7d7afa402b81712bf6256345bebc7cd0
BLAKE2b-256 cad7122e57cc34bbf9aa9760da01a179021cf05824fa6d96e38a6ec1447b28c0

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7dc64f2c8ec5accfe00ab3c3bf5a0be145f15ad3c0e6912a483d4d918c34d642
MD5 072495b7cad8f289857f7d66f862bab0
BLAKE2b-256 2e7db947358560186964cf21b1b57d0f663414bbbe7286348323e46701f9ad25

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.23-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 91ad23cdcfbb6fb784a2d732bb0268578ff2c64540446fadf2354dfbf32a236a
MD5 752b69688c5366e7e98f008b913b0779
BLAKE2b-256 363c4e19675c2198a9a2b6f9ad3d8c40f0df80824b821f6916d1faf1942ea806

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page