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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a81e11db3db51a778ecc2e6401fa6db65d4e2719a1a00294f0b5b091ac4dd611
MD5 99c2706523c3f577de9d45a6b8cdb6c5
BLAKE2b-256 ee13e8bc4d432d78d7a3687bcf11ba70460310952e2dde030f7c67d0c3f0343f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2cb7723612922639eccb866bbd65624b7884674d85bc3eaf149929bae2f98c1f
MD5 3726eb480dec29728f755a6c90259cfd
BLAKE2b-256 533c060cfee596516a238324eca96902d3da7a063de28f939012ed5f1817b507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6e3ef41073b73892769641d20cee00e507c84d873d36c4957bef0452a773d372
MD5 7c2128c8d775bcc55792158d910c42db
BLAKE2b-256 bcbef315dffb2ceb465ac7df15aa8d1456cc57672adea66e04356fa5ba5813bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9a50c1e23ed20dc99b914d24b03bd75cbe5d0d74db2600c482a431a5b3927dc6
MD5 82fab46880ba6964f5bea2524119fcbb
BLAKE2b-256 1e2a395a46e24a815844e5b4ed013a56fce27f77051724fa97498320c7924b89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 34f9a1739b9c15913ffa21935f731caa3dd8abc28ebace61226488912dd5223b
MD5 eaf905fc33b696139fa95f141f462129
BLAKE2b-256 bd2faedc78fe3ef1365360673c42f0fed117891a63bd3ff538ded5da066001fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 79a1155296f2b7f87d372be9849710ab6e7db8e3dee769d707980613437f75de
MD5 a19ca987b5702838eb1b4ea9de0ae5e1
BLAKE2b-256 34fb7ad109e87c3261a4370ffb411f2264fb956e8e86e41818b80c7a12a53305

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 80dfac037bd0584543ac70ebe2227ef52240635ac03ba307ecc00ff4c02d070c
MD5 77c1f5593f2acb53799b217a1b348fcb
BLAKE2b-256 b1a1ea1f2c5ad2959db86dec85dcb9a842ebe6b90aee979ad0e6af22d0a663d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6988d59d92248881144102e7388b3e61f35c708d16077f91ccdf9613276bdc36
MD5 e778a9cbeeb5191b089b8cb36af03c41
BLAKE2b-256 ea31ea1da3235b06695247dd966b09d10c0de95a29bd486266b8bd9d39d3d17a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 48b92dd26292e49a957c3bedbbb6a18e8b162abb35d437656e117445400282b1
MD5 8ec1605d2ef630ef3a116d72c564ff3f
BLAKE2b-256 393875a8e96ac9b1ac3fdbe3d00545ca32e5040903d63e1012966bfa34535d18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aecf38ec862a86628c3dade007f69fd40ca9f9936e7e4dfb2f4630501feba4e2
MD5 f3e863f354dadcbebda6686799ca6fa1
BLAKE2b-256 b3cffae8165f5627312011754790b78f92d5e9a08dd486be2cd8f11f6b397aba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 186dbad1e9375285e3987943c0afe7ec71fc866fa2c5a66064c290c77913d005
MD5 d7f4feb750428159640f3392bfd2f31f
BLAKE2b-256 001d93cd63cd47cfab4035b7a4c4a467b09d104b1de7dfa0b1adab017f768d76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.26-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 95f957f0db86a454c3a2ce082186e58f3b787c9088ce8129ed9d42ed6ae04e4f
MD5 5be1cc3798c8040aa9b0bc4471cf8dc5
BLAKE2b-256 1328aaaed2a225eb3ff68a3490bb0af677f1e21da8d6fe332441875ec01b452c

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