Commit 723c7498 authored by Jan Koniarik's avatar Jan Koniarik
Browse files

chagnes due to schpin-lib updated and split package export into package/extras

parent 9f04e645
Pipeline #80048 passed with stage
in 10 minutes and 50 seconds
......@@ -269,5 +269,7 @@ koke conf_type = Walker
legs = (`leg` conf_type) <$> [RR, RL, FR, FL]
main :: IO ()
main = exportPackage koke
main = do
exportPackage koke
exportExtras koke
......@@ -17,26 +17,45 @@ import Walker.URDF
data ConfType = Default | Folded | Expanded deriving (Show, Eq);
exportPackage :: (ConfType -> SimpleWalker) -> IO ()
exportPackage w = do
kokePackageConfig :: String -> PackageConfig
kokePackageConfig cwd = PackageConfig { pkg_name = "schpin_koke"
, scad_dir = cwd ++ "/out/tmp/scad"
, pkg_dir = cwd ++ "/out/pkg/schpin_koke"
, src_dir = cwd ++ "/src/scad"
, urdf_subdir = "/src/"
, srdf_subdir = "/src/"
}
exportExtras :: (ConfType -> SimpleWalker) -> IO()
exportExtras w = do
cwd <- getCurrentDirectory
let ew = ewalker cwd Default
let conf = config cwd
let conf = kokePackageConfig cwd
let ew = ewalker conf Default
mapM_ (uncurry renderSCAD)
$ [ (cwd ++ "/out/gen/skeleton/default.scad", getSCADVisualSkeleton ew)
, ( cwd ++ "/out/gen/skeleton/default_col.scad"
, getSCADCollisionSkeleton ew
)
, ( cwd ++ "/out/gen/skeleton/folded.scad"
, getSCADVisualSkeleton (ewalker cwd Folded)
, getSCADVisualSkeleton (ewalker conf Folded)
)
, ( cwd ++ "/out/gen/skeleton/expanded.scad"
, getSCADVisualSkeleton (ewalker cwd Expanded)
, getSCADVisualSkeleton (ewalker conf Expanded)
)
]
generateBOM (ew) (config cwd)
generatePrint (ew) (config cwd)
generateBOM (ew) (conf)
generatePrint (ew) (conf)
where
ewalker conf conf_type = runReader (extendWalker $ w conf_type) $ conf
exportPackage :: (ConfType -> SimpleWalker) -> IO ()
exportPackage w = do
cwd <- getCurrentDirectory
let conf = kokePackageConfig cwd
let ew = ewalker conf Default
generateWalkerPackage (w Default) conf
createDirectoryIfMissing False (pkg_dir conf ++ "/launch")
......@@ -52,11 +71,5 @@ exportPackage w = do
copyFile "general/package.xml" (pkg_dir conf ++ "/package.xml")
where
ewalker cwd conf_type = runReader (extendWalker $ w conf_type) $ config cwd
config cwd = PackageConfig { pkg_name = "schpin_koke"
, scad_dir = cwd ++ "/out/tmp/scad"
, pkg_dir = cwd ++ "/out/pkg/schpin_koke"
, src_dir = cwd ++ "/src/scad"
}
ewalker conf conf_type = runReader (extendWalker $ w conf_type) $ conf
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