Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Koniarik
schpin-robot
Commits
d4a10fc8
Commit
d4a10fc8
authored
Apr 15, 2021
by
Jan Koniarik
Browse files
started to use library launch/package tools for XML files
parent
11d61ecf
Changes
7
Hide whitespace changes
Inline
Side-by-side
schpin_koke/general/CATKIN_IGNORE
deleted
100644 → 0
View file @
11d61ecf
schpin_koke/general/CMakeLists.txt
deleted
100644 → 0
View file @
11d61ecf
cmake_minimum_required
(
VERSION 2.8.3
)
project
(
schpin_koke
)
catkin_package
()
schpin_koke/general/package.xml
deleted
100644 → 0
View file @
11d61ecf
<?xml version="1.0"?>
<package
format=
"2"
>
<name>
schpin_koke
</name>
<version>
0.0.0
</version>
<description>
The schpin_koke package
</description>
<maintainer
email=
"squirrel@todo.todo"
>
squirrel
</maintainer>
<license>
LGPLv3
</license>
<buildtool_depend>
catkin
</buildtool_depend>
<export>
</export>
</package>
schpin_koke/launch/robot_description.launch
deleted
100644 → 0
View file @
11d61ecf
<launch>
<param name="robot_description" textfile="$(find schpin_koke)/src/koke.urdf"/>
<param name="robot_semantics" textfile="$(find schpin_koke)/src/koke.srdf"/>
</launch>
schpin_koke/schpin-koke.cabal
View file @
d4a10fc8
...
@@ -57,7 +57,7 @@ executable schpin-koke
...
@@ -57,7 +57,7 @@ executable schpin-koke
-- other-extensions:
-- other-extensions:
-- Other library packages from which modules are imported.
-- Other library packages from which modules are imported.
build-depends: base >=4.11, linear, schpin-robot-lib, dimensional, directory,
mtl,
language-openscad, containers, bytestring, filepath, unordered-containers, cassava, hashable, Unique
build-depends: base >=4.11, linear, schpin-robot-lib, dimensional, directory, language-openscad, containers, bytestring, filepath, unordered-containers, cassava, hashable, Unique
, mtl
-- Directories containing source files.
-- Directories containing source files.
hs-source-dirs: src
hs-source-dirs: src
...
...
schpin_koke/src/Package.hs
View file @
d4a10fc8
module
Package
where
module
Package
where
import
Control.Monad.Reader
(
runReader
)
import
Parser
import
Parser
import
Schpin.Package
import
Schpin.Package.Xml
import
Schpin.SCAD
import
Schpin.SCAD
import
System.Directory
(
copyFile
,
createDirectory
,
createDirectoryIfMissing
,
getCurrentDirectory
)
import
Schpin.Walker
import
Schpin.Walker
import
Schpin.Walker.Pkg
import
Schpin.Walker.Pkg
import
Schpin.Walker.SCAD
import
Schpin.Walker.SCAD
import
Schpin.Walker.SRDF
import
Schpin.Walker.SRDF
import
Schpin.Walker.URDF
import
Schpin.Walker.URDF
import
System.Directory
(
copyFile
,
createDirectory
,
createDirectoryIfMissing
,
getCurrentDirectory
)
data
ConfType
=
Default
|
Folded
|
Expanded
deriving
(
Show
,
Eq
);
data
ConfType
=
Default
|
Folded
|
Expanded
deriving
(
Show
,
Eq
);
kokePackageConfig
::
String
->
PackageConfig
kokePackageConfig
::
String
->
PackageConfig
kokePackageConfig
cwd
=
PackageConfig
{
pkg_name
=
"schpin_koke"
kokePackageConfig
cwd
=
PackageConfig
,
scad_dir
=
cwd
++
"/out/tmp/scad"
{
pkg_info
=
PackageInfo
,
pkg_dir
=
cwd
++
"/out/pkg/schpin_koke"
{
pkg_name
=
"schpin_koke"
,
src_dir
=
cwd
++
"/src/scad"
,
version
=
"0.1"
,
urdf_subdir
=
"/src/"
,
description
=
"Data files for KOKE"
,
srdf_subdir
=
"/src/"
,
maintainers
=
[
Person
"Jan Koniarik"
"433337@mail.muni.cz"
]
}
,
license
=
"LGPL"
,
authors
=
[
Person
"Jan Koniarik"
"433337@mail.muni.cz"
]
,
depends
=
[]
}
,
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
::
(
ConfType
->
SimpleWalker
)
->
IO
()
exportExtras
w
=
do
exportExtras
w
=
do
cwd
<-
getCurrentDirectory
cwd
<-
getCurrentDirectory
let
conf
=
kokePackageConfig
cwd
let
conf
=
kokePackageConfig
cwd
let
ew
=
e
w
alker
conf
Default
let
ew
=
e
xtendW
alker
(
w
Default
)
conf
mapM_
(
uncurry
renderSCAD
)
mapM_
(
uncurry
renderSCAD
)
$
[
(
cwd
++
"/out/gen/skeleton/default.scad"
,
getSCADVisualSkeleton
ew
)
$
[
(
cwd
++
"/out/gen/skeleton/default.scad"
,
getSCADVisualSkeleton
ew
)
,
(
cwd
++
"/out/gen/skeleton/default_col.scad"
,
(
cwd
++
"/out/gen/skeleton/default_col.scad"
,
getSCADCollisionSkeleton
ew
,
getSCADCollisionSkeleton
ew
)
)
,
(
cwd
++
"/out/gen/skeleton/folded.scad"
,
(
cwd
++
"/out/gen/skeleton/folded.scad"
,
getSCADVisualSkeleton
(
e
w
alker
conf
Folded
)
,
getSCADVisualSkeleton
(
e
xtendW
alker
(
w
Folded
)
conf
)
)
)
,
(
cwd
++
"/out/gen/skeleton/expanded.scad"
,
(
cwd
++
"/out/gen/skeleton/expanded.scad"
,
getSCADVisualSkeleton
(
e
w
alker
conf
Expanded
)
,
getSCADVisualSkeleton
(
e
xtendW
alker
(
w
Expanded
)
conf
)
)
)
]
]
generateBOM
(
ew
)
(
conf
)
generateBOM
(
ew
)
(
conf
)
generatePrint
(
ew
)
(
conf
)
generatePrint
(
ew
)
(
conf
)
where
ewalker
conf
conf_type
=
runReader
(
extendWalker
$
w
conf_type
)
$
conf
exportPackage
::
(
ConfType
->
SimpleWalker
)
->
IO
()
exportPackage
::
(
ConfType
->
SimpleWalker
)
->
IO
()
exportPackage
w
=
do
exportPackage
w
=
do
cwd
<-
getCurrentDirectory
cwd
<-
getCurrentDirectory
let
conf
=
kokePackageConfig
cwd
let
conf
=
kokePackageConfig
cwd
let
ew
=
ewalker
conf
Default
let
ew
=
extendWalker
(
w
Default
)
conf
generateWalkerPackage
(
w
Default
)
conf
createDirectoryIfMissing
False
(
pkg_dir
conf
++
"/launch"
)
copyFile
"launch/robot_description.launch"
(
pkg_dir
conf
++
"/launch/robot_description.launch"
)
copyFile
"launch/koke_gazebo.launch"
(
pkg_dir
conf
++
"/launch/koke_gazebo.launch"
)
createDirectoryIfMissing
False
(
pkg_dir
conf
++
"/worlds"
)
generateWalkerPackage
(
w
Default
)
conf
copyFile
"worlds/koke.world"
(
pkg_dir
conf
++
"/worlds/koke.world"
)
writeCMakeLists
conf
writePackageXML
conf
writeRobotDescriptionLaunch
(
w
Default
)
conf
copyFile
"
general/CMakeLists.txt"
(
pkg_dir
conf
++
"/CMakeLists.txt"
)
copyFile
"
launch/koke_gazebo.launch"
copyFile
"general/package.xml"
(
pkg_dir
conf
++
"/package.xml
"
)
(
pkg_dir
conf
++
"/launch/koke_gazebo.launch
"
)
where
createDirectoryIfMissing
False
(
pkg_dir
conf
++
"/worlds"
)
ewalker
conf
conf_type
=
runReader
(
extendWalker
$
w
conf_type
)
$
conf
copyFile
"worlds/koke.world"
(
pkg_dir
conf
++
"/worlds/koke.world"
)
schpin_koke/src/Parser.hs
View file @
d4a10fc8
...
@@ -22,6 +22,7 @@ import Debug.Trace ( traceShow
...
@@ -22,6 +22,7 @@ import Debug.Trace ( traceShow
)
)
import
qualified
Language.OpenSCAD
as
LS
import
qualified
Language.OpenSCAD
as
LS
import
qualified
Schpin.SCAD
as
SC
import
qualified
Schpin.SCAD
as
SC
import
Schpin.Package
import
Schpin.Shared
import
Schpin.Shared
import
System.Directory
import
System.Directory
import
System.FilePath
import
System.FilePath
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment