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

Uploaded CPython 3.13macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp312-cp312-macosx_14_0_arm64.whl (358.9 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp311-cp311-macosx_14_0_arm64.whl (357.7 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp310-cp310-macosx_14_0_arm64.whl (356.4 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp313-cp313-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 653d0bd0a47c149db90b03ceeab24f089416c87d0bdcfdbe84767e4c64094685
MD5 a29184e0d051005aa5faad16505fa073
BLAKE2b-256 6e23c6577494026eeea21cf21972f378faaed0b74cfa53f538eafe9799a5bd1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fd36115f1a1df799172e3fb19d23b9d9fa724d23fb1c475bcfda9951bd1091f0
MD5 edce58e783b173849c66ddb352d00774
BLAKE2b-256 7d64e4c1f1d2b096d0ff4bec12c0412d48f4182da47843888af2b8d8139656d5

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea852e98970aa72839e7ee1e9b6aa5428a3d0a1b90c65b0d8c8d434a0facda0a
MD5 ded4c72477f60fcddb1b0b835261421a
BLAKE2b-256 8883be8295d6a03da42620e4ade6cbaa51f43b0e6137844a6c3f5347198a3da7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2f5ae8d6579b585cbf5dd8439ed26f68ed155f49b959d4b136b98e99727895b6
MD5 9dc8542f34970f50f3e0bf242793fec6
BLAKE2b-256 d75fbe5a6100812aef62548e3481d5e5786e9d5186164d5ac321a2455b11fbf0

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 518fe7bfeaf3b6fec92efe5c5c42479a65c57ca82e6033f030da7d235b9b4304
MD5 aaa7921985b31607bae5fcb43441ed74
BLAKE2b-256 f7fb72db4d426787934a083090f977db05af859d12dfc4b4bceb8334415234ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 35c50d5b1a025ee26224fae4dd4b11ab46defbd5a9f52a26b1cf3b03636feec5
MD5 7a3015eff14e621e8e0668b198a22b90
BLAKE2b-256 443fed708169a4c360d68f1575a32b73eaca91183dcdac4e47445022aded6ad2

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 64147721d6c68b6f7e722092e7d2436a6dd53226e049c3d2b0d721bc681ddbfd
MD5 4c3a18c0eaa3e54df061457fec60d12f
BLAKE2b-256 c98cd4b8da7006a1a076ff10a79fcef4aca5367afcb980618ba39d5adce5b49c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f05518a877aaa5f9f978a8ac3e46ce4b07ffba5f3648712df407d67d38eddacd
MD5 917e9b1d66a4396ea0056857d3601a9e
BLAKE2b-256 7a8d2d896b27ba51261dff0c6c7cec5a8f8447d21c31293455263ad0e42717c6

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.5-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9ae932dac9cca703bfdac94bfb974dba259efc63e7177c712a45d47018a465bb
MD5 0ca98773fb91f0b0da182b6ee6cad924
BLAKE2b-256 29dad3dac0c86ddb30ab776c7f8eb01b49de066453fad8af351408b4fd6f2619

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