Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jcarpent/eigenpy
  • gsaurel/eigenpy
  • stack-of-tasks/eigenpy
3 results
Show changes
Showing
with 219 additions and 348 deletions
BSD 2-Clause License
Copyright (c) 2014-2019, CNRS
Copyright (c) 2018-2019, INRIA
Copyright (c) 2014-2020, CNRS
Copyright (c) 2018-2025, INRIA
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
EigenPy
EigenPy — Versatile and efficient Python bindings between Numpy and Eigen
======
[![License](https://img.shields.io/badge/License-BSD%202--Clause-green.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![Build Status](https://travis-ci.org/stack-of-tasks/eigenpy.svg?branch=devel)](https://travis-ci.org/stack-of-tasks/eigenpy)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/eigenpy.svg)](https://anaconda.org/conda-forge/eigenpy)[![Conda Version](https://img.shields.io/conda/vn/conda-forge/eigenpy.svg)](https://anaconda.org/conda-forge/eigenpy)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/eigenpy/badges/installer/conda.svg)](https://conda.anaconda.org/conda-forge)
<p align="center">
<a href="https://opensource.org/licenses/BSD-2-Clause"><img src="https://img.shields.io/badge/License-BSD%202--Clause-green.svg" alt="License"/></a>
<a href="https://github.com/stack-of-tasks/eigenpy/workflows/linux.yml"><img alt="Build Status" src="https://github.com/stack-of-tasks/eigenpy/actions/workflows/linux.yml/badge.svg?branch=devel" /></a>
<a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/dn/conda-forge/eigenpy.svg" alt="Conda Downloads"/></a>
<a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/vn/conda-forge/eigenpy.svg" alt="Conda Version"/></a>
<a href="https://badge.fury.io/py/eigenpy"><img src="https://badge.fury.io/py/eigenpy.svg" alt="PyPI version"></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Linter: ruff"></a>
</p>
**EigenPy** is an open-source framework that allows the binding of the famous [Eigen](http://eigen.tuxfamily.org) C++ library in Python via Boost.Python.
**EigenPy** is an open source framework which allows to bind the famous [Eigen](http://eigen.tuxfamily.org) in Python as NumPy object (as matrix or array).
**EigenPy** also exposes the Geometry module of Eigen for easy code prototyping.
**EigenPy** also supports the basic matrix decomposion routines of Eigen such as the Cholesky decomposition, SVD decomposition, QR decomposition, and etc.
**EigenPy** provides:
## Setup
- full memory sharing between Numpy and Eigen, avoiding memory allocation
- full support Eigen::Ref avoiding memory allocation
- full support of the Eigen::Tensor module
- exposition of the Geometry module of Eigen for easy code prototyping
- standard matrix decomposion routines of Eigen such as the Cholesky decomposition (SVD and QR decompositions [can be added](#contributing))
- full support of SWIG objects
- full support of runtime declaration of Numpy scalar types
- extended API to expose several STL types and some of their Boost equivalents: `optional` types, `std::pair`, maps, variants...
- full support of vectorization between C++ and Python (all the hold objects are properly aligned in memory)
The installation of **EigenPy** on your computer is made easy for Linux/BSD and Mac OS X environments.
## Installation
The installation of **EigenPy** on your computer is made easy for Linux/BSD, Mac OS X, and Windows environments.
### Conda
You simply need this simple line:
```bash
conda install eigenpy -c conda-forge
```
### Ubuntu
You can easily install **EigenPy** from binairies.
You can easily install **EigenPy** from binaries.
#### Add robotpkg apt repository
1. Check your distribution codename in a terminal with the following command:
1. Add robotpkg as source repository to apt:
```
$ lsb_release -c
Codename: xenial
sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
```
2. Add robotpkg as source repository to apt:
```
sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub xenial robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
```
3. Register the authentication certificate of robotpkg:
2. Register the authentication certificate of robotpkg:
```
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
```
4. You need to run at least once apt update to fetch the package descriptions:
```
3. You need to run at least one apt update to fetch the package descriptions:
```bash
sudo apt-get update
```
#### Install EigenPy
5. The installation of **EigenPy** and its dependencies is made through the line:
For Python 2.7
```
sudo apt install robotpkg-py27-eigenpy
```
or for Python 3.{5,6,7}
```
4. The installation of **EigenPy** and its dependencies is made through the line:
```bash
sudo apt install robotpkg-py35-eigenpy
```
where 35 should be replaced by the python 3 you want to work this (e.g. `robotpkg-py36-eigenpy` to work with Python 3.6).
where 35 should be replaced by the Python 3, you want to work this (e.g., `robotpkg-py36-eigenpy` to work with Python 3.6).
### Mac OS X
The installation of **EigenPy** on Mac OS X is made via [HomeBrew](https://brew.sh/).
You just need to register the tap of the sofware repository.
The installation of **EigenPy** on Mac OS X is made via [HomeBrew](https://brew.sh/).
You just need to register the tap of the software repository.
```
brew tap gepetto/homebrew-gepetto
```
and then install **EigenPy** with:
and then install **EigenPy** for Python 3.x with:
```
brew install eigenpy
```
for Python 2.7 or:
```
brew install eigenpy-python3
```
for Python 3 support.
## Build
Build instruction can be found [here](./development/build.md)
## Credits
The following people have been involved in the development of **EigenPy**:
- [Justin Carpentier](https://jcarpent.github.io) (INRIA): main developer and manager of the project
- [Justin Carpentier](https://jcarpent.github.io) (Inria): main developer and manager of the project
- [Nicolas Mansard](http://projects.laas.fr/gepetto/index.php/Members/NicolasMansard) (LAAS-CNRS): initial project instructor
- [Wolfgang Merkt](http://www.wolfgangmerkt.com/) (University of Edinburgh): ROS integration and support
- [Sean Yen](https://www.linkedin.com/in/seanyentw) (Microsoft): Windows integration
- [Loïc Estève](https://github.com/lesteve) (INRIA): Conda integration
- [Loïc Estève](https://github.com/lesteve) (Inria): Conda integration
- [Wilson Jallet](https://manifoldfr.github.io/) (Inria/LAAS-CNRS): core developer
- [Joris Vaillant](https://github.com/jorisv) (Inria): core developer and manager of the project
If you have taken part to the development of **EigenPy**, feel free to add your name and contribution here.
If you have taken part in the development of **EigenPy**, feel free to add your name and contribution here.
## Acknowledgments
......
from __future__ import print_function
import time # noqa
import timeit # noqa
import eigenpy
import numpy as np
from IPython import get_ipython
import time
import timeit
import eigenpy
from IPython import get_ipython
ipython = get_ipython()
quat = eigenpy.Quaternion()
a = [0., 0., 0.]
a = [0.0, 0.0, 0.0]
cmd1 = "timeit np.array(a)"
print("\n")
......@@ -23,23 +22,6 @@ print(cmd2)
ipython.magic(cmd2)
print("\n")
eigenpy.switchToNumpyMatrix()
print("----------------------")
print("switch to numpy matrix")
print("----------------------")
print("\n")
cmd3 = "timeit quat.coeffs()"
print(cmd3)
ipython.magic(cmd3)
print("\n")
eigenpy.switchToNumpyArray()
print("---------------------")
print("switch to numpy array")
print("---------------------")
print("\n")
cmd4 = "timeit quat.coeffs()"
print(cmd4)
ipython.magic(cmd4)
......@@ -50,7 +32,7 @@ print(cmd5)
ipython.magic(cmd5)
print("\n")
a_matrix = np.matrix(a);
a_matrix = np.matrix(a)
cmd6 = "timeit np.asarray(a_matrix)"
print(cmd6)
ipython.magic(cmd6)
......
Subproject commit 46dc4a57521bde14ea75c959b6b4f887af50c65d
Subproject commit 2ede15d1cb9d66401ba96788444ad64c44ffccd8
{
"hooks": [
"share/eigenpy/hook/ament_prefix_path.dsv",
"share/eigenpy/hook/python_path.dsv"
]
}
\ No newline at end of file
# Build and install from source with Pixi
To build **EigenPy** from source the easiest way is to use [Pixi](https://pixi.sh/latest/#installation).
[Pixi](https://pixi.sh/latest/) is a cross-platform package management tool for developers that
will install all required dependencies in `.pixi` directory.
It's used by our CI agent so you have the guarantee to get the right dependencies.
Run the following command to install dependencies, configure, build and test the project:
```bash
pixi run test
```
The project will be built in the `build` directory.
You can run `pixi shell` and build the project with `cmake` and `ninja` manually.
# Contributing
Standard matrix decomposion routines of Eigen such as the SVD and QR decompositions
can be readily added to **EigenPy** following the example of the Cholesky decomposition
that is already implemented.
Feel free to open a PR if you wrap them for your use case.
# Release with Pixi
To create a release with Pixi run the following commands on the **devel** branch:
```bash
EIGENPY_VERSION=X.Y.Z pixi run release_new_version
git push origin
git push origin vX.Y.Z
git push origin devel:master
```
Where `X.Y.Z` is the new version.
Be careful to follow the [Semantic Versioning](https://semver.org/spec/v2.0.0.html) rules.
You will find the following assets:
- `./build_new_version/eigenpy-X.Y.Z.tar.gz`
- `./build_new_version/eigenpy-X.Y.Z.tar.gz.sig`
Then, create a new release on [GitHub](https://github.com/stack-of-tasks/eigenpy/releases/new) with:
* Tag: vX.Y.Z
* Title: EigenPy X.Y.Z
* Body:
```
## What's Changed
CHANGELOG CONTENT
**Full Changelog**: https://github.com/stack-of-tasks/eigenpy/compare/vXX.YY.ZZ...vX.Y.Z
```
Where `XX.YY.ZZ` is the last release version.
Then upload `eigenpy-X.Y.Z.tar.gz` and `eigenpy-X.Y.Z.tar.gz.sig` and publish the release.
:: Setup ccache
set CMAKE_CXX_COMPILER_LAUNCHER=ccache
:: Create compile_commands.json for language server
set CMAKE_EXPORT_COMPILE_COMMANDS=1
:: Activate color output with Ninja
set CMAKE_COLOR_DIAGNOSTICS=1
:: Set default build value only if not previously set
if not defined EIGENPY_BUILD_TYPE (set EIGENPY_BUILD_TYPE=Release)
if not defined EIGENPY_PYTHON_STUBS (set EIGENPY_PYTHON_STUBS=ON)
if not defined EIGENPY_CHOLMOD_SUPPORT (set EIGENPY_CHOLMOD_SUPPORT=OFF)
if not defined EIGENPY_ACCELERATE_SUPPORT (set EIGENPY_ACCELERATE_SUPPORT=OFF)
#! /bin/bash
# Activation script
# Remove flags setup from cxx-compiler
unset CFLAGS
unset CPPFLAGS
unset CXXFLAGS
unset DEBUG_CFLAGS
unset DEBUG_CPPFLAGS
unset DEBUG_CXXFLAGS
unset LDFLAGS
if [[ $host_alias == *"apple"* ]];
then
# On OSX setting the rpath and -L it's important to use the conda libc++ instead of the system one.
# If conda-forge use install_name_tool to package some libs, -headerpad_max_install_names is then mandatory
export LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
elif [[ $host_alias == *"linux"* ]];
then
# On GNU/Linux, I don't know if these flags are mandatory with g++ but
# it allow to use clang++ as compiler
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
fi
# Setup ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
# Create compile_commands.json for language server
export CMAKE_EXPORT_COMPILE_COMMANDS=1
# Activate color output with Ninja
export CMAKE_COLOR_DIAGNOSTICS=1
# Set default build value only if not previously set
export EIGENPY_BUILD_TYPE=${EIGENPY_BUILD_TYPE:=Release}
export EIGENPY_PYTHON_STUBS=${EIGENPY_PYTHON_STUBS:=ON}
export EIGENPY_CHOLMOD_SUPPORT=${EIGENPY_CHOLMOD_SUPPORT:=OFF}
export EIGENPY_ACCELERATE_SUPPORT=${EIGENPY_ACCELERATE_SUPPORT:=OFF}
#! /bin/bash
# Clang activation script
export CC="clang"
export CXX="clang++"
:: Setup clang-cl compiler
set CC=clang-cl
set CXX=clang-cl
INPUT = @CMAKE_SOURCE_DIR@/src \
@CMAKE_SOURCE_DIR@/doc/additionalDoc
IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc/pictures
INPUT = @PROJECT_SOURCE_DIR@/doc \
@PROJECT_SOURCE_DIR@/include \
@PROJECT_SOURCE_DIR@/README.md
FILE_PATTERNS = *.cc *.cpp *.h *.hpp *.hxx
RECURSIVE = YES
TAGFILES = \
FILE_PATTERNS = *.cpp *.h *.hpp *.hxx
EXTRACT_ALL = NO
EXTRACT_ANON_NSPACES = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
FULL_PATH_NAMES = YES
EXCLUDE_SYMBOLS = std, *::internal, internal::*, *::internal::*
INCLUDE_PATH = @PROJECT_SOURCE_DIR@/include
GENERATE_TREEVIEW = YES
VERBATIM_HEADERS = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
SOURCE_BROWSER = YES
ALPHABETICAL_INDEX = YES
USE_MDFILE_AS_MAINPAGE = README.md
BUILTIN_STL_SUPPORT = YES
HAVE_DOT = YES
DOT_IMAGE_FORMAT = SVG
/*
* Copyright 2010,
* François Bleibel,
* Olivier Stasse,
*
* CNRS/AIST
*
* This file is part of sot-dynamic.
* sot-dynamic is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* sot-dynamic is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with sot-dynamic. If not, see <http://www.gnu.org/licenses/>.
*/
/** \mainpage
\section soth_section_introduction Introduction
The soth package is ...
**/
<br><br>
<hr>
<center>
<img src="./pictures/footer.jpg" Height=100>
<br>soth library documentation</br>
</center>
<hr>
</center>
</body>
</head>
<HTML>
<HEAD>
<TITLE>soth library documentation</TITLE>
<LINK HREF="package.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
body {
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
color: #5D5D5D;
}
dl {
border: 1.5px #82b6d7 solid;
width: 97%;
padding: 5px;
color: #330077;
}
code {
color: #3C9A35;
}
td.md {
color: #0066CC;
}
h1 {
padding-top: 50px;
padding: 0px;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-variant: small-caps;
color:#0066CC;
text-align: center;
}
h2,h3,hr {
magin-top: 15px;
padding: 0px;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-variant: small-caps;
color:#0066CC;
}
h4 {
color: #3C9A35;
}
a:link {
font-weight: bold;
text-decoration: none;
color:#0066CC
}
a:hover, a:active {
text-decoration: underline;
color: #3C9A35;
}
a:visited {
font-weight: bold;
color: #3C9A35;
text-decoration: none;
}
DIV.memitem
{
spacing: 10px;
width:100%;
background:#FFFFFF;
font-size:100%;
line-height:normal;
border-width: 1px;
border-style: solid;
border-color: #808080;
-moz-border-radius: 8px 8px 8px 8px;
}
DIV.memproto
{
width:100%;
background:#F0F0F0;
font-size:100%;
line-height:normal;
border-width: 1px;
border-style: solid;
border-color: #808080;
-moz-border-radius: 8px 8px 8px 8px;
}
DIV.memdoc
{
padding: 10px;
width:100%;
font-size:100%;
line-height:normal;
}
DIV.tabs
{
float : left;
width : 100%;
background : url("tab_b.gif") repeat-x bottom;
margin-bottom : 4px;
}
DIV.tabs UL
{
margin : 0px;
padding-left : 10px;
list-style : none;
}
DIV.tabs LI, DIV.tabs FORM
{
display : inline;
margin : 0px;
padding : 0px;
}
DIV.tabs FORM
{
float : right;
}
DIV.tabs A
{
float : left;
background : url("tab_r.gif") no-repeat right top;
border-bottom : 1px solid #84B0C7;
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
DIV.tabs A:hover
{
background-position: 100% -150px;
}
DIV.tabs A:link, DIV.tabs A:visited,
DIV.tabs A:active, DIV.tabs A:hover
{
color: #1A419D;
}
DIV.tabs SPAN
{
float : left;
display : block;
background : url("tab_l.gif") no-repeat left top;
padding : 5px 9px;
white-space : nowrap;
}
DIV.tabs INPUT
{
float : right;
display : inline;
font-size : 1em;
}
DIV.tabs TD
{
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
DIV.tabs SPAN {float : none;}
DIV.tabs A:hover SPAN
{
background-position: 0% -150px;
}
DIV.tabs LI#current A
{
background-position: 100% -150px;
border-width : 0px;
}
DIV.tabs LI#current SPAN
{
background-position: 0% -150px;
padding-bottom : 6px;
}
DIV.nav
{
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
}
DIV.groupHeader
{
padding-top: 30px;
padding-bottom: 20px;
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-variant: small-caps;
font-size: 14pt;
color:#0066CC;
}
.directory p
{
margin: 0px;
white-space: nowrap;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-size: 10pt;
font-weight: normal;
}
.directory h3
{
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
margin: 0px;
margin-top: 1em;
padding-bottom: 20px;
font-size: 12pt;
font-variant: small-caps;
text-align: center;
}
.directory a:visited {
font-weight: bold;
text-decoration: none;
color:#0066CC
}
doc/pictures/HRP2.jpg

23.1 KiB

doc/pictures/footer.jpg

23.1 KiB

Copy in this directory the image you wish to use in the footer of the documentation or edit file sot-core/doc/footer.html and
remove this file.