Skip to content

Commit bef26f2

Browse files
committed
Fixed minor cut and paste bugs.
1 parent d0324c5 commit bef26f2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/prpy/tsr/tsr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ def __init__(self, T0_w=None, Tw_e=None, Bw=None,
7777
# We will now create a continuous version of the bound to maintain:
7878
# 1. Bw[i,1] > Bw[i,0] which is necessary for LBFGS-B
7979
# 2. signed rotations, necessary for expressiveness
80-
Bw_interval = Bw[3:6, 1] - Bw[3:6, 0]
80+
Bw_cont = numpy.copy(self.Bw)
81+
82+
Bw_interval = Bw_cont[3:6, 1] - Bw_cont[3:6, 0]
8183
Bw_interval = numpy.minimum(Bw_interval, 2*pi)
8284

83-
Bw_cont = numpy.copy(self.Bw)
8485
Bw_cont[3:6, 0] = wrap_to_interval(Bw_cont[3:6, 0])
8586
Bw_cont[3:6, 1] = Bw_cont[3:6, 0] + Bw_interval
8687

tests/tsr/test_tsr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy
22
from numpy import pi
3-
from prpy.tsr import Tsr
3+
from prpy.tsr import TSR
44
from unittest import TestCase
55

66

@@ -14,7 +14,7 @@ def test_sample_xyzrpy(self):
1414
[0., 0.], # roll
1515
[pi, pi], # pitch
1616
[-pi, -pi]] # yaw
17-
tsr = Tsr(Bw=Bw)
17+
tsr = TSR(Bw=Bw)
1818
s = tsr.sample_xyzrpy()
1919
self.assertTrue(numpy.all(s >= Bw[:, 0]))
2020
self.assertTrue(numpy.all(s <= Bw[:, 1]))
@@ -26,7 +26,7 @@ def test_sample_xyzrpy(self):
2626
[pi, 3.*pi], # roll
2727
[pi/2., 3*pi/2.], # pitch
2828
[-3*pi/2., -pi/2.]] # yaw
29-
tsr = Tsr(Bw=Bw)
29+
tsr = TSR(Bw=Bw)
3030
s = tsr.sample_xyzrpy()
3131
self.assertTrue(numpy.all(s >= Bw[:, 0]))
3232
self.assertTrue(numpy.all(s <= Bw[:, 1]))

0 commit comments

Comments
 (0)