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.25-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.25-cp312-cp312-macosx_14_0_arm64.whl (356.9 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-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.25-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.25-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0359bb9d36cc787ee6f13ef4a641a55b9dc1f2cc65500b6da7895393f63570a8
MD5 de5323ee40bf9b914ee15ea7f4236952
BLAKE2b-256 85b6417da011e022980202088c1bc6de652d9ee1521674816b0fd41b9b3f9448

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 80056b182bfd0f791bfcb682fe9563d5a49b2678fecb926b5fed582c7f34b7e5
MD5 3398eb750ec0bdd399c667d3e2820957
BLAKE2b-256 aea11d903f41415b44297ebaf9629f8ac5d670a4b19204ea5ecfef947ff6201d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ca6f7f76b8a2bbc2610a634bf4e2ef99a7b35ae049ac4ba404d99473300c1a09
MD5 8b4b6e2c2967fe627d3255fce30e0ffc
BLAKE2b-256 dc33fe0c76529692e4e339c43325f92a0188c42fa2ede9969e1b21c176b468df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1262ac26ffe98e3fab4e2669edb4a8ad5bad5a7e4876a38f9483f09a19506b1e
MD5 ae87ed5158d8c42c9ad60465c189489d
BLAKE2b-256 1b576e62d51ce661fbad9a60ba07383c08689ee0ee591895094b4fabc7986c20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 78d187c6a59375224471c5f12c3566ef4267bb7c579cf13aa434aa5a908e73b9
MD5 da8f81ceb8db331cd61701b4478a5169
BLAKE2b-256 2c616ee43cf7d28de07f386eddd144979d59df7de9d0fb8e2ee791435f1e3dd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0e173b49928eef2969f51da341525cdd8f4eab1ae063bc3ba7e6be4cca0ec2eb
MD5 5b0448ce2c021adfc4d16203140c684c
BLAKE2b-256 e9a30e9ef8fa5af4cec0baef014a62e60bbe26aad95ef0c1f662772ab5af3638

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00101ea40a105e38210a424b2d2942f3c31a9d2f0eeb339de76f6a1350b0548b
MD5 3d54416ac57b7b7df31515b5e878e6de
BLAKE2b-256 cad56bd2d9fa128dd04d1e37c44ae71b8a953add89d5abb395b42ce392152403

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d9c30ccff0dce806dca8d49d1438c57dd84b7b646f360f9ac4c5bd694004721
MD5 a25e03c26c372602cc7ccd08ab9d55cf
BLAKE2b-256 64b8fe38e32d419faf02c63fee90c3105978ade245928d9dfddbf54661519dcd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c741157b60679e4e3bf92caba4ec055e78d655c31380ee2b0d8fbc35b593469b
MD5 cb2c6276c1d8e11fda4c7db5eaf89463
BLAKE2b-256 4993196daff2939e144dcbc31e1e895b29b23491d4aecd8c4e293fae190320aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d1e0cf6092470b08a0d257c40bc6cf69eecd47be4ada502bd6a3cdbbc5d86f9
MD5 464c6f1af67572512cca058876e9d83f
BLAKE2b-256 d8180bd7460e8ffb03f15c91f8604dbe0e82b3076a0085ece9be80fc33d5db97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e361f2bf9020c604e5668cd97b6bc4b555626e3ae2b14993631a0af8ef38626c
MD5 f00ab67f5fd33cd0f7c8d2e667f0912e
BLAKE2b-256 c0f6bae5b6ad2bba20b169c1caf1b52333cbc1e29a01783a8a49d453b2ef9fc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.25-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d4976d268c8621fb15ba0b18e942a8fc6ee313178d2e7506fbb04f9a14151600
MD5 47ff9a414e34014ccb402fbb3bf971d5
BLAKE2b-256 dee021a59c0d00366045ea0b612e0903074f6853c3af23ceb710d2a3e42eb486

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