Skip to content

Instantly share code, notes, and snippets.

@haudren
haudren / test_lazy_prm.cpp
Created February 24, 2021 07:22
Testing the LazyPRM implementation against multiple goals
#include <ompl/base/goals/GoalStates.h>
#include <ompl/base/spaces/RealVectorStateSpace.h>
#include <ompl/geometric/planners/prm/LazyPRMstar.h>
#include <ompl/geometric/planners/prm/PRMstar.h>
#include <iostream>
namespace ob = ompl::base;
namespace og = ompl::geometric;
int main(int argc, char *argv[]) {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from scipy.spatial import ConvexHull
points = np.array([[0, 0],
[0, 1],
[1, 0],
[1, 1]])
import scipy.spatial as spatial
import numpy as np
A = np.array(([[-1, 0, 0],
[0, -1, 0],
[1, 0, -1],
[0, 1, -1]]))
hull = spatial.ConvexHull(A, qhull_options='H0.5,0.5')
@haudren
haudren / log.txt
Created July 28, 2016 04:53
Crash logs : opening the context menu and setting fast firward will crash.
launch:INFO ------------------------------------------------
launch:INFO OpenShot (version 2.0.7)
launch:INFO ------------------------------------------------
app:INFO openshot-qt version: 2.0.7
app:INFO libopenshot version: 0.1.1
app:INFO platform: Linux-3.16.0-31-generic-x86_64-with-Ubuntu-14.04-trusty
app:INFO processor: x86_64
app:INFO machine: x86_64
app:INFO python version: 3.4.3
app:INFO qt5 version: 5.2.1
1
486
0.724489795918 0.689285525461
0.714285714286 0.671611537629
0.69387755102 0.671611537629
0.683673469388 0.653937549796
0.663265306122 0.653937549796
0.65306122449 0.671611537629
0.632653061224 0.671611537629
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from copy import copy
"""
This script draws the Gosper island, a hexagon-based fractal that tiles the plane.
https://en.wikipedia.org/wiki/Gosper_curve#Properties
import cdd
import numpy as np
A = np.array([[1, 0, 1], [1, 1, 0], [1, 1, 1], [1, 0, 0]]) # Simple square
mat = cdd.Matrix(A)
mat.rep_type = cdd.RepType.GENERATOR
poly = cdd.Polyhedron(mat)
poly.rep_type = cdd.RepType.INEQUALITY
from scipy.signal import decimate
import numpy as np
A = np.array([1.]*200)
print decimate(A, 20)
@haudren
haudren / runge_kutta.py
Created September 3, 2014 01:57
RK4 vs Euler
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import math
def f(t, y):
return math.cos(t)
def ref(time):
return math.sin(time)