generated from tpl/purs
rename and finish
This commit is contained in:
1912
doc/Modeling.rst
Normal file
1912
doc/Modeling.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Actuator where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
|
||||
actuator = tag @() "actuator" :: Tag ()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Asset where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ module Mujoco.MJCF.Body
|
||||
)
|
||||
where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
import Mujoco.MJCF.Geom (Props_geom, geom) as X
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Mujoco.MJCF.Common
|
||||
( Named
|
||||
, Oriented
|
||||
, Pos
|
||||
, Positioned
|
||||
, Real
|
||||
, Vec
|
||||
, Vec4
|
||||
@@ -12,7 +12,7 @@ module Mujoco.MJCF.Common
|
||||
import Data.Tuple.Nested (type (/\))
|
||||
|
||||
type Named r = (name :: String | r)
|
||||
type Pos r = (pos :: Vec Real | r)
|
||||
type Positioned r = (pos :: Vec Real | r)
|
||||
type Oriented r =
|
||||
( quat :: Vec4 Real
|
||||
, axisangle :: Vec4 Real
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Contact where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
contact = tag @() "contact" :: Tag ()
|
||||
|
||||
|
||||
28
src/Mujoco.MJCF.Custom.purs
Normal file
28
src/Mujoco.MJCF.Custom.purs
Normal file
@@ -0,0 +1,28 @@
|
||||
module Mujoco.MJCF.Custom where
|
||||
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
custom = tag @() "custom" :: Tag ()
|
||||
|
||||
type Props_numeric =
|
||||
( name :: String
|
||||
, size :: Int
|
||||
, data :: Array Real
|
||||
)
|
||||
numeric = tagNoContent @Props_numeric "numeric" :: TagNoContent Props_numeric
|
||||
|
||||
type Props_text =
|
||||
( name :: String
|
||||
, data :: String
|
||||
)
|
||||
text = tagNoContent @Props_text "text" :: TagNoContent Props_text
|
||||
|
||||
type Props_tuple = (name :: String)
|
||||
tuple = tag @Props_tuple "tuple" :: Tag Props_tuple
|
||||
|
||||
type Props_element =
|
||||
( objtype :: String
|
||||
, objname :: String
|
||||
, prm :: Real
|
||||
)
|
||||
element = tagNoContent @Props_element "element" :: TagNoContent Props_element
|
||||
34
src/Mujoco.MJCF.Default.purs
Normal file
34
src/Mujoco.MJCF.Default.purs
Normal file
@@ -0,0 +1,34 @@
|
||||
module Mujoco.MJCF.Default where
|
||||
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
import Mujoco.MJCF.Actuator as Actuator
|
||||
import Mujoco.MJCF.Asset as Asset
|
||||
import Mujoco.MJCF.Body as Body
|
||||
import Mujoco.MJCF.Contact as Contact
|
||||
import Mujoco.MJCF.Equality as Equality
|
||||
import Mujoco.MJCF.Geom as Geom
|
||||
import Mujoco.MJCF.Tendon as Tendon
|
||||
|
||||
type Props_default = (class :: String)
|
||||
default = tag @Props_default "default" :: Tag Props_default
|
||||
|
||||
mesh = tagNoContent @Asset.Props_mesh "mesh" :: TagNoContent Asset.Props_mesh
|
||||
material = tagNoContent @Asset.Props_material "material" :: TagNoContent Asset.Props_material
|
||||
joint = tagNoContent @Body.Props_joint "joint" :: TagNoContent Body.Props_joint
|
||||
geom = tagNoContent @Geom.Props_geom "geom" :: TagNoContent Geom.Props_geom
|
||||
site = tagNoContent @Body.Props_site "site" :: TagNoContent Body.Props_site
|
||||
camera = tagNoContent @Body.Props_camera "camera" :: TagNoContent Body.Props_camera
|
||||
light = tagNoContent @Body.Props_light "light" :: TagNoContent Body.Props_light
|
||||
pair = tagNoContent @Contact.Props_pair "pair" :: TagNoContent Contact.Props_pair
|
||||
equality = tagNoContent @(Equality.Common ()) "equality" :: TagNoContent (Equality.Common ())
|
||||
tendon = tagNoContent @(Tendon.Common ()) "tendon" :: TagNoContent (Tendon.Common ())
|
||||
general = tagNoContent @Actuator.Props_general "general" :: TagNoContent Actuator.Props_general
|
||||
motor = tagNoContent @Actuator.Props_motor "motor" :: TagNoContent Actuator.Props_motor
|
||||
position = tagNoContent @Actuator.Props_position "position" :: TagNoContent Actuator.Props_position
|
||||
velocity = tagNoContent @Actuator.Props_velocity "velocity" :: TagNoContent Actuator.Props_velocity
|
||||
intvelocity = tagNoContent @Actuator.Props_intvelocity "intvelocity" :: TagNoContent Actuator.Props_intvelocity
|
||||
damper = tagNoContent @Actuator.Props_damper "damper" :: TagNoContent Actuator.Props_damper
|
||||
cylinder = tagNoContent @Actuator.Props_cylinder "cylinder" :: TagNoContent Actuator.Props_cylinder
|
||||
muscle = tagNoContent @Actuator.Props_muscle "muscle" :: TagNoContent Actuator.Props_muscle
|
||||
adhesion = tagNoContent @Actuator.Props_adhesion "adhesion" :: TagNoContent Actuator.Props_adhesion
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Deformable.Flex where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
import Mujoco.MJCF.Geom as Geom
|
||||
|
||||
type Props_flex =
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Deformable.Skin where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
type Props_skin =
|
||||
( name :: String
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Mujoco.MJCF.Deformable where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
deformable = tag @() "deformable" :: Tag ()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Equality where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
type Common r =
|
||||
( class :: String
|
||||
|
||||
14
src/Mujoco.MJCF.Extension.purs
Normal file
14
src/Mujoco.MJCF.Extension.purs
Normal file
@@ -0,0 +1,14 @@
|
||||
module Mujoco.MJCF.Extension where
|
||||
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
extension = tag @() "extension" :: Tag ()
|
||||
|
||||
type Props_plugin = (plugin :: String)
|
||||
plugin = tag @Props_plugin "plugin" :: Tag Props_plugin
|
||||
|
||||
type Props_instance = (name :: String)
|
||||
instance_ = tag @Props_instance "instance" :: Tag Props_instance
|
||||
|
||||
type Props_config = (key :: String, value :: String)
|
||||
config = tagNoContent @Props_config "config" :: TagNoContent Props_config
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Geom where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
|
||||
type Contact r =
|
||||
@@ -46,7 +46,7 @@ type Props_geom =
|
||||
+ Contact
|
||||
+ ContactSpacing
|
||||
+ Solver
|
||||
+ Pos
|
||||
+ Positioned
|
||||
+ Oriented ()
|
||||
)
|
||||
geom = tag @Props_geom "geom" :: Tag Props_geom
|
||||
|
||||
17
src/Mujoco.MJCF.Keyframe.purs
Normal file
17
src/Mujoco.MJCF.Keyframe.purs
Normal file
@@ -0,0 +1,17 @@
|
||||
module Mujoco.MJCF.Keyframe where
|
||||
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
keyframe = tag @() "keyframe" :: Tag ()
|
||||
|
||||
type Props_key =
|
||||
( time :: Real
|
||||
, qpos :: Array Real
|
||||
, qvel :: Array Real
|
||||
, act :: Array Real
|
||||
, ctrl :: Array Real
|
||||
, mpos :: Array Real
|
||||
, mquat :: Array Real
|
||||
| Named ()
|
||||
)
|
||||
key = tagNoContent @Props_key "key" :: TagNoContent Props_key
|
||||
@@ -1,7 +1,7 @@
|
||||
module Mujoco.MJCF.Keyword where
|
||||
|
||||
import Data.Either.Inject (class Inject, inj)
|
||||
import Mujoco.XML.Node.Prop (class Serialize)
|
||||
import Mujoco.MJCF.XML.Prop (class Serialize)
|
||||
|
||||
kw :: forall kw sum. Inject kw sum => kw -> sum
|
||||
kw = inj
|
||||
@@ -254,3 +254,69 @@ instance Serialize Radian where serialize Radian = "radian"
|
||||
|
||||
data Degree = Degree
|
||||
instance Serialize Degree where serialize Degree = "degree"
|
||||
|
||||
data Dist = Dist
|
||||
instance Serialize Dist where serialize Dist = "dist"
|
||||
|
||||
data Dir = Dir
|
||||
instance Serialize Dir where serialize Dir = "dir"
|
||||
|
||||
data Origin = Origin
|
||||
instance Serialize Origin where serialize Origin = "origin"
|
||||
|
||||
data Body = Body
|
||||
instance Serialize Body where serialize Body = "body"
|
||||
|
||||
data Xbody = Xbody
|
||||
instance Serialize Xbody where serialize Xbody = "xbody"
|
||||
|
||||
data Geom = Geom
|
||||
instance Serialize Geom where serialize Geom = "geom"
|
||||
|
||||
data Site = Site
|
||||
instance Serialize Site where serialize Site = "site"
|
||||
|
||||
data Camera = Camera
|
||||
instance Serialize Camera where serialize Camera = "camera"
|
||||
|
||||
data Found = Found
|
||||
instance Serialize Found where serialize Found = "found"
|
||||
|
||||
data Force = Force
|
||||
instance Serialize Force where serialize Force = "force"
|
||||
|
||||
data Torque = Torque
|
||||
instance Serialize Torque where serialize Torque = "torque"
|
||||
|
||||
data Pos = Pos
|
||||
instance Serialize Pos where serialize Pos = "pos"
|
||||
|
||||
data Vel = Vel
|
||||
instance Serialize Vel where serialize Vel = "vel"
|
||||
|
||||
data Acc = Acc
|
||||
instance Serialize Acc where serialize Acc = "acc"
|
||||
|
||||
data Tangent = Tangent
|
||||
instance Serialize Tangent where serialize Tangent = "tangent"
|
||||
|
||||
data MinDist = MinDist
|
||||
instance Serialize MinDist where serialize MinDist = "mindist"
|
||||
|
||||
data MaxForce = MaxForce
|
||||
instance Serialize MaxForce where serialize MaxForce = "maxforce"
|
||||
|
||||
data NetForce = NetForce
|
||||
instance Serialize NetForce where serialize NetForce = "netforce"
|
||||
|
||||
data Real = Real
|
||||
instance Serialize Real where serialize Real = "real"
|
||||
|
||||
data Positive = Positive
|
||||
instance Serialize Positive where serialize Positive = "positive"
|
||||
|
||||
data Axis = Axis
|
||||
instance Serialize Axis where serialize Axis = "axis"
|
||||
|
||||
data Quaternion = Quaternion
|
||||
instance Serialize Quaternion where serialize Quaternion = "quaternion"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Meta where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
type Props_frame :: Row Type
|
||||
type Props_frame = ()
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
module Mujoco.Prelude (module X) where
|
||||
module Mujoco.MJCF.Prelude (module X) where
|
||||
|
||||
import Type.Row (type (+)) as X
|
||||
import Prelude (class Applicative, class Apply, class Bind, class BooleanAlgebra, class Bounded, class Category, class CommutativeRing, class Discard, class DivisionRing, class Eq, class EuclideanRing, class Field, class Functor, class HeytingAlgebra, class Monad, class Monoid, class Ord, class Ring, class Semigroup, class Semigroupoid, class Semiring, class Show, type (~>), Ordering(..), Unit, Void, absurd, add, ap, append, apply, between, bind, bottom, clamp, compare, comparing, compose, conj, const, degree, discard, disj, div, eq, flap, flip, gcd, identity, ifM, join, lcm, liftA1, liftM1, map, max, mempty, min, mod, mul, negate, not, notEq, one, otherwise, pure, recip, show, sub, top, unit, unless, unlessM, void, when, whenM, zero, (#), ($), ($>), (&&), (*), (*>), (+), (-), (/), (/=), (<), (<#>), (<$), (<$>), (<*), (<*>), (<<<), (<=), (<=<), (<>), (<@>), (=<<), (==), (>), (>=), (>=>), (>>=), (>>>), (||)) as X
|
||||
import Data.Either.Nested ((\/), type (\/)) as X
|
||||
import Mujoco.MJCF.Common as X
|
||||
import Mujoco.XML.Node
|
||||
import Mujoco.MJCF.XML
|
||||
( tag
|
||||
, tagNoContent
|
||||
, Tag
|
||||
, TagNoContent
|
||||
) as X
|
||||
|
||||
import Mujoco.XML.Node.Prop (class Serialize, serialize) as X
|
||||
import Mujoco.MJCF.XML.Prop (class Serialize, serialize) as X
|
||||
|
||||
import Data.Tuple (Tuple(..)) as X
|
||||
import Data.Tuple.Nested (type (/\), (/\)) as X
|
||||
231
src/Mujoco.MJCF.Sensor.purs
Normal file
231
src/Mujoco.MJCF.Sensor.purs
Normal file
@@ -0,0 +1,231 @@
|
||||
module Mujoco.MJCF.Sensor where
|
||||
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
|
||||
type ObjType = Kw.Body \/ Kw.Xbody \/ Kw.Geom \/ Kw.Site \/ Kw.Camera
|
||||
|
||||
type Common' r =
|
||||
( noise :: Real
|
||||
, cutoff :: Real
|
||||
, user :: Array Real
|
||||
| Named r
|
||||
)
|
||||
|
||||
type Common r =
|
||||
( nsample :: Int
|
||||
, interval :: Real /\ Real
|
||||
, delay :: Real
|
||||
, interp :: Kw.Zoh \/ Kw.Linear \/ Kw.Cubic
|
||||
| Common' r
|
||||
)
|
||||
|
||||
type Props_touch = Common (site :: String)
|
||||
touch = tagNoContent @Props_touch "touch" :: TagNoContent Props_touch
|
||||
|
||||
type Props_accelerometer = Common (site :: String)
|
||||
accelerometer = tagNoContent @Props_accelerometer "accelerometer" :: TagNoContent Props_accelerometer
|
||||
|
||||
type Props_velocimeter = Common (site :: String)
|
||||
velocimeter = tagNoContent @Props_velocimeter "velocimeter" :: TagNoContent Props_velocimeter
|
||||
|
||||
type Props_gyro = Common (site :: String)
|
||||
gyro = tagNoContent @Props_gyro "gyro" :: TagNoContent Props_gyro
|
||||
|
||||
type Props_force = Common (site :: String)
|
||||
force = tagNoContent @Props_force "force" :: TagNoContent Props_force
|
||||
|
||||
type Props_torque = Common (site :: String)
|
||||
torque = tagNoContent @Props_torque "torque" :: TagNoContent Props_torque
|
||||
|
||||
type Props_magnetometer = Common (site :: String)
|
||||
magnetometer = tagNoContent @Props_magnetometer "magnetometer" :: TagNoContent Props_magnetometer
|
||||
|
||||
type Props_rangefinder =
|
||||
( site :: String
|
||||
, camera :: String
|
||||
, data :: Array (Kw.Dist \/ Kw.Dir \/ Kw.Origin \/ Kw.Point \/ Kw.Normal \/ Kw.Depth)
|
||||
| Common ()
|
||||
)
|
||||
rangefinder = tagNoContent @Props_rangefinder "rangefinder" :: TagNoContent Props_rangefinder
|
||||
|
||||
type Props_camprojection = Common (site :: String, camera :: String)
|
||||
camprojection = tagNoContent @Props_camprojection "camprojection" :: TagNoContent Props_camprojection
|
||||
|
||||
type Props_jointpos = Common (joint :: String)
|
||||
jointpos = tagNoContent @Props_jointpos "jointpos" :: TagNoContent Props_jointpos
|
||||
|
||||
type Props_jointvel = Common (joint :: String)
|
||||
jointvel = tagNoContent @Props_jointvel "jointvel" :: TagNoContent Props_jointvel
|
||||
|
||||
type Props_jointactuatorfrc = Common (joint :: String)
|
||||
jointactuatorfrc = tagNoContent @Props_jointactuatorfrc "jointactuatorfrc" :: TagNoContent Props_jointactuatorfrc
|
||||
|
||||
type Props_ballquat = Common (joint :: String)
|
||||
ballquat = tagNoContent @Props_ballquat "ballquat" :: TagNoContent Props_ballquat
|
||||
|
||||
type Props_ballangvel = Common (joint :: String)
|
||||
ballangvel = tagNoContent @Props_ballangvel "ballangvel" :: TagNoContent Props_ballangvel
|
||||
|
||||
type Props_jointlimitpos = Common (joint :: String)
|
||||
jointlimitpos = tagNoContent @Props_jointlimitpos "jointlimitpos" :: TagNoContent Props_jointlimitpos
|
||||
|
||||
type Props_jointlimitvel = Common (joint :: String)
|
||||
jointlimitvel = tagNoContent @Props_jointlimitvel "jointlimitvel" :: TagNoContent Props_jointlimitvel
|
||||
|
||||
type Props_jointlimitfrc = Common (joint :: String)
|
||||
jointlimitfrc = tagNoContent @Props_jointlimitfrc "jointlimitfrc" :: TagNoContent Props_jointlimitfrc
|
||||
|
||||
type Props_tendonpos = Common (tendon :: String)
|
||||
tendonpos = tagNoContent @Props_tendonpos "tendonpos" :: TagNoContent Props_tendonpos
|
||||
|
||||
type Props_tendonvel = Common (tendon :: String)
|
||||
tendonvel = tagNoContent @Props_tendonvel "tendonvel" :: TagNoContent Props_tendonvel
|
||||
|
||||
type Props_tendonactuatorfrc = Common (tendon :: String)
|
||||
tendonactuatorfrc = tagNoContent @Props_tendonactuatorfrc "tendonactuatorfrc" :: TagNoContent Props_tendonactuatorfrc
|
||||
|
||||
type Props_tendonlimitpos = Common (tendon :: String)
|
||||
tendonlimitpos = tagNoContent @Props_tendonlimitpos "tendonlimitpos" :: TagNoContent Props_tendonlimitpos
|
||||
|
||||
type Props_tendonlimitvel = Common (tendon :: String)
|
||||
tendonlimitvel = tagNoContent @Props_tendonlimitvel "tendonlimitvel" :: TagNoContent Props_tendonlimitvel
|
||||
|
||||
type Props_tendonlimitfrc = Common (tendon :: String)
|
||||
tendonlimitfrc = tagNoContent @Props_tendonlimitfrc "tendonlimitfrc" :: TagNoContent Props_tendonlimitfrc
|
||||
|
||||
type Props_actuatorpos = Common (actuator :: String)
|
||||
actuatorpos = tagNoContent @Props_actuatorpos "actuatorpos" :: TagNoContent Props_actuatorpos
|
||||
|
||||
type Props_actuatorvel = Common (actuator :: String)
|
||||
actuatorvel = tagNoContent @Props_actuatorvel "actuatorvel" :: TagNoContent Props_actuatorvel
|
||||
|
||||
type Props_actuatorfrc = Common (actuator :: String)
|
||||
actuatorfrc = tagNoContent @Props_actuatorfrc "actuatorfrc" :: TagNoContent Props_actuatorfrc
|
||||
|
||||
type Frame r =
|
||||
( objtype :: ObjType
|
||||
, objname :: String
|
||||
, reftype :: ObjType
|
||||
, refname :: String
|
||||
| Common r
|
||||
)
|
||||
|
||||
type Props_framepos = Frame ()
|
||||
framepos = tagNoContent @Props_framepos "framepos" :: TagNoContent Props_framepos
|
||||
|
||||
type Props_framequat = Frame ()
|
||||
framequat = tagNoContent @Props_framequat "framequat" :: TagNoContent Props_framequat
|
||||
|
||||
type Props_framexaxis = Frame ()
|
||||
framexaxis = tagNoContent @Props_framexaxis "framexaxis" :: TagNoContent Props_framexaxis
|
||||
|
||||
type Props_frameyaxis = Frame ()
|
||||
frameyaxis = tagNoContent @Props_frameyaxis "frameyaxis" :: TagNoContent Props_frameyaxis
|
||||
|
||||
type Props_framezaxis = Frame ()
|
||||
framezaxis = tagNoContent @Props_framezaxis "framezaxis" :: TagNoContent Props_framezaxis
|
||||
|
||||
type Props_framelinvel = Frame ()
|
||||
framelinvel = tagNoContent @Props_framelinvel "framelinvel" :: TagNoContent Props_framelinvel
|
||||
|
||||
type Props_frameangvel = Frame ()
|
||||
frameangvel = tagNoContent @Props_frameangvel "frameangvel" :: TagNoContent Props_frameangvel
|
||||
|
||||
type Props_framelinacc =
|
||||
( objtype :: ObjType
|
||||
, objname :: String
|
||||
| Common ()
|
||||
)
|
||||
framelinacc = tagNoContent @Props_framelinacc "framelinacc" :: TagNoContent Props_framelinacc
|
||||
|
||||
type Props_frameangacc =
|
||||
( objtype :: ObjType
|
||||
, objname :: String
|
||||
| Common ()
|
||||
)
|
||||
frameangacc = tagNoContent @Props_frameangacc "frameangacc" :: TagNoContent Props_frameangacc
|
||||
|
||||
type Props_subtreecom = Common (body :: String)
|
||||
subtreecom = tagNoContent @Props_subtreecom "subtreecom" :: TagNoContent Props_subtreecom
|
||||
|
||||
type Props_subtreelinvel = Common (body :: String)
|
||||
subtreelinvel = tagNoContent @Props_subtreelinvel "subtreelinvel" :: TagNoContent Props_subtreelinvel
|
||||
|
||||
type Props_subtreeangmom = Common (body :: String)
|
||||
subtreeangmom = tagNoContent @Props_subtreeangmom "subtreeangmom" :: TagNoContent Props_subtreeangmom
|
||||
|
||||
type Props_insidesite =
|
||||
( objtype :: ObjType
|
||||
, objname :: String
|
||||
, site :: String
|
||||
| Common ()
|
||||
)
|
||||
insidesite = tagNoContent @Props_insidesite "insidesite" :: TagNoContent Props_insidesite
|
||||
|
||||
type Collision r = (geom1 :: String, geom2 :: String, body1 :: String, body2 :: String | Common r)
|
||||
|
||||
type Props_distance = Collision ()
|
||||
distance = tagNoContent @Props_distance "distance" :: TagNoContent Props_distance
|
||||
|
||||
type Props_normal = Collision ()
|
||||
normal = tagNoContent @Props_normal "normal" :: TagNoContent Props_normal
|
||||
|
||||
type Props_fromto = Collision ()
|
||||
fromto = tagNoContent @Props_fromto "fromto" :: TagNoContent Props_fromto
|
||||
|
||||
type Props_contact =
|
||||
( subtree1 :: String
|
||||
, subtree2 :: String
|
||||
, site :: String
|
||||
, num :: Int
|
||||
, data :: Array (Kw.Found \/ Kw.Force \/ Kw.Torque \/ Kw.Dist \/ Kw.Pos \/ Kw.Normal \/ Kw.Tangent)
|
||||
, reduce :: Kw.None \/ Kw.MinDist \/ Kw.MaxForce \/ Kw.NetForce
|
||||
| Collision ()
|
||||
)
|
||||
contact = tagNoContent @Props_contact "contact" :: TagNoContent Props_contact
|
||||
|
||||
type Props_tactile =
|
||||
( geom :: String
|
||||
, mesh :: String
|
||||
, nsample :: Int
|
||||
, interp :: Kw.Zoh \/ Kw.Linear \/ Kw.Cubic
|
||||
, interval :: Real /\ Real
|
||||
, delay :: Real
|
||||
, user :: Array Real
|
||||
| Named ()
|
||||
)
|
||||
tactile = tagNoContent @Props_tactile "tactile" :: TagNoContent Props_tactile
|
||||
|
||||
type Props_e_potential = Common ()
|
||||
e_potential = tagNoContent @Props_e_potential "e_potential" :: TagNoContent Props_e_potential
|
||||
|
||||
type Props_e_kinetic = Common ()
|
||||
e_kinetic = tagNoContent @Props_e_kinetic "e_kinetic" :: TagNoContent Props_e_kinetic
|
||||
|
||||
type Props_clock = Common ()
|
||||
clock = tagNoContent @Props_clock "clock" :: TagNoContent Props_clock
|
||||
|
||||
type Props_user =
|
||||
( objtype :: String
|
||||
, objname :: String
|
||||
, datatype :: Kw.Real \/ Kw.Positive \/ Kw.Axis \/ Kw.Quaternion
|
||||
, needstage :: Kw.Pos \/ Kw.Vel \/ Kw.Acc
|
||||
, dim :: Int
|
||||
| Common' ()
|
||||
)
|
||||
user = tagNoContent @Props_user "user" :: TagNoContent Props_user
|
||||
|
||||
type Props_plugin =
|
||||
( plugin :: String
|
||||
, instance :: String
|
||||
, cutoff :: Real
|
||||
, objtype :: ObjType
|
||||
, objname :: String
|
||||
, reftype :: ObjType
|
||||
, refname :: String
|
||||
, user :: Array Real
|
||||
| Named ()
|
||||
)
|
||||
plugin = tag @Props_plugin "plugin" :: Tag Props_plugin
|
||||
@@ -1,6 +1,6 @@
|
||||
module Mujoco.MJCF.Tendon where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
|
||||
|
||||
106
src/Mujoco.MJCF.Visual.purs
Normal file
106
src/Mujoco.MJCF.Visual.purs
Normal file
@@ -0,0 +1,106 @@
|
||||
module Mujoco.MJCF.Visual where
|
||||
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
visual = tag @() "visual" :: Tag ()
|
||||
|
||||
type Props_global =
|
||||
( cameraid :: Int
|
||||
, orthographic :: Boolean
|
||||
, fovy :: Real
|
||||
, ipd :: Real
|
||||
, azimuth :: Real
|
||||
, elevation :: Real
|
||||
, linewidth :: Real
|
||||
, glow :: Real
|
||||
, realtime :: Real
|
||||
, offwidth :: Int
|
||||
, offheight :: Int
|
||||
, ellipsoidinertia :: Boolean
|
||||
, bvactive :: Boolean
|
||||
)
|
||||
global = tagNoContent @Props_global "global" :: TagNoContent Props_global
|
||||
|
||||
type Props_quality =
|
||||
( shadowsize :: Int
|
||||
, offsamples :: Int
|
||||
, numslices :: Int
|
||||
, numstacks :: Int
|
||||
, numquads :: Int
|
||||
)
|
||||
quality = tagNoContent @Props_quality "quality" :: TagNoContent Props_quality
|
||||
|
||||
type Props_headlight =
|
||||
( ambient :: Vec Real
|
||||
, diffuse :: Vec Real
|
||||
, specular :: Vec Real
|
||||
, active :: Int
|
||||
)
|
||||
headlight = tagNoContent @Props_headlight "headlight" :: TagNoContent Props_headlight
|
||||
|
||||
type Props_map =
|
||||
( stiffness :: Real
|
||||
, stiffnessrot :: Real
|
||||
, force :: Real
|
||||
, torque :: Real
|
||||
, alpha :: Real
|
||||
, fogstart :: Real
|
||||
, fogend :: Real
|
||||
, znear :: Real
|
||||
, zfar :: Real
|
||||
, haze :: Real
|
||||
, shadowclip :: Real
|
||||
, shadowscale :: Real
|
||||
, actuatortendon :: Real
|
||||
)
|
||||
map = tagNoContent @Props_map "map" :: TagNoContent Props_map
|
||||
|
||||
type Props_scale =
|
||||
( forcewidth :: Real
|
||||
, contactwidth :: Real
|
||||
, contactheight :: Real
|
||||
, connect :: Real
|
||||
, com :: Real
|
||||
, camera :: Real
|
||||
, light :: Real
|
||||
, selectpoint :: Real
|
||||
, jointlength :: Real
|
||||
, jointwidth :: Real
|
||||
, actuatorlength :: Real
|
||||
, actuatorwidth :: Real
|
||||
, framelength :: Real
|
||||
, framewidth :: Real
|
||||
, constraint :: Real
|
||||
, slidercrank :: Real
|
||||
, frustum :: Real
|
||||
)
|
||||
scale = tagNoContent @Props_scale "scale" :: TagNoContent Props_scale
|
||||
|
||||
type Props_rgba =
|
||||
( fog :: Vec4 Real
|
||||
, haze :: Vec4 Real
|
||||
, force :: Vec4 Real
|
||||
, inertia :: Vec4 Real
|
||||
, joint :: Vec4 Real
|
||||
, actuator :: Vec4 Real
|
||||
, actuatornegative :: Vec4 Real
|
||||
, actuatorpositive :: Vec4 Real
|
||||
, com :: Vec4 Real
|
||||
, camera :: Vec4 Real
|
||||
, light :: Vec4 Real
|
||||
, selectpoint :: Vec4 Real
|
||||
, connect :: Vec4 Real
|
||||
, contactpoint :: Vec4 Real
|
||||
, contactforce :: Vec4 Real
|
||||
, contactfriction :: Vec4 Real
|
||||
, contacttorque :: Vec4 Real
|
||||
, contactgap :: Vec4 Real
|
||||
, rangefinder :: Vec4 Real
|
||||
, constraint :: Vec4 Real
|
||||
, slidercrank :: Vec4 Real
|
||||
, crankbroken :: Vec4 Real
|
||||
, frustum :: Vec4 Real
|
||||
, bv :: Vec4 Real
|
||||
, bvactive :: Vec4 Real
|
||||
)
|
||||
rgba = tagNoContent @Props_rgba "rgba" :: TagNoContent Props_rgba
|
||||
@@ -1,4 +1,4 @@
|
||||
module Mujoco.XML.Node.Prop (class Serialize, serialize, serializeProps, class SerializeProps', serializeProps', renames) where
|
||||
module Mujoco.MJCF.XML.Prop (class Serialize, serialize, serializeProps, class SerializeProps', serializeProps', renames) where
|
||||
|
||||
import Prelude
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module Mujoco.XML.Node
|
||||
module Mujoco.MJCF.XML
|
||||
( Node
|
||||
, render
|
||||
, tag
|
||||
@@ -23,8 +23,8 @@ import Data.Tuple.Nested ((/\))
|
||||
import Elmish.HTML (empty, fragment, text) as HTML
|
||||
import Elmish.HTML.Internal (tag, tagNoContent) as HTML
|
||||
import Elmish.React (ReactElement)
|
||||
import Mujoco.XML.Node.Prop (class SerializeProps', serializeProps)
|
||||
import Mujoco.XML.Node.Prop as Prop
|
||||
import Mujoco.MJCF.XML.Prop (class SerializeProps', serializeProps)
|
||||
import Mujoco.MJCF.XML.Prop as Prop
|
||||
import Prim.Row (class Union)
|
||||
import Prim.RowList (class RowToList)
|
||||
import Unsafe.Coerce (unsafeCoerce)
|
||||
@@ -24,15 +24,15 @@ module Mujoco.MJCF
|
||||
)
|
||||
where
|
||||
|
||||
import Mujoco.Prelude
|
||||
import Mujoco.MJCF.Prelude
|
||||
|
||||
import Mujoco.MJCF.Keyword as Kw
|
||||
import Mujoco.MJCF.Keyframe as X
|
||||
import Mujoco.MJCF.Keyword as X
|
||||
import Mujoco.MJCF.Asset as X
|
||||
import Mujoco.MJCF.Body as X
|
||||
import Mujoco.MJCF.Common as X
|
||||
import Mujoco.MJCF.Contact as X
|
||||
import Mujoco.XML.Node (empty, text, fragment) as X
|
||||
import Mujoco.MJCF.XML (empty, text, fragment) as X
|
||||
|
||||
type Props_mujoco = (model :: String)
|
||||
mujoco = tag @Props_mujoco "mujoco" :: Tag Props_mujoco
|
||||
|
||||
@@ -3,7 +3,7 @@ module Test.Main where
|
||||
import Prelude
|
||||
|
||||
import Effect (Effect)
|
||||
import Test.Mujoco.XML.Node.Prop as Test.Mujoco.XML.Node.Prop
|
||||
import Test.Mujoco.MJCF.XML.Prop as Test.Mujoco.MJCF.XML.Prop
|
||||
import Test.Mujoco.MJCF as Test.Mujoco.MJCF
|
||||
import Test.Spec.Reporter.Console (consoleReporter)
|
||||
import Test.Spec.Runner.Node (runSpecAndExitProcess)
|
||||
@@ -12,4 +12,4 @@ main :: Effect Unit
|
||||
main =
|
||||
runSpecAndExitProcess [consoleReporter] do
|
||||
Test.Mujoco.MJCF.spec
|
||||
Test.Mujoco.XML.Node.Prop.spec
|
||||
Test.Mujoco.MJCF.XML.Prop.spec
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module Test.Mujoco.XML.Node.Prop where
|
||||
module Test.Mujoco.MJCF.XML.Prop where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Data.Tuple.Nested (type (/\), (/\))
|
||||
import Mujoco.XML.Node.Prop (class SerializeProps', serialize, serializeProps)
|
||||
import Mujoco.MJCF.XML.Prop (class SerializeProps', serialize, serializeProps)
|
||||
import Prim.Row (class Union)
|
||||
import Prim.RowList (class RowToList)
|
||||
import Test.Spec (Spec, describe, it)
|
||||
@@ -22,7 +22,7 @@ type Props =
|
||||
|
||||
spec :: Spec Unit
|
||||
spec =
|
||||
describe "Mujoco.XML.Node.Prop" do
|
||||
describe "Mujoco.MJCF.XML.Prop" do
|
||||
describe "Serialize" do
|
||||
it "serializes boolean" $ serialize true `shouldEqual` "true"
|
||||
it "serializes string" $ serialize "a" `shouldEqual` "a"
|
||||
@@ -10,8 +10,8 @@ import Effect.Class (liftEffect)
|
||||
import Mujoco.MJCF as X
|
||||
import Mujoco.MJCF.Geom as X.G
|
||||
import Mujoco.Wasm (renderSpec)
|
||||
import Mujoco.XML.Node (Node)
|
||||
import Mujoco.XML.Node as XML
|
||||
import Mujoco.MJCF.XML (Node)
|
||||
import Mujoco.MJCF.XML as XML
|
||||
import Test.Assert (assertTrue)
|
||||
import Test.Spec (Spec, describe, it)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import Control.Promise as Promise
|
||||
import Effect (Effect)
|
||||
import Effect.Aff (Aff)
|
||||
import Effect.Class (liftEffect)
|
||||
import Mujoco.XML.Node as XML
|
||||
import Mujoco.MJCF.XML as XML
|
||||
|
||||
foreign import data Mujoco :: Type
|
||||
foreign import data Spec :: Type
|
||||
|
||||
Reference in New Issue
Block a user