Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanElsner committed Jul 9, 2024
1 parent 9580bda commit 69de031
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]

env:
VERSION: 0.7.6
VERSION: 0.8.0

permissions: write-all

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = 'panda-py'
copyright = '2023, Jean Elsner'
author = 'Jean Elsner'
release = '0.7.6'
release = '0.8.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "panda-python"
version = "0.7.6"
version = "0.8.0"
description = "Python bindings for the Panda robot"
requires-python = ">=3.7"
dependencies = ["websockets>=11.0", "requests", "numpy"]
Expand Down
2 changes: 1 addition & 1 deletion src/panda_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'fk', 'ik', 'ik_full', 'Desk', 'TOKEN_PATH'
]

__version__ = '0.7.6'
__version__ = '0.8.0'

_logger = logging.getLogger('desk')

Expand Down
171 changes: 107 additions & 64 deletions src/panda_py/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,35 @@ that allows you to program and control the robot in real-time.
"""
from __future__ import annotations

import base64 as base64
import configparser as configparser
import dataclasses as dataclasses
import hashlib as hashlib
import json as json_module
import logging as logging
import os as os
from panda_py._core import Panda
from panda_py._core import PandaContext
from panda_py._core import fk
from panda_py._core import ik
from panda_py._core import ik_full
import requests as requests
import ssl as ssl
import threading as threading
import typing as typing
from urllib import parse

import requests as requests
import urllib3 as urllib3
from websockets.sync.client import connect
from . import _core
from . import libfranka
__all__: list = ['Panda', 'PandaContext', 'constants', 'controllers', 'libfranka', 'motion', 'fk', 'ik', 'ik_full', 'Desk', 'TOKEN_PATH']

from panda_py._core import Panda, PandaContext, fk, ik, ik_full

from . import _core, libfranka

__all__: list = [
'Panda', 'PandaContext', 'constants', 'controllers', 'libfranka', 'motion',
'fk', 'ik', 'ik_full', 'Desk', 'TOKEN_PATH'
]


class Desk:
"""
"""
Connects to the control unit running the web-based Desk interface
to manage the robot. Use this class to interact with the Desk
Expand All @@ -53,49 +58,69 @@ class Desk:
robot's Pilot interface.
"""
@staticmethod
def encode_password(username: str, password: str) -> bytes:
"""

@staticmethod
def encode_password(username: str, password: str) -> bytes:
"""
Encodes the password into the form needed to log into the Desk interface.
"""
def __init__(self, hostname: str, username: str, password: str, platform: str = 'panda') -> None:
...
def _get_active_token(self) -> Token:
...
def _listen(self, cb, timeout):
...
def _load_token(self) -> Token:
...
def _request(self, method: typing.Literal['post', 'get', 'delete'], url: str, json: typing.Dict[str, str] = None, headers: typing.Dict[str, str] = None, files: typing.Dict[str, str] = None) -> requests.models.Response:
...
def _save_token(self, token: Token) -> None:
...
def activate_fci(self) -> None:
"""

def __init__(self,
hostname: str,
username: str,
password: str,
platform: str = 'panda') -> None:
...

def _get_active_token(self) -> Token:
...

def _listen(self, cb, timeout):
...

def _load_token(self) -> Token:
...

def _request(self,
method: typing.Literal['post', 'get', 'delete'],
url: str,
json: typing.Dict[str, str] = None,
headers: typing.Dict[str, str] = None,
files: typing.Dict[str, str] = None) -> requests.models.Response:
...

def _save_token(self, token: Token) -> None:
...

def activate_fci(self) -> None:
"""
Activates the Franka Research Interface (FCI). Note that the
brakes must be unlocked first. For older Desk versions, this
function does nothing.
"""
def deactivate_fci(self) -> None:
"""

def deactivate_fci(self) -> None:
"""
Deactivates the Franka Research Interface (FCI). For older
Desk versions, this function does nothing.
"""
def has_control(self) -> bool:
"""

