Skip to content

Commit 4c01b07

Browse files
committedFeb 18, 2014
Add figure plugin.
1 parent 891cbed commit 4c01b07

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed
 

‎_plugins/figure.rb

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generate a figure such as:
2+
# <figure>
3+
# <img src="/media/2014/02/16/parallel.jpg"/>
4+
# <figcaption>Path planning is hard</figcaption>
5+
# </figure>
6+
7+
module Jekyll
8+
class FigureTag < Liquid::Tag
9+
10+
def initialize(tag_name, text, tokens)
11+
super
12+
@src, _, @caption = text.partition(" ")
13+
@caption.chomp!(" ")
14+
end
15+
16+
def render(context)
17+
"<figure><img src=\"#{@src}\" alt=\"#{@caption}\" title=\"#{@caption}\"/><figcaption>#{@caption}</figcaption></figure>"
18+
end
19+
end
20+
end
21+
22+
Liquid::Template.register_tag('figure', Jekyll::FigureTag)

‎_posts/2014-02-16-path-planning.markdown

+4-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ I've spent the last few months experimenting with path planning for Dagny.
1212

1313
Dagny is an car-type robot, which means that I have a very constrained set of possible motions. In particular, I can move forwards and backwards, and can turn while moving, but can't turn in place or move sideways. If you've ever driven a car and tried to parallel park, you can understand how difficult it can be to maneuver a car-type vehicle.
1414

15-
![Parking](/media/2014/02/16/parallel.jpg)
15+
{% figure /media/2014/02/16/parallel.jpg Path planning is hard %}
1616

1717
These motion constraints mean that I have to make sure that the motion planners understand the motion constraints and can generate a path that doesn't have turn-in-place behaviors, and honors the minimum turning radius of the robot.
1818

@@ -105,17 +105,11 @@ Since we can't solve directly for the path parameters, we cheat and run a numeri
105105

106106
The current solution simply searches for all primitives whose end point is within one minimum turning radius of the robot's start position. This produces a significant number of overlapping primitives:
107107

108-
![Motion Primitives](/media/2014/02/16/mprim_0.png "Paths with starting angle 0")
108+
{% figure /media/2014/02/16/mprim_0.png Paths with starting angle 0 %}
109109

110-
Paths with starting angle 0
110+
{% figure /media/2014/02/16/mprim_1.png Paths with starting angle 1 %}
111111

112-
![Motion Primitives](/media/2014/02/16/mprim_1.png "Paths with starting angle 1")
113-
114-
Paths with starting angle 1
115-
116-
![Motion Primitives](/media/2014/02/16/mprim_2.png "Paths with starting angle 2")
117-
118-
Paths with starting angle 2
112+
{% figure /media/2014/02/16/mprim_2.png Paths with starting angle 2 %}
119113

120114
My next steps will be to:
121115
* Find a solution for eliminating redundant motion primitives

0 commit comments

Comments
 (0)
Please sign in to comment.