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.34-cp313-cp313-macosx_15_0_arm64.whl (352.7 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp312-cp312-macosx_15_0_arm64.whl (352.6 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp311-cp311-macosx_15_0_arm64.whl (352.1 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp310-cp310-macosx_15_0_arm64.whl (350.9 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31079c35f4d54d76415a24cc3f1a74cb624a757b6b24de6f005259cee8f87e34
MD5 244236a5827e65fc0c03fa8bdbbad0e1
BLAKE2b-256 9a5854084f82e1bfcacbb997c8a413d2b6a569be21e8b77e0614f2663101ec36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 59289ea17bbeb57079294786262152a9c10879e6ecd3e726be494a2c25c5c144
MD5 f6456bfdb5f085b080b77be33f5308ec
BLAKE2b-256 ae341fd028e8d7c2d16f6ccb9a64c06e3c8b3116798cb379939ecbdad40ebf87

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6301172cfb0917453bcdd20b4f2970556c008048a998c5e337dd309ddfb79874
MD5 56c741e7b801409f9b3b5251014aef20
BLAKE2b-256 a2b0d0045035fa674a023d157135c389b3b53a9730b04fe0bb2aed5ecf128cd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ffa2a9cbfbafdbbfd7549a635a329e9cb805bfa6fad9139550a72cef9e45ec56
MD5 8e1880ae63d1283a355a2ce050f57f18
BLAKE2b-256 5ec692b5761c0bbfc9d78721b4b7334787a168d35108b2f1c339827732b6f4c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fbf969268521d62f138faf5132f06e32b2bcd9495b1f618f2800cfc856f38a35
MD5 87050bf024a0968d5799d2e31bf8908f
BLAKE2b-256 2e1eca19fdf52f547328c6a81808caa8d1e69c595ae372457ff5702df0570492

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ae75f7e1c918fc60f822e2976e6112409274ec75eea9ef6f5818859aaa265406
MD5 0f33b8cddf136bf5707ac067ce2c39d0
BLAKE2b-256 ca8d1a417525b8a423be358bd2bfa2f3b7619ceedf488059761d265915c3582b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61dd2235f383574ab16a44d6d9f70ee79bb6a5111deae236c9b56b73ae3634d2
MD5 b97bad0280a5a2874152392b5e94430c
BLAKE2b-256 38365cb55841f1902154ab24d933db94ca61bee426b43d88dcd59cb137d1bb2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4c164ca6de8ac97cb41e36204bf02af62d71ee9d1a025167ce00acb344c01b50
MD5 93466f0deba165d5bb95e6ccc1e4872b
BLAKE2b-256 0b3e14e49924d59974a311143e71c80bc5aa2b2e8e5aa1b5df7a1bdf84d5640d

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b646c82ff32ee2b004f8a6f6111f3d32b4942b5ada2a5c7d32662b666fde74f7
MD5 3c445eeb84d01b6f60189622154aa474
BLAKE2b-256 6cdf52804e3e1ee5162ecddb75e1436ccadff8683852bb2c53c43258541e44db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6c024d2ed873f3c677ae04ca029167e6d5eb03670105ec2a76fe3e64e09d7af
MD5 ce1bf3fb5cfe04a02fe2719349907d84
BLAKE2b-256 a6d026ae4debdc0c7c815dc5fde6208ce4cefaf5533af366532e95a8df697ce6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5354b9e4aa036efe7a61f24584a61856b66515469779d8ced9174d8ebcf43e67
MD5 029be0d462cf937bafeaab1f5d2381e8
BLAKE2b-256 bd3052e185cfeae1b9c02b676e77901588bf88656cd12b710276b9e4d8529671

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.34-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 076d7230fa5fa92bae48e1cb1408b86c5467f9faaba17a337a4051dd418edb41
MD5 d0a3912bc8a5bcc84769071c362d0297
BLAKE2b-256 324b0091e10c05199cf67fc78f9553fc1309fdac7ef1ef41f5115e5e73ac3da7

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