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.20-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.20-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.20-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.20-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.20-cp313-cp313-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 397e14c674727b6e994d259a37a4cd882f01b08ffd0735bf6405ac0c41395937
MD5 480c4f1295b0c2f35c4d140e4607e04a
BLAKE2b-256 d8d6e8d82e65b0ac3d6e10929d141bf72acc45b255c8f4aeed9522afc3b48e27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 89c22a8563cf066ff43ccd6726d10577c8e3f1b6e8c465758f28a880dc6f3308
MD5 752119cdec68bfa49a9a8d0bb26dd090
BLAKE2b-256 8aedcf8ab4d5d1fc9e250a2490fbb5e5271595e1dbc66d37ac25411f6e9eee46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c2c7691e35bbcf903543b59f148000655eefa66b5495fd055490a57fdc77bf9c
MD5 3f8bbbfad2fdb5742e63c1d3176a3058
BLAKE2b-256 b76db8ec8e93eef8e51ca946d8fbe4c93f1be1ebbf1ef06c5c18915fad0e8fc7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1ffc1f34d166bc5cc3ca80253a51ecace5f1d69be955d3147d7555a9c3b95c4a
MD5 ba4b620dd4c62b555214d348575c270a
BLAKE2b-256 67e18c8ea2ed407a50d5057e6bccf3c97782ec925bfeefd33db19c1543ea5202

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2e68cd870b40b391580c6b9a2e5cd2c7d43ae4b627e030670915a367610e7947
MD5 f7ddf11b6c66e28cb1ff02b8f0d7f7d6
BLAKE2b-256 e12d3fce7d6e658533940bd3fd2ffdf45732268d32d01230dbc7c0558a9123d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0f2cfbaee14d74924f2272fef43254e5d084567653d8c28689362074f44f829d
MD5 fde7e4607bfce778702fc6861c566ca4
BLAKE2b-256 7b2ed58f4c1f7053cecf7d8df0d9ed395bb4d0024919e28f2301900cbd1ca0c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f47830c02a9e23cccf4897d63c3f8d24802cc00ec8342c1cbeffc31f2646e3fa
MD5 b98cea8508933fb14ceda23a774cb996
BLAKE2b-256 e2bba689067a684bed4dcd0746ebddc891543aa08f524057fb0f4731baaa1610

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.20-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8ab84f85f9befca50a85129ecb2ed92738a284e6df2fcbcefe883bdabe5f2026
MD5 8f942c6df28c5390fa4062ca84ee27a1
BLAKE2b-256 0e3bd1282efe14622b3067fb90151b6a22f4351156a0a147c0127b50aba52d33

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