Git Product home page Git Product logo

pyivp's Introduction

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.

Docker and Repos

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

We will also use movinngpandashttps://github.com/ARG-NCTU/movingpandas

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.

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

Geometry Utilities

The documentation shows how to use functions in ivp.

XYPatternBlock

image

import pyivp
pattern = pyivp.string2SegList("format=lawnmower, x=0, y=0, height=60, width=180, lane_width=15, rows=north-south, startx=20, starty=-300, degs=45")
  • must use format=lawnmower for pattern block.
  • there is 4 entry, and (startx, starty) will decide where is the closest entry.

XYPolygon

image

import pyivp
waypointPloy = pyivp.string2ploy("example")
  • example => x=0, y=0, format=radial, radius=10, pts=4
  • you can pass args such as : must have -> [x, y, z, radius, pts], snap, label, active, msg
  • snap means the size of the grid, and the ploy's vertex will stick on the grid.
waypointSeg = waypointPloy.exportSegList(x0, y0)
  • Build an XYSegList from the poly. Make the first point closest to the x0, y0.
waypointSeg.get_spec_pts()
  • this will print the vertexs of ploy (clockwise!!) such as 'pts={-1,1:-1,-1:1,-1:1,1}'
  • you can use waypointSeg.reverse() or waypointPloy.reverse() for counterclockwise
  • you can use waypointSeg.is_clockwise() to check.
waypointSeg.get_vx() and waypointSeg.get_vy() 
  • with for loop to get every vertex's information.

Class Diagram

The class diagram is drawn by DotUML

Parts of the diagram is shown below:

image

pyivp's People

Contributors

hchengwang avatar cihuang123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.