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

Uploaded CPython 3.13macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp312-cp312-macosx_14_0_arm64.whl (356.7 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp311-cp311-macosx_14_0_arm64.whl (355.8 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp310-cp310-macosx_14_0_arm64.whl (354.7 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 801d80bec3290bf86bc1e6e5f35c0c75eef4f575006bc4b8b604de90050619c3
MD5 e6efd71e43698ee9de99ee1e2e614896
BLAKE2b-256 73c573ddc86c979b85dae564742a337d0f4b9b000810c233ac7ebae7815dee05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d3672565f203ee1407a6d08c99d0bb3d0479c27b3d36985ae58b172afbb869ab
MD5 e78632b07e114d87fffb8d2855534cb9
BLAKE2b-256 f8757cf9347308007353c3f04ea407f1da2a5aacea3b1b9ffb20623b340c39aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ed08a9497bb5abb26d22556115824afd364fb590d8f47f00546bd7326a13e152
MD5 24bbe994512dbff50939b603081a0efa
BLAKE2b-256 97d7483bed3f5e618aaababaa73930689ef0a54975e92d76798ed2d3b704cd52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae72874ae5c728159b542e7c5786f2253de3798131a901dd6993e1671d37d055
MD5 5e3289fae1feb547798cde5544329cb2
BLAKE2b-256 4601caa9a082a5275e128be096a270a86d071568e3509285760c29a07f9fbe50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 189a8325450d7a36db81a6c572a2081b571b991625170691332d29438d18380e
MD5 10dd999c8fdea45efdd4f4c33c95b183
BLAKE2b-256 9350bc640c814cc21abb3e5703c46ba648df330a5f4a38e153b0787e8b45c253

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7976fa5271c1460469166a2988c6a2d97b8e79a70e6cdfacf69fc638500bde5c
MD5 f53d68509951c03aaa640903ed7d11b2
BLAKE2b-256 e60e019e5507db81389bfa4acefab1642f66c663f338224c15ffc3bb80b4d5cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4ff8cff5c05f6af8da844226a1d2529961a687ad2884e0567ee70894d9be877
MD5 949e674bd559160afb1143b4f01c338b
BLAKE2b-256 779cca87d11a6d3798adce23dfb77991c60e3dec02a4fd3fbf87b9b79ae072aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5150bdfa6041c7c89621e6162270ecbefdbf479a8fc05ad793db3b734389cedb
MD5 93866daa3f0308e85de88a4caef81e5a
BLAKE2b-256 75c100cc00577040a8f28b82966ddf7011fae580fc83b6d734dc6151eb73f487

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 db94fb9bf126192fe770ca5f3e44936eba8bd1df7419e3d8dffa57dca3c2587b
MD5 ddb1b049c86937878bf3f8aaf2c5decd
BLAKE2b-256 4e8553bc0bad0e237263fc414a874a69cc80c8fb0f303449ddb7b894fbd6c2ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4f333651445e8a918f54a9f618a9200b1225ba7aa91fe36b5bcf9f8643edab3
MD5 378cbfa99871e1c9d5313fef281672c6
BLAKE2b-256 64841eecc4a8eb995ed499fe20fc883cfbcbd0435cdeabe8613e0377ca7db2cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 917b80beae3b382d4541fac347e84cfdf8368895721393a56c7c366ca80aae38
MD5 e60aee263366e5de1c2f400502f00b2b
BLAKE2b-256 3f6ba86576e742d2901ece7eb0865dff49904e84ef92fe3087f81f638d4496f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinholab_papers_tro2022_adaptivecontrol-25.6.0.27-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4a62aecc24c335cc1513a1e168a7c4e0b066c747a1e31c14c64e1c115409f29c
MD5 136347e0660651a9244603639d84fd81
BLAKE2b-256 290131a7b2bc387e0324032d67ca4dc545c60214702c5c1566818163725e81b1

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