Skip to content

Commit

Permalink
Remove planningserverclients from repository
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvd committed Nov 21, 2022
1 parent 4217b54 commit bb5fee5
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 114 deletions.
67 changes: 2 additions & 65 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
# 0.16.8 (2022-11-10)
# 0.1.0 (2022-11-17)

- Regenerate graph client.


# 0.16.7 (2022-11-08)

- Regenerate graph client.


# 0.16.6 (2022-11-01)

- Add `GetPackItemPoseInWorld` to support manual order processing.


# 0.16.5 (2022-11-01)

- Add `UploadFiles` to support multi-file upload.


# 0.16.3 (2022-11-07)

- Regenerate graph client.


# 0.16.2 (2022-11-07)

- Regenerate graph client.

# 0.16.1 (2022-10-07)

- Remove `ExecuteTrajectory` method, to avoid dangerous usage. Instead, an ITL program (e.g. with `Move`) should be executed to ensure that the trajectory is collision-free.


# 0.16 (2022-10-06)

- Remove `GetInertiaChildJointStartValues`


# 0.15.9 (2022-09-30)

- Regenerate graph client.


# 0.15.8 (2022-08-19)

- Allow controller client user to supply additional headers to be included in http requests.


# 0.15.3 (2022-06-10)

- Removed `mujin_controllerclientpy_registerscene.py` script that is deprecated.
- Add `DeleteConfig` api.


# 0.15.2 (2022-05-10)

- Removed old functions and clients:
- `itlplanningclient2.py` (`ITLPlanning2ControllerClient`) and `realtimeitlplanningclient.py` (`RealtimeITLPlanningControllerClient`) were removed. Use `realtimeitlplanning3client.py` (`RealtimeITLPlanning3ControllerClient`) instead.
- `SendCurrentLayoutData` and `ResetCurrentLayoutData` were removed from `BinpickingControllerClient`.
- `RunSceneTaskAsync` was removed from `PlanningControllerClient`. It is available via `ControllerClientBase`.


# 0.15.1 (2022-04-27)

- Moved `ResetCachedRobotConfigurationState` to realtimerobotclient.
- Port from mujincontrollerclientpy
5 changes: 0 additions & 5 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
# From mujincontrollerclientpy to mujinplanningclient and mujinwebclient

## realtimeitlplanning3client

- `CheckITLProgramExists` has been removed. Use the webclient's `GetProgram` instead.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mujin Controller Python Client Library

![Build status](https://github.com/mujin/mujincontrollerclientpy/actions/workflows/python.yml/badge.svg)
![Build status](https://github.com/mujin/mujinwebstackclientpy/actions/workflows/python.yml/badge.svg)

This is an open-source client library communicating with the Mujin Controller WebAPI.

Expand All @@ -16,7 +16,7 @@ This is an open-source client library communicating with the Mujin Controller We

## Running on Linux

Load mujincontrollerclient as a module in Python.
Load mujinwebstackclient as a module in Python.


## Install on Linux
Expand All @@ -42,12 +42,12 @@ virtualenv .ve
# install required packages
./.ve/bin/pip install six==1.16.0 requests==2.27.1 pyzmq==22.3.0 graphql-core==3.2.0 typing_extensions==4.2.0

# install mujincontrollerclient
# install mujinwebstackclient
./.ve/bin/pip install .
```

Then, use the `mujin_controllerclientpy_generategraphclient.py` to generate the content of the `controllergraphclient.py` file.
Then, use `mujin_webstackclientpy_generategraphclient.py` to generate the content of the `controllergraphclient.py` file.

```bash
./.ve/bin/python devbin/mujin_controllerclientpy_generategraphclient.py --url http://controller123 > python/mujincontrollerclient/controllergraphclient.py
./.ve/bin/python devbin/mujin_webstackclientpy_generategraphclient.py --url http://controller123 > python/mujinwebstackclient/controllergraphclient.py
````
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import argparse
import tempfile
import subprocess
from mujincontrollerclient.controllerwebclientv1 import ControllerWebClientV1
from mujinwebstackclient.webstackclient import WebstackClient

import logging
log = logging.getLogger(__name__)
Expand Down Expand Up @@ -224,7 +224,7 @@ def _RunMain():

# construct client
if options.controller:
controllerwebclient = ControllerWebClientV1('http://%s' % options.controller, options.username, options.password)
controllerwebclient = WebstackClient('http://%s' % options.controller, options.username, options.password)
controllerwebclient.Ping()
config = controllerwebclient.GetConfig()
target = controllerwebclient.controllerIp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ def _ParseArguments():
parser.add_argument('--timeout', type=float, default=600, help='Timeout in seconds (default: %(default)s)')
return parser.parse_args()

def _CreateControllerWebClient(url, username, password):
from mujincontrollerclient import controllerwebclientv1
def _CreateWebstackClient(url, username, password):
from mujinwebstackclient import webstackclient

# create a controller client for the controller
log.info('connecting to %s', url)
return controllerwebclientv1.ControllerWebClientV1(
return webstackclient.WebstackClient(
controllerurl=url,
controllerusername=username,
controllerpassword=password,
)

def _GetScenes(controllerClient):
from mujincontrollerclient import uriutils
def _GetScenes(webClient):
from mujinwebstackclient import uriutils

# get the conf file
config = controllerClient.GetConfig()
config = webClient.GetConfig()

# get the current scene uri from config
sceneList = []
Expand All @@ -57,12 +57,12 @@ def _GetScenes(controllerClient):

return sceneList

def _DownloadBackup(controllerClient, sceneList, timeout=600.0):
def _DownloadBackup(webClient, sceneList, timeout=600.0):
import re
import tarfile

log.info('downloading scenes %s and all configs', sceneList)
response = controllerClient.Backup(
response = webClient.Backup(
saveconfig=True,
backupscenepks=sceneList,
timeout=timeout,
Expand All @@ -80,9 +80,9 @@ def _Main():
options = _ParseArguments()
_ConfigureLogging(options.loglevel)

controllerClient = _CreateControllerWebClient(options.url, options.username, options.password)
sceneList = _GetScenes(controllerClient)
_DownloadBackup(controllerClient, sceneList, timeout=options.timeout)
webClient = _CreateWebstackClient(options.url, options.username, options.password)
sceneList = _GetScenes(webClient)
_DownloadBackup(webClient, sceneList, timeout=options.timeout)

if __name__ == "__main__":
_Main()
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import time
import datetime
import argparse
from mujincontrollerclient.controllerwebclientv1 import ControllerWebClientV1
from mujincontrollerclient import uriutils
from mujinwebstackclient.webstackclient import WebstackClient
from mujinwebstackclient import uriutils

import logging
log = logging.getLogger(__name__)
Expand Down Expand Up @@ -47,7 +47,7 @@ def _RunMain():
raise Exception('Have to sepecify either --syncMasterFile or --backup')
taskName = 'registration-%s-%s' % (command.lower(), datetime.datetime.now().strftime('%Y%m%d-%H%M%S'))

controllerwebclient = ControllerWebClientV1(options.controllerUrl, options.controllerUsername, options.controllerPassword)
controllerwebclient = WebstackClient(options.controllerUrl, options.controllerUsername, options.controllerPassword)
controllerwebclient.Ping()

# cancel previous jobs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from mujincontrollerclient.controllerwebclientv1 import ControllerWebClientV1
from mujinwebstackclient.webstackclient import WebstackClient

import logging
log = logging.getLogger(__name__)


def _ParseArguments():
import argparse
parser = argparse.ArgumentParser(description='Open a shell to use controllerclient')
parser = argparse.ArgumentParser(description='Open a shell to use webstackclient')
parser.add_argument('--loglevel', type=str, default=None, help='The python log level, e.g. DEBUG, VERBOSE, ERROR, INFO, WARNING, CRITICAL (default: %(default)s)')
parser.add_argument('--url', type=str, default='http://localhost', help='URL of the controller (default: %(default)s)')
parser.add_argument('--username', type=str, default='mujin', help='Username to login with (default: %(default)s)')
Expand All @@ -29,7 +29,7 @@ def _Main():
options = _ParseArguments()
_ConfigureLogging(options.loglevel)

self = ControllerWebClientV1(options.url, options.username, options.password)
self = WebstackClient(options.url, options.username, options.password)

from IPython.terminal import embed
ipshell = embed.InteractiveShellEmbed(config=embed.load_default_config())(local_ns=locals())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _ConfigureLogging(level=None):

def _ParseArguments():
import argparse
parser = argparse.ArgumentParser(description='Open a shell to use controllerclient')
parser = argparse.ArgumentParser(description='Open a shell to use webstackclient')
parser.add_argument('--loglevel', type=str, default=None, help='The python log level, e.g. DEBUG, VERBOSE, ERROR, INFO, WARNING, CRITICAL (default: %(default)s)')
parser.add_argument('--url', type=str, default='http://127.0.0.1', help='URL of the controller (default: %(default)s)')
parser.add_argument('--username', type=str, default='mujin', help='Username to login with (default: %(default)s)')
Expand All @@ -27,7 +27,7 @@ def _ParseArguments():


def _FetchServerVersionAndSchema(url, username, password):
from mujincontrollerclient.controllerclientraw import ControllerWebClientRaw
from mujinwebstackclient.controllerwebclientraw import ControllerWebClientRaw
webClient = ControllerWebClientRaw(url, username, password)
response = webClient.Request('HEAD', '/')
serverVersion = response.headers['Server'].split()[0]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from mujincontrollerclient import uriutils
from mujinwebstackclient import uriutils


@pytest.mark.parametrize('uri, expected', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
import requests_mock

from python.mujincontrollerclient.webstackclient import WebstackClient
from python.mujinwebstackclient.webstackclient import WebstackClient


@pytest.mark.parametrize('url, username, password', [
Expand All @@ -15,10 +15,10 @@
def test_PingAndLogin(url, username, password):
with requests_mock.Mocker() as mock:
mock.head('%s/u/%s/' % (url, username))
controllerclient = WebstackClient(url, username, password)
controllerclient.Ping()
controllerclient.Login()
assert controllerclient.IsLoggedIn()
webclient = WebstackClient(url, username, password)
webclient.Ping()
webclient.Login()
assert webclient.IsLoggedIn()


def test_RestartController():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def GetMonotonicTime():

try:
import mujincommon.i18n
ugettext, ungettext = mujincommon.i18n.GetDomain('mujincontrollerclientpy').GetTranslationFunctions()
ugettext, ungettext = mujincommon.i18n.GetDomain('mujinwebstackclientpy').GetTranslationFunctions()
except ImportError:
def ugettext(message):
return message
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# DO NOT EDIT, THIS FILE WAS AUTO-GENERATED
# GENERATED BY: mujin_controllerclientpy_generategraphclient.py
# GENERATED BY: mujin_webstackclientpy_generategraphclient.py
# GENERATED AGAINST: mujinwebstack/2.2.2.cc625fcf41b1fec2339b787f8b3adcd3af9f16c5-dirty
#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from . import _
from . import json
from . import APIServerError, ControllerClientError, ControllerGraphClientException
from . import APIServerError, WebstackClientError, ControllerGraphClientException

import logging
log = logging.getLogger(__name__)
Expand Down Expand Up @@ -98,7 +98,7 @@ def SetAuthor(self, author=None):

def Request(self, method, path, timeout=5, headers=None, **kwargs):
if timeout < 1e-6:
raise ControllerClientError(_('Timeout value (%s sec) is too small') % timeout)
raise WebstackClientError(_('Timeout value (%s sec) is too small') % timeout)

url = self._baseurl + path

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.17.0'
__version__ = '0.1.0'

# Do not forget to update CHANGELOG.md
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
from distutils.dist import Distribution

version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
exec(open('python/mujinwebstackclient/version.py').read(), version)

setup(
distclass=Distribution,
name='mujincontrollerclient',
name='mujinwebstackclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
packages=['mujinwebstackclient'],
package_dir={'mujinwebstackclient': 'python/mujinwebstackclient'},
data_files=[
# using scripts= will cause the first line of the script being modified for python2 or python3
# put the scripts in data_files will copy them as-is
('bin', [
'bin/mujin_controllerclientpy_applyconfig.py',
'bin/mujin_controllerclientpy_runshell.py',
'bin/mujin_controllerclientpy_downloaddata.py',
'bin/mujin_webstackclientpy_applyconfig.py',
'bin/mujin_webstackclientpy_runshell.py',
'bin/mujin_webstackclientpy_downloaddata.py',
]),
],
locale_dir='locale',
Expand Down

0 comments on commit bb5fee5

Please sign in to comment.