def has_control(self) -> bool:
"""
Returns:
bool: True if this instance is in control of the Desk.
"""
def listen(self, cb: typing.Callable[[typing.Dict], NoneType]) -> None:
"""

def listen(self, cb: typing.Callable[[typing.Dict], NoneType]) -> None:
"""
Starts a thread listening to Pilot button events. All the Pilot buttons,
except for the `Pilot Mode` button can be captured. Make sure Pilot Mode is
Expand All @@ -112,49 +137,56 @@ class Desk:
and `up`.
"""
def lock(self, force: bool = True) -> None:
"""

def lock(self, force: bool = True) -> None:
"""
Locks the brakes. API call blocks until the brakes are locked.
"""
def login(self) -> None:
"""

def login(self) -> None:
"""
Uses the object's instance parameters to log into the Desk.
The :py:class`Desk` class's constructor will try to connect
and login automatically.
"""
def logout(self) -> None:
"""

def logout(self) -> None:
"""
Logs the current user out of the Desk. API calls will no longer
be possible.
"""
def reboot(self) -> None:
"""

def reboot(self) -> None:
"""
Reboots the robot hardware (this will close open connections).
"""
def release_control(self) -> None:
"""

def release_control(self) -> None:
"""
Explicitly relinquish control of the Desk. This will allow
other users to take control or transfer control to the next
user if there is an active queue of control requests.
"""
def stop_listen(self) -> None:
"""

def stop_listen(self) -> None:
"""
Stop listener thread (cf. :py:func:`panda_py.Desk.listen`).
"""
def take_control(self, force: bool = False) -> bool:
"""

def take_control(self, force: bool = False) -> bool:
"""
Takes control of the Desk, generating a new control token and saving it.
If `force` is set to True, control can be taken forcefully even if another
Expand All @@ -165,31 +197,42 @@ class Desk:
For legacy versions of the Desk, this function does nothing.
"""
def unlock(self, force: bool = True) -> None:
"""

def unlock(self, force: bool = True) -> None:
"""
Unlocks the brakes. API call blocks until the brakes are unlocked.
"""


class Token:
"""
"""
Represents a Desk token owned by a user.
"""
__dataclass_fields__: typing.ClassVar[dict] # value = {'id': Field(name='id',type=<class 'str'>,default='',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'owned_by': Field(name='owned_by',type=<class 'str'>,default='',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'token': Field(name='token',type=<class 'str'>,default='',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__: typing.ClassVar[dataclasses._DataclassParams] # value = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__hash__: typing.ClassVar[None] = None
__match_args__: typing.ClassVar[tuple] = ('id', 'owned_by', 'token')
id: typing.ClassVar[str] = ''
owned_by: typing.ClassVar[str] = ''
token: typing.ClassVar[str] = ''
def __eq__(self, other):
...
def __init__(self, id: str = '', owned_by: str = '', token: str = '') -> None:
...
def __repr__(self):
...
__dataclass_fields__: typing.ClassVar[
dict] # value = {'id': Field(name='id',type=<class 'str'>,default='',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'owned_by': Field(name='owned_by',type=<class 'str'>,default='',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'token': Field(name='token',type=<class 'str'>,default='',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__: typing.ClassVar[
dataclasses.
_DataclassParams] # value = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__hash__: typing.ClassVar[None] = None
__match_args__: typing.ClassVar[tuple] = ('id', 'owned_by', 'token')
id: typing.ClassVar[str] = ''
owned_by: typing.ClassVar[str] = ''
token: typing.ClassVar[str] = ''

def __eq__(self, other):
...

def __init__(self, id: str = '', owned_by: str = '', token: str = '') -> None:
...

def __repr__(self):
...


TOKEN_PATH: str = '~/.panda_py/token.conf'
__version__: str = '0.7.6'
__version__: str = '0.8.0'
_logger: logging.Logger # value = <Logger desk (INFO)>

0 comments on commit 69de031

Please sign in to comment.