Skip to content

A Simple and Efficient Sampling-based Algorithm for General Reachability Analysis

License

Notifications You must be signed in to change notification settings

StanfordASL/RandUP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Simple and Efficient Sampling-based Algorithm for General Reachability Analysis


About

Code for our paper about sampling-based reachability analysis (T. Lew, L. Janson, R. Bonalli, M. Pavone, "A Simple and Efficient Sampling-based Algorithm for General Reachability Analysis", available at https://arxiv.org/abs/2112.05745, 2021).

RandUP is an easy-to-implement reachability analysis algorithm. It consists of 1) sampling inputs, 2) propagating them through the reachability map, and 3) taking the epsilon-padded convex hull of the outputs. Sample python code (without epsilon-padding):

import numpy as np
import scipy.spatial
import matplotlib.pyplot as plt

# Define problem
X_min = -np.array([1.,1.])
X_max =  np.array([1.,1.])
def f(x):
  return x

# RandUP
M    = 100
xs   = np.random.uniform(low=X_max, high=X_min, size=(M,2))
ys   = f(xs)
hull = scipy.spatial.ConvexHull(ys)

# Plot
plt.scatter(ys[:,0],ys[:,1], color='b')
for s in hull.simplices:
  plt.plot(ys[s,0], ys[s,1], 'g')

plt.show()

The last convex hull outer-bounding step could be replaced by an outer-bounding ball/rectangle/ellipsoid/... The theoretical convergence and outer-approximation guarantees would follow similarly. For example, if one takes a rectangle that outer-bounds the samples, then one could modify Theorem 1 and prove that the resulting set converges to the smallest rectangle containing the true reachable set.

Setup

This code was tested with Python 3.6.9.

All dependencies (i.e., numpy, scipy, and matplotlib) can be installed by running pip install -r requirements.txt

About

A Simple and Efficient Sampling-based Algorithm for General Reachability Analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages