Commit e7c3b8af authored by Jan Koniarik's avatar Jan Koniarik
Browse files

incorporated generation of manuals

parent f64d1f0e
Pipeline #102885 passed with stage
in 23 minutes and 24 seconds
......@@ -57,11 +57,13 @@ executable schpin-koke
-- other-extensions:
-- Other library packages from which modules are imported.
build-depends: base >=4.11, linear, schpin-robot-lib, dimensional, directory, language-openscad, containers, bytestring, filepath, unordered-containers, cassava, hashable, Unique, mtl
build-depends: base >=4.11, linear, schpin-robot-lib, dimensional, directory, language-openscad, containers, bytestring, filepath, unordered-containers, cassava, hashable, Unique, mtl, json
-- Directories containing source files.
hs-source-dirs: src
-- ghc-options: -Wincomplete-patterns
-- Base language which the package is written in.
default-language: Haskell2010
......@@ -11,7 +11,6 @@ import Numeric.Units.Dimensional.Prelude
import qualified Numeric.Units.Dimensional.Prelude
as D
import Package
import Parser ( extractParts )
import Schpin.SCAD
import Schpin.Shared
import System.IO.Unsafe
......@@ -69,23 +68,36 @@ actuatorId lp jname = case lp of
RL -> case jname of
"alfa" -> 11
"beta" -> 12
"gama" -> 13
"gamma" -> 13
RR -> case jname of
"alfa" -> 21
"beta" -> 22
"gama" -> 23
"gamma" -> 23
FL -> case jname of
"alfa" -> 1
"beta" -> 2
"gama" -> 3
"gamma" -> 3
FR -> case jname of
"alfa" -> 31
"beta" -> 32
"gama" -> 33
"gamma" -> 33
actuatorName :: LegPos -> UrdfName -> String
actuatorName lp jname = "servo/" ++ (show $ actuatorId lp jname)
lewanActuator :: LegPos -> String -> Actuator
lewanActuator leg_pos key = Actuator { ac_name = actuatorName leg_pos key
, ac_type = Lewan { lw_goto_p = Just 10.0
, lw_goto_i = Just 0.0
, lw_goto_d = Just 0.0
, lw_vel_p = Just 0.6
, lw_vel_i = Just 0.005
, lw_vel_d = Just 0.6
}
, ac_id = actuatorId leg_pos key
, ac_from = 0
, ac_to = 1000
}
leg :: LegPos -> ConfType -> SimpleLeg
leg leg_pos conf_type = Leg
......@@ -111,12 +123,7 @@ leg leg_pos conf_type = Leg
, vel_lim = 0.5 *~ (radian D./ second)
, effor_lim = 100
, g_steps = 16
, actuator = Actuator { ac_name = actuatorName leg_pos "alfa"
, ac_type = Lewan
, ac_id = actuatorId leg_pos "alfa"
, ac_from = 0
, ac_to = 1000
}
, actuator = lewanActuator leg_pos "alfa"
}
, sub_link = Link { link_name = "coxa"
, weight = 320 *~ gram
......@@ -155,12 +162,7 @@ leg leg_pos conf_type = Leg
, vel_lim = 0.5 *~ (radian D./ second)
, effor_lim = 100
, g_steps = 16
, actuator = Actuator { ac_name = actuatorName leg_pos "beta"
, ac_type = Lewan
, ac_id = actuatorId leg_pos "beta"
, ac_from = 0
, ac_to = 1000
}
, actuator = lewanActuator leg_pos "beta"
}
, sub_link = Link { link_name = "femur"
, weight = 50 *~ gram
......@@ -190,7 +192,7 @@ leg leg_pos conf_type = Leg
tibia :: SimpleJoint
tibia = SimpleJoint $ Joint
{ joint_name = "gama"
{ joint_name = "gamma"
, offset = tibiaOffset
, jtype = RevoluteJoint
{ axis = yAxis
......@@ -202,12 +204,7 @@ leg leg_pos conf_type = Leg
, vel_lim = 0.5 *~ (radian D./ second)
, effor_lim = 100
, g_steps = 16
, actuator = Actuator { ac_name = actuatorName leg_pos "gama"
, ac_type = Lewan
, ac_id = actuatorId leg_pos "gama"
, ac_from = 0
, ac_to = 1000
}
, actuator = lewanActuator leg_pos "gamma"
}
, sub_link = Link { link_name = "tibia"
, weight = 170 *~ gram
......
......@@ -69,6 +69,7 @@ exportPackage w = do
writeCMakeLists conf
writePackageXML conf
writeControlConfig ew conf
generateManuals ew conf
createDirectoryIfMissing False (pkg_dir conf ++ "/worlds")
copyFile "worlds/koke.world" (pkg_dir conf ++ "/worlds/koke.world")
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ LX15D_U_screw_y = 16;
module LX15D_U_body(class)
part("blue",
part_name = str("SCAD: LX15D_U_body(", Tname(class), ")"),
part_name = str("LX15D_U_body(", Tname(class), ")"),
printed = true) difference()
{
t = 2;
......@@ -32,7 +32,7 @@ module LX15D_U_body(class)
}
module LX15D_U_plate(class, t = 2)
part("yellow",
part_name = str("SCAD: LX15D_U_plate(", Tname(class), ")"),
part_name = str("LX15D_U_plate(", Tname(class), ")"),
printed = true) mirror([ 0, 0, 1 ]) difference()
{
union()
......@@ -54,7 +54,7 @@ module LX15D_U_plate(class, t = 2)
}
module LX15D_U_plate_cable(class, t, s)
part("yellow",
part_name = str("SCAD: LX15D_U_plate_cable(", Tname(class), ")"),
part_name = str("LX15D_U_plate_cable(", Tname(class), ")"),
printed = true) difference()
{
LX15D_U_plate(class, t = t + s / 2);
......@@ -64,7 +64,7 @@ module LX15D_U_plate_cable(class, t, s)
}
module LX15D_U_plate_cable_lock(class, t, s)
part("blue",
part_name = str("SCAD: LX15D_U_plate_cable_lock(",
part_name = str("LX15D_U_plate_cable_lock(",
Tname(class),
",",
t,
......@@ -92,7 +92,7 @@ module LX15D_U_plate_cable_lock(class, t, s)
cable_harness(w = LX15D_U_screw_y, s = s, r = t, l = LX15D_U_h);
}
// this is meh, refactor
module LX15D_U(class, expand = 0) union()
module LX15D_U(class, expand = 0) assembly("LX15D_U") union()
{
t = 2;
cable_s = 2;
......
include <LX15D.scad>
include <tile.scad>
include<LX15D.scad> include<tile.scad>
t = 3;
t = 3;
w = 5;
screw_d = 3;
hole_d = 10;
......@@ -9,35 +8,29 @@ plate_a = LX15D_horn_w;
support_r = 115;
support_rr = 8;
module femur_collision_a(tibiaOffset) translate([ 0, plate_a / 2 + w / 2, 0 ])
{
hull()
{
module femur_collision_a(tibiaOffset) translate([ 0, plate_a / 2 + w / 2, 0 ]) {
hull() {
cube([ Ta(T24), w, Ta(T24) ], center = true);
translate([ 0, 0, tibiaOffset[2] ])
cube([ Ta(T24), w, Ta(T24) ], center = true);
}
translate([ 0, 0, tibiaOffset[2] ]) hull()
{
translate([ 0, 0, tibiaOffset[2] ]) hull() {
cube([ Ta(T24), w, Ta(T24) ], center = true);
translate([ tibiaOffset[0], 0, 0 ])
cube([ Ta(T24), w, Ta(T24) ], center = true);
}
}
module femur_collision_b(tibiaOffset)
{
module femur_collision_b(tibiaOffset) {
mirror([ 0, 1, 0 ]) femur_collision_a(tibiaOffset);
}
module screw_pos(tibiaOffset)
{
module screw_pos(tibiaOffset) {
rotate([ -90, 45, 0 ]) LX15D_horn_screw_pos() children();
translate(tibiaOffset) rotate([ -90, 45, 0 ]) LX15D_horn_screw_pos()
children();
}
module screw_center_pos(tibiaOffset) translate([ 0, plate_a / 2, 0 ])
{
module screw_center_pos(tibiaOffset) translate([ 0, plate_a / 2, 0 ]) {
rotate([ -90, 0, 0 ]) children();
translate(tibiaOffset) rotate([ -90, 0, 0 ]) children();
}
......@@ -45,55 +38,41 @@ module screw_center_pos(tibiaOffset) translate([ 0, plate_a / 2, 0 ])
function middle_pos_f(tibiaOffset) = [ tibiaOffset[2], 0, tibiaOffset[2] ];
function v_len(v) = sqrt(pow(v[0], 2) + pow(v[1], 2) + pow(v[2], 2));
module middle_pos(tibiaOffset)
{
module middle_pos(tibiaOffset) {
translate(middle_pos_f(tibiaOffset)) children();
}
module
screw_base()
{
cylinder(d = screw_d + t * 2, h = w);
}
module screw_base() { cylinder(d = screw_d + t * 2, h = w); }
module femur_plate(tibiaOffset)
part("purple",
part_name = str("SCAD: femur_plate(", tibiaOffset, ")"),
printed = true) union()
{
part("purple", part_name = str("femur_plate(", tibiaOffset, ")"),
printed = true) union() {
for (x = [0:Ta(T24):tibiaOffset[0] - 19])
translate([ x, 0, tibiaOffset[2] ])
{
translate([ x, 0, tibiaOffset[2] ]) {
rotate([ -90, 0, 0 ])
tile(T24, h = w, center = true, centered_hole = true);
}
difference()
{
union()
{
hull()
{
difference() {
union() {
hull() {
translate([ 0, 0, -Ta(T24) / 2 + tibiaOffset[2] ])
cube([ Ta(T24) * 3 / 4, w, t ], center = true);
rotate([ -90, 45, 0 ]) translate([ 0, 0, -w / 2 ])
LX15D_horn_screw_pos() screw_base();
}
hull()
{
hull() {
translate(tibiaOffset + [ 0, -w / 2, 0 ]) rotate([ -90, 45, 0 ])
LX15D_horn_screw_pos() screw_base();
translate(tibiaOffset + [ -19 / 2, 0, 0 ])
cube([ t, w, 24 * 3 / 4 ], center = true);
minkowski()
{
intersection()
{
minkowski() {
intersection() {
translate(tibiaOffset + [ 50, 0, 0 ])
cube([ 100, w - 1, 24 / 2 ], center = true);
rotate([ 90, 0, 0 ]) cylinder(
r = support_r, h = w - 1, center = true, $fn = 128);
rotate([ 90, 0, 0 ]) cylinder(r = support_r, h = w - 1,
center = true, $fn = 128);
}
rotate([ 90, 0, 0 ])
cylinder(r = support_rr, h = 1, center = true);
......@@ -106,12 +85,12 @@ module femur_plate(tibiaOffset)
}
}
module femur(tibiaOffset, expand = 0)
{
module femur(tibiaOffset, expand = 0) assembly("femur") {
for (i = [ -0.5, 0.5 ])
translate([ 0, i * (plate_a + w / 2 + 2 * expand), 0 ])
femur_plate(tibiaOffset);
translate([ 0, i * (plate_a + w / 2), 0 ]) assembly_direction(
[ 0, i * 2, 0 ], expand) femur_plate(tibiaOffset);
for (i = [ -0.5, 0.5 ])
translate([ 0, i * (plate_a + w + expand * 6), 0 ])
screw_pos(tibiaOffset) rotate([ i * 180 + 90, 0, 0 ]) Mscrew(M3L8C);
translate([ 0, i * (plate_a + w), 0 ]) screw_pos(tibiaOffset)
rotate([ i * 180 + 90, 0, 0 ])
assembly_direction([ 0, 0, -3 ], expand) Mscrew(M3L8C);
}
......@@ -5,3 +5,13 @@ module part(part_color = "red", part_name = undef, printed = false)
// dummy moduel for smart parser :)
children();
}
module assembly(assembly_name = undef)
{
children();
}
module assembly_direction(dir, expansion)
{
translate(dir*expansion) children();
}
......@@ -51,7 +51,7 @@ module M3_hole(l)
module
bot_rpi_holder()
part("yellow", part_name = "SCAD: bot_rpi_holder()", printed = true)
part("yellow", part_name = "bot_rpi_holder()", printed = true)
difference()
{
union()
......@@ -71,7 +71,7 @@ bot_rpi_holder()
module
top_rpi_holder()
part("yellow", part_name = "SCAD: top_rpi_holder()", printed = true)
part("yellow", part_name = "top_rpi_holder()", printed = true)
difference()
{
union()
......
......@@ -35,7 +35,7 @@ module tile_pos(class, h, center = false)
module tile_H(class, h, n = 1, center_t = undef) part(
"purple",
part_name =
str("SCAD: tile_H(", Tname(class), ",", h, ",", h, ",", center_t, ")"),
str("tile_H(", Tname(class), ",", h, ",", h, ",", center_t, ")"),
printed = true) render() difference()
{
top_offset = n * Ta(class) + h;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment