Skip to content

gary13139948/pyivp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyivp (IvP for Python)

This repo is to set up the pybind11 for the IvP libraries in MOOS-IvP

In particular we make a copy of parts of the ivp source files:

  • pyivp/src/lib_geometry
  • pyivp/src/lib_mbutils
  • pyivp/src_unit_tests/

We intented to use pybind11 to create

  • ivp/pybind11/

For the use of well-established functions.

Installation

pip install pyivp -U

Note : This may not work for some versions of python on some operating systems.

Environment

We will use Docker to manage the dependencies, which should be minimal. Docker mounts the volumn ~/pyivp between the host and container.

To get started:

git clone --recursive [email protected]:ARG-NCTU/pyivp.git
cd ~/pyivp
source docker_run.sh

Or

source docker_join.sh

Note that we should compile and run in Docker. We use a root account in order to access driver and other hardware. Therefore, everything edited in container will belong to root.

We suggest to edit code in host.

cpplabs examples

This is an example based on 2.680 CPP Labs (lab05 and lab06)

Compile and Install Library

In Docker,

cd ~/pyivp/examples/cpplabs
make

Note that

  • We will compile the lib_geometry and install it to /usr/local/lib, which is inside container. (so no worries to mess up your own system)
  • We also run a python code to test the installed library in python (pytest/test_plus.py)

image

nbdev

The pyivp repo has been configured to a nbdev repo. Quote from nbdev

nbdev is a library that allows you to develop a python library in Jupyter Notebooks, putting all your code, tests and documentation in one place. That is: you now have a true literate programming environment, as envisioned by Donald Knuth back in 1983!

We will use nbdev to develop "high-level" API based on IvP and test all ivp libraries in Jupyter Notebook.

After you compile and install the library.

source Docker/colab_jupyter.sh

Open a browser, and enter the following

http://127.0.0.1:8888/tree

Now you could open and enjoy IvP in Jupyter Notebooks.

nbdev_clean_nbs

Remember to run this command to clear notebooks

XYPatternBlock

image

XYHexgon

image

Class Diagram

The class diagram is drawn by DotUML

Parts of the diagram is shown below:

image

pybind11 example

source docker_run.sh
cd example
make
python3 pytest/test.py

You should see:

Made a bike called: Yamaha
Zoom Zoom on road: mullholland

without import errors or assert fails

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 85.8%
  • Jupyter Notebook 11.3%
  • CMake 1.8%
  • Shell 0.5%
  • C 0.4%
  • Python 0.1%
  • Other 0.1%