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.24-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.24-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.24-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.24-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.24-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d8a7d4a3bc24acd5b40a0ad7da679c46791267687b39afc5d6cd02e25f5aa08
MD5 3399215df7c92c85b851a748a9691904
BLAKE2b-256 32a9cb27064723ad646c37e2f162be369ac4cd57dc09ec26b730f784a03e7829

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c420ffb518446ff32b9d19d68e0a533296c52b0ce9cde29b52b157510a57779a
MD5 900adb27c4880432faa6e2c773b43b97
BLAKE2b-256 bd26fc88312f45a069c2d95c15d8aeb30017c00605a62d4df0d2ea56cb90b387

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ffca8b25a3bcf49e4c56ffbb40aacaac0680dc44294844755ff2ee9269b93d36
MD5 f48e522ebc17428fde0b134438f3b946
BLAKE2b-256 ed4526237ea7f11c20edfc7a626e98b96abe04716d8914e21e69954f1486ea7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b151edbcba656c4b0053b975378ee5493b5914f1122949b7d16eed21cd3222ee
MD5 627b7585c115af70ec8dd907e1c899b3
BLAKE2b-256 e40e2fb2a8c755776f94f5f91f29013ff3f0bf8ad692719710adcf4fc23743ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 65f1919b62ed6cbea2edc4d3b1891c0de6236b4a773618638b809b0e8637d49d
MD5 eec3659196b3fce495fd8d550673243d
BLAKE2b-256 149da85075130c893170e42aad226cd7731186acbf2a4d5c222dcd0189d287fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a4881ae0f8b62ef0d999aa8020ec8ea2c93d58628660efb99cac0b6b29391a86
MD5 0357aa72166779dd67fdf0ded7cbbf81
BLAKE2b-256 6effa2c317edad3785ae809f9b20c3d40363faedd77d718fdd8e3ad17532007a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 94a2e578b22db686c851a3d2e52d3c5f5682e92dc675b26f13202eba2fe7473c
MD5 5048215ad65b4dba603c336186462894
BLAKE2b-256 5e58798a57b41e2cb8aeb0cd8b23e4b9989ca8bd9fb6cee4a1708aaf485a8874

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fbdc8aace987a48857f3c1918318c03e4f2f6572f2799f677aa778758accfc47
MD5 406045f55ca7b3286cf18b37d9d6e525
BLAKE2b-256 a758e05370c49e709257388ea72d75216c28684da3f4141c3794f7d0b894e86d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 802c6a8f40144b163c4075d756b07b96ac0aa9ad65386724e3f038be4a010c25
MD5 49796ad9dea5c5b1ce3d7e2db79ae96b
BLAKE2b-256 878e172278d6d8ad7a32728adea5a46b527fc88962a6373b56f077971fdbef7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ab3b958d53165b899d27a1066e1af2e7790c8e72dbf755b816a9358b07d2b67
MD5 4a6cc1f77e6732b8224c7bd3b64ff66c
BLAKE2b-256 d8602acdb0f83bfbfb4f77a1d11950eaae77362f12cee7779dff710143f4274d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb3568eabf79cf74a1cf0ca4be162946eb89b37ca5bfdf123a21cec4c06935bb
MD5 acd1175dc7114c937734677b521c43a1
BLAKE2b-256 96be77facdb7b012386f853a03583de77e88d7ef0e33fcbdcd36a637521b6fdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.24-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a7340c521565d9333fb3a786dd14dd8b09892866248ca76d67c20d9b1e67160f
MD5 707185d4a3106ee8c5ded0e8109609cf
BLAKE2b-256 18cd39630827a88def5d0d21a4c3ae57e17e0d550be266bfe38cfe6aac37a7f3

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