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

Uploaded CPython 3.13macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp312-cp312-macosx_14_0_arm64.whl (894.7 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp311-cp311-macosx_14_0_arm64.whl (893.8 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp310-cp310-macosx_14_0_arm64.whl (892.7 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp39-cp39-macosx_14_0_arm64.whl (892.8 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2626d189d906f8f8bb677bc43f62f5cb94c35dc6fdf31c2019904c208178c704
MD5 c2bcb19c934f58b0130b137a1e24ed50
BLAKE2b-256 bd55a411f87a7e3cffd5b36025ff37b156922569521c4e0371dd2d91f3fa0517

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 117192a20a05d8f2785e9299af888b2d0fed0b5a03ea48603094fafc6e79a03a
MD5 8098490bebc8573026e9914a6ad007ca
BLAKE2b-256 806b925c84e8589ee96a876c77f9ead3a8a38fe832c0bafc400c8c3fc6404491

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7b650f94bac06d4233a3f20b57681b12159d5637788ffac4f99b5fbb8a5503c3
MD5 b3a277b8a8aa338c802f8a4d7a9ee00f
BLAKE2b-256 54a642f7875042a8667c859541d6dbe3a1e3a7aab4979f62a0d6ff44382655ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ed9dfeb588febb457262947c47b4b194da26d4adc6cc907fe06f43a986aaf7d4
MD5 1db91d889e3c3ebfd4a80ee950932f12
BLAKE2b-256 e6d413d058dbe863f70be5f634c0c894d06b1c64e69a15578108f14e0254f9e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e4450b023776048be4b597373962ffd2917b59e9461679e5a24b11a0926da3c8
MD5 dfdab8bba7a47600b7dfa8097d734364
BLAKE2b-256 2712c98865956ec0e7f0b55f9a806dc3fff50335d51753927b1e816161a75858

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 80eef2d442d8f587fa88feee805904fb83de2854ab669e0b6a1e9aad7c1a310e
MD5 d7aa64161dc49f258fb1bb8da8026120
BLAKE2b-256 da3b7939241a5e2233c1c4e5021d9421a55520b0e95a45ae292b7f7b7f4e6f2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 808690ccc16e478cc48083e98e8b8d286fead99b4c08ee6876c89dc254eb4c47
MD5 46485b43c647cf7716d8a7345ad0b24b
BLAKE2b-256 281c63ac17c13a6e77eb45793531ea3bcca5f148bc4c14097768b1742fc2d4a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 44ddb1cd59b12a37e8286dedebab024ffefdc5b7160109c596feb24847387eac
MD5 04640c1e0c1a08c37246d9db58529458
BLAKE2b-256 c7f7135e47e174e57903a6fee7e69e30e169d594efbd9890001124c4a70a12c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5aaa1e5a1bb69b1218a78a2a72ef0eaf2e70a71928e29eebc50bc4d5d63aeb7e
MD5 f71e929e027724d6cb2fec3affe64202
BLAKE2b-256 4f3274a7fc5e2e290678e08cc0d0c3ddfafbd64dca07495bb92b6ff18e1f928a

See more details on using hashes here.

File details

Details for the file marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.5.3-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9a19c86c4f7882917ea7d8d7fec3af029e04e4c3ffa66d1f1100983a2a3fae91
MD5 2cc93639af8d4b04213fa5a563f7c599
BLAKE2b-256 6bd98b02ca863afb5490b789ecc7daf15454bc1da97fed8cb37530527e86ea58

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