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

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

Ubuntu

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.

Changelog

  • 2025.05. Updating code to work with DQ_CoppeliaSimInterfaceZMQ.
  • 2025.06. Removed Python wrapper instructions now that it's available via PyPI.

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.33-cp313-cp313-macosx_14_0_arm64.whl (356.8 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp312-cp312-macosx_14_0_arm64.whl (356.7 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp311-cp311-macosx_14_0_arm64.whl (355.8 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp310-cp310-macosx_14_0_arm64.whl (354.7 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 690b48adc9221d9e4921b1b3401b91a4ee4190742bcf62ad763232ea2c75346b
MD5 e584dc8cd78532744e45000fa6e3b3c7
BLAKE2b-256 1063c6bb2b93a596e205026ce6cd6baeca0f462e58aa977828cad0878cbfc26d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79d86aaa38127e015c440dab337f2b909ec68eecb51a64c56b96233febee3d8e
MD5 47c01e664628577365696547fd0e7694
BLAKE2b-256 deee92ee81a3b192cbc1ecb7af8e1c278b55ca353b10853921f00c9b6006cae9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f9eb3bceedbf61487670fa7fa2b07b9f6c02f6ba71211c3aef43dc1f07e20c8b
MD5 fa7559d407477a874adaeb1460e74a83
BLAKE2b-256 139d68703bd7345b464c27be2225d6a5b7e149ed37efd93a967079e776c01622

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2ccfe35c54949964c7373d2933b28e752909adcb76ad153401e3e799324f522b
MD5 a7b48422d488f9ad2bf710c671263c05
BLAKE2b-256 0012fdf031c26cee2ee9538f22d58023266efcbd9188c86880a84737ddec0d67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 17d4f6d5932f805c2b3c7b2b7bb238f559bcea25dd2b54096f8996d2f4ad8d14
MD5 ea6e2d3e6091368cae53d032d9d74ce9
BLAKE2b-256 40a954951a5adbd15cbd6fcbe988910b51e58e4242ea61d3d6d991191fd0acb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f2de9a3c2646eaaeb712ce12e93a485fae27ee2dc8833a1e2cadc320ff1bea79
MD5 383bcd1d06770b8c141756acb09b5224
BLAKE2b-256 49b7a13bf0f1f6ca6e36c1664d0ca855d8007f9097176a8c28d101bb2d025695

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c5386c08a13ee593822e863539ed78de5d88956e503b190ac9f64a9860796cd
MD5 c2ab62947246ed1b478b18c9fdcbec8d
BLAKE2b-256 40c1b3c3a1ecb05baaa73b75a1bb2e94ac617bd914f1d8f32f2918a593dcab66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9f588c1be41b0d7098d2edaf0af444dea17213743c3c01cda7731ffd37f70c3b
MD5 a8eac4b4422b6bedec3182b7d4c9a5f0
BLAKE2b-256 5156fe1e9e566e983698eb2fb8b4dab684d3d17993cc82c34b74f3d8dfa006ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f25ad28fdd0f1005e3e1571331e77ef062d12930c6cc43afadf7ca7826253afb
MD5 21d133d8376e433bd89a46dbd7990dc0
BLAKE2b-256 f9cabe8dfe523972aeac293a108daef473b02abb4516ff7d2d4dc754ad39a849

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b8d307065bac938875e42377a5fc630f474acdf6267c4defafddb95d5979a555
MD5 36ddd09f07772cb5be232b911597d6f9
BLAKE2b-256 a62539a8e998a6144ceb703c2bc299e7ee116fa14740fbf8b1c161ff480248d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 63afbe1c830359e9191c7f1f2d0be28187951308de80117a91dd5e927a6bb19d
MD5 5d2bcd777795f0f0aea6005d96653e47
BLAKE2b-256 9c05f61f6935b04cc96349ef99211df54fe65171a7d712acbbb1f4c332587225

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.33-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4943d27caed7f1ddc27bd3d9fcfd94c04514d1efe491beafcaeadea110911105
MD5 90b68079b6a4ad2f5671dc02852501a6
BLAKE2b-256 b06c379f47d0f6e48f2d12a6648697d35fbe31369e5afa318450a76b7f09437e

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