2 // GNU AGPLv3 (or later at your option)
3 // project available at these locations:
4 // https://gitorious.org/ozzloy/challenge-bot
5 // https://github.com/waynegramlich/challenge-bot
8 this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
9 http://fritzing.org/projects/hc-sr04-project
10 it can hold the sonar sensor either facing down, or forwards.
11 when facing down, it can detect if it passes over the edge of a table.
12 when facing forwards, it can detect and follow something in front of it.
17 include
<sonar
-table
-top
-holder
-dimensions
.scad
>
22 module
sonar_holder_2d() {
24 square([sonar_holder_length
, sonar_holder_width
]); } }
27 translate([between_sonar_centers
/ 2, 0, 0]){
28 cylinder(r
= sonar_radius
, h
= sonar_height
);}
29 // for the variance with which the physical sonar cylinders are placed
30 translate([between_sonar_centers
/ 2 - between_sonar_centers_variance
, 0, 0]){
31 cylinder(r
= sonar_radius
, h
= sonar_height
);
32 translate([0, -sonar_radius
, 0]){
33 cube([between_sonar_centers_variance
, sonar_diameter
, sonar_height
]);}}
34 translate([-between_sonar_centers
/ 2, 0, 0]){
35 cylinder(r
= sonar_radius
, h
= sonar_height
);}}
37 module
sonar_holder(){
38 elbow_length
= deck_depth
- 0.5;
39 rounded_corner_radius
= buffer
;
41 cube([sonar_holder_length
, sonar_holder_width
, sonar_holder_depth
]);
42 translate([sonar_holder_length
/ 2, sonar_holder_width
/ 2, -0.05]){
44 translate([sonar_holder_length
,
47 corner_rounder(rounded_corner_radius
,
50 translate([sonar_holder_length
, 0, 0]){
51 cube([elbow_length
, deck_depth
, sonar_holder_depth
]);
52 translate([elbow_length
, 0, 0]){
53 linear_extrude(height
= sonar_holder_depth
){
55 [sonar_holder_depth
, 0],
56 [sonar_holder_depth
, sonar_holder_width
/ 2],
58 sonar_holder_width
/ 2 + sonar_holder_depth
]]);}
59 translate([0, (sonar_holder_width
+ sonar_holder_depth
) / 2, 0]){
60 cube([sonar_holder_depth
/ 2,
61 (sonar_holder_width
- sonar_holder_depth
) / 2 + 0.8,
62 sonar_holder_depth
]);}
63 translate([-1.7, sonar_holder_width
+ 0.8, 0]){
64 linear_extrude(height
= sonar_holder_depth
){
66 [sonar_holder_depth
/ 2 + 1.7, 4],
67 [sonar_holder_depth
/ 2 + 1.7, 0]]);}}}}}
70 deck_holder_width
= sonar_holder_width
- deck_depth
;
71 deck_holder_height
= sonar_holder_depth
* 2 + deck_depth
;
72 linear_extrude(height
= deck_holder_width
){
74 square([deck_holder_length
, deck_holder_height
]);
75 translate([sonar_holder_depth
, sonar_holder_depth
]){
77 translate([deck_holder_height
, sonar_holder_depth
]){
78 square([deck_holder_length
- (deck_holder_height
), deck_depth
]);}}}
79 translate([deck_holder_length
- oshw_dy
* 0.05, 0, deck_holder_width
/ 2])
81 rotate(v
= [1, 0, 0], a
= 90)
83 linear_extrude(height
= 0.5)
85 translate([deck_holder_length
- oshw_dy
* 0.05,
86 deck_holder_height
+ 0.5,
87 deck_holder_width
/ 2])
88 rotate(v
= [1, 0, 0], a
= 90)
91 linear_extrude(height
= 0.5)
94 module
corner_rounder_2d(radius
, corner_name
="top-left"){
95 rotate_for_corner
= (corner_name
== "top-left") ? 0 :
96 ((corner_name
== "top-right") ? -90 :
97 ((corner_name
== "bottom-left") ? 90 :
98 ((corner_name
== "bottom-right") ? 180 :
100 rotate(rotate_for_corner
){
103 translate([radius
, radius
]){
106 module
corner_rounder(radius
, height
, corner_name
="top-left"){
107 linear_extrude(height
= height
){
108 corner_rounder_2d(radius
, corner_name
);}}