Skip to main content

Using NEEMs database with the help of NEEMQuery python package to redo or replay neems using PyCRAM

Project description

NEEMPyCRAMInterface

A python library for using the SQL NEEMs database (with the help of NEEMQuery) in combination with PyCRAM to be able to replay the NEEM motions or redo the executed plan in the NEEM using the PyCRAM framework.

Installation

MariaDB Installation

Make sure you have MariaDB installed on your device.

PyCRAM Installation

If you already have PyCRAM:

Step 1: Add the other fork as a new remote

git remote add multiverse https://github.com/AbdelrhmanBassiouny/pycram.git

Step 2: Fetch the branches from the other fork

git fetch multiverse

Step 3: Check out the branch from the other fork

git checkout -b multiverse_interface multiverse/multiverse_interface

If you do not have PyCRAM:

You need to have PyCRAM installed on your device,

  1. clone the PyCRAM repository,
  2. follow the PyCRAM installation instructions
  3. checkout the 'multiverse_interface' branch.
git checkout multiverse_interface

Install NEEMPyCRAMInterface

pip install neem_pycram_interface

Example Usage

All below examples assume the neems are located in a 'test' database at 'localhost' which can be accessed by 'newuser' using password 'password'.

Replaying the motions of multiple NEEMs:

This is done by using the PyCRAMNEEMInterface class which provides a higher level of abstraction, and uses PyCRAM to replay the motions retrieved from the SQL queries. This shows the replay of three NEEMs in real time.

from neem_pycram_interface.neem_pycram_interface import PyCRAMNEEMInterface

from pycram.datastructures.enums import WorldMode
from pycram.worlds.bullet_world import BulletWorld
from pycram.ros.viz_marker_publisher import VizMarkerPublisher

pni = PyCRAMNEEMInterface('mysql+pymysql://newuser:password@localhost/test')
world = BulletWorld(mode=WorldMode.DIRECT)
vis_mark_publisher = VizMarkerPublisher()

neem_ids = [14, 15, 16]
pni.replay_motion_of_neem(neem_ids, real_time=False)

vis_mark_publisher._stop_publishing()
world.exit()

https://github.com/AbdelrhmanBassiouny/NEEMPyCRAMInterface/assets/36744004/d6179b69-6dc0-43bc-ac18-6fa237542d03

Redoing a task in a NEEM:

Similar to replaying the motions, but now we try to redo a single task using PyCRAM actions.

from neem_pycram_interface.neem_pycram_interface import PyCRAMNEEMInterface

from pycram.datastructures.enums import WorldMode
from pycram.worlds.bullet_world import BulletWorld
from pycram.ros.viz_marker_publisher import VizMarkerPublisher

pni = PyCRAMNEEMInterface('mysql+pymysql://newuser:password@localhost/test')
world = BulletWorld(mode=WorldMode.DIRECT)
vis_mark_publisher = VizMarkerPublisher()

pni.redo_grasping_action(14)

vis_mark_publisher._stop_publishing()
world.exit()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neem_pycram_interface-1.0.175.tar.gz (55.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neem_pycram_interface-1.0.175-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file neem_pycram_interface-1.0.175.tar.gz.

File metadata

  • Download URL: neem_pycram_interface-1.0.175.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for neem_pycram_interface-1.0.175.tar.gz
Algorithm Hash digest
SHA256 7fc10a725ce3762fa36e9b45b4c84604056bc8578eafab858b274bfa340eb8c8
MD5 634b621476cd9d17ab345055f844d153
BLAKE2b-256 f4437955af3880091382174596f28afbb9ac70df2d27b760b527583c601da8bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for neem_pycram_interface-1.0.175.tar.gz:

Publisher: publish-to-test-pypi.yml on AbdelrhmanBassiouny/NEEMPyCRAMInterface

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file neem_pycram_interface-1.0.175-py3-none-any.whl.

File metadata

File hashes

Hashes for neem_pycram_interface-1.0.175-py3-none-any.whl
Algorithm Hash digest
SHA256 f75f2ea4c91ec3e5fb90160ac658c7c72a7e3f249f1b6c78fff71f6fd17878a7
MD5 2a399ffa047a15b263b0e8b3c28d8f65
BLAKE2b-256 abe6076a2fdf89ccbfa686347caa8343b2619a643d7eeef73bfdf2e3304a188c

See more details on using hashes here.

Provenance

The following attestation bundles were made for neem_pycram_interface-1.0.175-py3-none-any.whl:

Publisher: publish-to-test-pypi.yml on AbdelrhmanBassiouny/NEEMPyCRAMInterface

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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