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)

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

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.14.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

neem_pycram_interface-1.0.14-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for neem_pycram_interface-1.0.14.tar.gz
Algorithm Hash digest
SHA256 41870180a5e601c84ff2c5db47843913c8831ec595df3642a2ef71abd2f29c88
MD5 4209cbe9e21f744699f3cd8f4141855f
BLAKE2b-256 1fb3c849a727a3d4adbb0e612043a881ae257ca17bb64f03172b4d1675fa81e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neem_pycram_interface-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 d9f7fe8796540ddd2d36832de6b423296a5b52992e1db38693f800ea3fd1c15d
MD5 3aefa927456c317585f3fcdff89ee1a2
BLAKE2b-256 5b7515abba580676207a383fcfd16172deceabe2dcf4fc36c716dd5aba1c04fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page