Skip to content

Commit

Permalink
manipulation.py new version
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcToussaint committed Oct 15, 2024
1 parent c8341bf commit 0c034e0
Show file tree
Hide file tree
Showing 13 changed files with 507 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:
submodules: 'recursive'
- uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.11'
- name: install ubuntu dependencies
run: |
sudo apt-get install pandoc freeglut3 libglew-dev
sudo apt install pandoc liblapack3 libglut3.12 libglu1-mesa libfreetype6 fonts-ubuntu
cd /usr/lib/x86_64-linux-gnu/ && sudo ln -s libglut.so.3.12 libglut.so.3
- name: install python dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser nbsphinx robotic numpy
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ Lab](https://argmin.lis.tu-berlin.de/)) operate our robots.

## Installation via pip (simulation only, no real Franka & realsense support)

* The pip package was compiled for python3.6 .. 3.11, and most of the dependencies statically linked. A few are still loaded dynamically, which requires installing on Ubuntu:
* The pip package was compiled for python3.8 .. 3.12, and most of the dependencies statically linked. A few are still loaded dynamically, which requires installing on Ubuntu:
```
sudo apt install liblapack3 freeglut3 libglew-dev python3 python3-pip
sudo apt install liblapack3 freeglut3 libglu1-mesa libfreetype6 fonts-ubuntu python3 python3-pip
#latest Ubuntu: libglut3.12 and 'cd /usr/lib/x86_64-linux-gnu/ && sudo ln -s libglut.so.3.12 libglut.so.3'
```
* pip-install robotic
```
pip install robotic
pip install robotic numpy
```
* Tests:
```
Expand Down
2 changes: 1 addition & 1 deletion _build_utils/CMakeLists-ubuntu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ install(
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PY_SITE}/robotic)

install(
FILES robotic/__init__.py robotic/version.py robotic/render.py robotic/nlp.py robotic/_robotic.pyi
FILES robotic/__init__.py robotic/version.py robotic/render.py robotic/nlp.py robotic/manipulation.py robotic/_robotic.pyi
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PY_SITE}/robotic)

install(
Expand Down
5 changes: 3 additions & 2 deletions _build_utils/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ RUN ./install.sh -gc physx
#RUN ./install.sh -g librealsense
#RUN ./install.sh -g libfranka

RUN python3.6 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
RUN python3.7 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
#RUN python3.6 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
#RUN python3.7 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
RUN python3.8 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
RUN python3.9 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
RUN python3.10 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
RUN python3.11 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy
RUN python3.12 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy

##########################################################

Expand Down
2 changes: 1 addition & 1 deletion _build_utils/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mv robotic/include/src robotic/include/rai
export PYTHONPATH=.

### build each version
for ver in 10 11 7 8 9; do
for ver in 10 11 12 8 9; do
echo -e "\n\n======== compiling (python version " $ver ") ========"
cmake -B build_wheel -DPY_VERSION=3.$ver .
make -j8 -C build_wheel rai _robotic meshTool --quiet
Expand Down
2 changes: 1 addition & 1 deletion rai-docs
2 changes: 1 addition & 1 deletion rai-tutorials
21 changes: 18 additions & 3 deletions robotic/_robotic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ class Frame:
...
def getRotationMatrix(self) -> arr:
...
def getShapeType(self) -> ST:
...
def getSize(self) -> arr:
...
def getTransform(self) -> arr:
Expand Down Expand Up @@ -708,6 +710,8 @@ class JT:
"""
Members:
none
hingeX
hingeY
Expand Down Expand Up @@ -745,12 +749,13 @@ class JT:
tau
"""
XBall: typing.ClassVar[JT] # value = <JT.XBall: 15>
__members__: typing.ClassVar[dict[str, JT]] # value = {'hingeX': <JT.hingeX: 1>, 'hingeY': <JT.hingeY: 2>, 'hingeZ': <JT.hingeZ: 3>, 'transX': <JT.transX: 4>, 'transY': <JT.transY: 5>, 'transZ': <JT.transZ: 6>, 'transXY': <JT.transXY: 7>, 'trans3': <JT.trans3: 8>, 'transXYPhi': <JT.transXYPhi: 9>, 'transYPhi': <JT.transYPhi: 10>, 'universal': <JT.universal: 11>, 'rigid': <JT.rigid: 12>, 'quatBall': <JT.quatBall: 13>, 'phiTransXY': <JT.phiTransXY: 14>, 'XBall': <JT.XBall: 15>, 'free': <JT.free: 16>, 'generic': <JT.generic: 17>, 'tau': <JT.tau: 18>}
__members__: typing.ClassVar[dict[str, JT]] # value = {'none': <JT.none: 0>, 'hingeX': <JT.hingeX: 1>, 'hingeY': <JT.hingeY: 2>, 'hingeZ': <JT.hingeZ: 3>, 'transX': <JT.transX: 4>, 'transY': <JT.transY: 5>, 'transZ': <JT.transZ: 6>, 'transXY': <JT.transXY: 7>, 'trans3': <JT.trans3: 8>, 'transXYPhi': <JT.transXYPhi: 9>, 'transYPhi': <JT.transYPhi: 10>, 'universal': <JT.universal: 11>, 'rigid': <JT.rigid: 12>, 'quatBall': <JT.quatBall: 13>, 'phiTransXY': <JT.phiTransXY: 14>, 'XBall': <JT.XBall: 15>, 'free': <JT.free: 16>, 'generic': <JT.generic: 17>, 'tau': <JT.tau: 18>}
free: typing.ClassVar[JT] # value = <JT.free: 16>
generic: typing.ClassVar[JT] # value = <JT.generic: 17>
hingeX: typing.ClassVar[JT] # value = <JT.hingeX: 1>
hingeY: typing.ClassVar[JT] # value = <JT.hingeY: 2>
hingeZ: typing.ClassVar[JT] # value = <JT.hingeZ: 3>
none: typing.ClassVar[JT] # value = <JT.none: 0>
phiTransXY: typing.ClassVar[JT] # value = <JT.phiTransXY: 14>
quatBall: typing.ClassVar[JT] # value = <JT.quatBall: 13>
rigid: typing.ClassVar[JT] # value = <JT.rigid: 12>
Expand Down Expand Up @@ -828,20 +833,26 @@ class KOMO:
"""
def addQuaternionNorms(self, times: arr = ..., scale: float = 3.0, hard: bool = True) -> None:
...
def addStableFrame(self, name: str, parent: str, jointType: JT, stable: bool, initFrame: str = 0) -> Frame:
def addRigidSwitch(self, times: float, frames: StringA, noJumpStart: bool = True) -> None:
...
def addStableFrame(self, name: str, parent: str, jointType: JT, stable: bool, initFrame: Frame = None) -> Frame:
"""
complicated...
"""
def addTimeOptimization(self) -> None:
...
def clearObjectives(self) -> None:
...
def getConfig(self) -> Config:
...
def getFeatureNames(self) -> StringA:
"""
(This is to be passed to the NLP_Solver when needed.) returns a long list of features (per time slice!)
"""
def getForceInteractions(self) -> list:
...
def getFrame(self, frameName: str, phaseTime: float) -> Frame:
...
def getFrameState(self, arg0: int) -> arr:
...
def getPath(self) -> arr:
Expand Down Expand Up @@ -1058,7 +1069,7 @@ class NLP_Solver:
"""
returns steps-times-n array with queries points in each row
"""
def setOptions(self, verbose: int = 1, stopTolerance: float = 0.01, stopFTolerance: float = -1.0, stopGTolerance: float = -1.0, stopEvals: int = 1000, maxStep: float = 0.2, damping: float = 1.0, stepInc: float = 1.5, stepDec: float = 0.5, wolfe: float = 0.01, muInit: float = 1.0, muInc: float = 5.0, muMax: float = 10000.0, muLBInit: float = 0.1, muLBDec: float = 0.2, maxLambda: float = -1.0) -> NLP_Solver:
def setOptions(self, verbose: int = 1, stopTolerance: float = 0.01, stopFTolerance: float = -1.0, stopGTolerance: float = -1.0, stopEvals: int = 1000, stopInners: int = 1000, stopOuters: int = 1000, maxStep: float = 0.2, damping: float = 1.0, stepInc: float = 1.5, stepDec: float = 0.5, wolfe: float = 0.01, muInit: float = 1.0, muInc: float = 5.0, muMax: float = 10000.0, muLBInit: float = 0.1, muLBDec: float = 0.2, maxLambda: float = -1.0) -> NLP_Solver:
"""
set solver options
"""
Expand Down Expand Up @@ -1170,6 +1181,10 @@ class NLP_SolverOptions:
...
def set_stopGTolerance(self, arg0: float) -> NLP_SolverOptions:
...
def set_stopInners(self, arg0: int) -> NLP_SolverOptions:
...
def set_stopOuters(self, arg0: int) -> NLP_SolverOptions:
...
def set_stopTolerance(self, arg0: float) -> NLP_SolverOptions:
...
def set_verbose(self, arg0: int) -> NLP_SolverOptions:
Expand Down
Loading

0 comments on commit 0c034e0

Please sign in to comment.