Skip to content

Commit e21eb32

Browse files
authored
Merge pull request AtsushiSakai#92 from jwdinius/conda_env
add environment.yml to setup conda environment
2 parents c78aa2d + 76a46ac commit e21eb32

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

PathPlanning/Eta3SplinePath/eta3_spline_path.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import numpy as np
1515
import matplotlib.pyplot as plt
16+
from scipy.integrate import quad
1617

1718
# NOTE: *_pose is a 3-array: 0 - x coord, 1 - y coord, 2 - orientation angle \theta
1819

@@ -151,6 +152,10 @@ def __init__(self, start_pose, end_pose, eta=None, kappa=None):
151152
+ (10. * eta[1] - 2. * eta[3] + 1. / 6 * eta[5]) * sb \
152153
- (2. * eta[1]**2 * kappa[2] - 1. / 6 * eta[1]**3 *
153154
kappa[3] - 1. / 2 * eta[1] * eta[3] * kappa[2]) * cb
155+
156+
s_dot = lambda u : np.linalg.norm(self.coeffs[:, 1:].dot(np.array([1, 2.*u, 3.*u**2, 4.*u**3, 5.*u**4, 6.*u**5, 7.*u**6])))
157+
self.segment_length = quad(lambda u: s_dot(u), 0, 1)[0]
158+
154159
"""
155160
eta3_path_segment::calc_point
156161
@@ -159,7 +164,6 @@ def __init__(self, start_pose, end_pose, eta=None, kappa=None):
159164
returns
160165
(x,y) of point along the segment
161166
"""
162-
163167
def calc_point(self, u):
164168
assert(u >= 0 and u <= 1)
165169
return self.coeffs.dot(np.array([1, u, u**2, u**3, u**4, u**5, u**6, u**7]))

environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: python_robotics
2+
dependencies:
3+
- python==3.6
4+
- matplotlib
5+
- scipy
6+
- numpy
7+
- pandas
8+
- pip:
9+
- cvxpy

0 commit comments

Comments
 (0)