Skip to content

Commit fe310eb

Browse files
author
Gerd Gruenert
committed
Fix order of second half-clothoid segment
1 parent ecfc15a commit fe310eb

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

traject/plot_smalldelta.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525

2626
tparam = TurnParams(1.0, 1.0)
27-
DELTA = math.pi/8
27+
# DELTA = math.pi/8
28+
DELTA = tparam.delta_min*0.9
2829

2930
turn = Turn(tparam, DELTA)
3031

@@ -37,18 +38,18 @@
3738

3839
# plot whole line
3940
XT = np.linspace(0, turn.len, 128, endpoint=True)
40-
tra = turn.state(XT)
41-
ax0.plot(tra.x, tra.y, color="yellow", linewidth=5.0, linestyle="-")
41+
tra1 = turn.state(XT)
42+
ax0.plot(tra1.x, tra1.y, color="yellow", linewidth=5.0, linestyle="-")
4243

4344
# plot arc segment 1
4445
X = np.linspace(0, turn._len_clothoid_part_smalldelta, 128, endpoint=True)
45-
tra = turn._state_clothoid_smalldelta_first(X)
46-
ax0.plot(tra.x, tra.y, color="red", linewidth=1.0, linestyle="-")
46+
tra2 = turn._state_clothoid_smalldelta_first(X)
47+
ax0.plot(tra2.x, tra2.y, color="red", linewidth=1.0, linestyle="-")
4748

4849
# plot arc segment 2
4950
X = np.linspace(turn._len_clothoid_part_smalldelta, 2*turn._len_clothoid_part_smalldelta, 128, endpoint=True)
50-
tra = turn._state_clothoid_smalldelta_second(X)
51-
ax0.plot(tra.x, tra.y, color="green", linewidth=1.0, linestyle="-")
51+
tra3 = turn._state_clothoid_smalldelta_second(X)
52+
ax0.plot(tra3.x, tra3.y, color="green", linewidth=1.0, linestyle="-")
5253

5354

5455
# plot qg point:

traject/scc/turn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ def _state_clothoid_smalldelta_second(self, s):
233233
assert((s <= self._len_clothoid_part_smalldelta * 2).all())
234234

235235
# original segments: s \in lp .. 2*lp
236-
# transform s: for the second clotho part go from 0 to lp
237-
my_s = s - self._len_clothoid_part_smalldelta
236+
# transform s: for the second clotho part go from lp to 0
237+
my_s = 2*self._len_clothoid_part_smalldelta - s
238238

239239
scale = math.sqrt(math.pi / self._sigma_smalldelta)
240240

0 commit comments

Comments
 (0)