-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | ROS message parser, render, TH -- -- Please see README.md @package rosmsg @version 0.4.4.0 -- | Common used data types. module Robotics.ROS.Msg.Types -- | ROS message field is a variable or constant declaration data FieldDefinition -- | Variable field name and type Variable :: Field -> FieldDefinition -- | Constant field name, type and value Constant :: Field -> Text -> FieldDefinition -- | A variant type describing the simple types that may be included in a -- ROS message. data SimpleType RBool :: SimpleType RByte :: SimpleType RChar :: SimpleType RInt8 :: SimpleType RUInt8 :: SimpleType RInt16 :: SimpleType RUInt16 :: SimpleType RInt32 :: SimpleType RUInt32 :: SimpleType RInt64 :: SimpleType RUInt64 :: SimpleType RFloat32 :: SimpleType RFloat64 :: SimpleType RString :: SimpleType RTime :: SimpleType RDuration :: SimpleType -- | A variant type describing the types that may be included in a ROS -- message. data FieldType Simple :: SimpleType -> FieldType Custom :: Text -> FieldType Array :: FieldType -> FieldType FixedArray :: Int -> FieldType -> FieldType -- | ROS message is a list of fields type MsgDefinition = [FieldDefinition] -- | Field name is text encoded type FieldName = Text -- | Field is a pair of name - value type Field = (FieldType, FieldName) -- | ROSDuration is a tuple of (seconds, nanoseconds) type ROSDuration = (Word32, Word32) -- | ROSTime is a tuple of (seconds, nanoseconds) type ROSTime = (Word32, Word32) instance GHC.Classes.Eq Robotics.ROS.Msg.Types.FieldDefinition instance GHC.Show.Show Robotics.ROS.Msg.Types.FieldDefinition instance GHC.Classes.Eq Robotics.ROS.Msg.Types.FieldType instance GHC.Show.Show Robotics.ROS.Msg.Types.FieldType instance GHC.Classes.Eq Robotics.ROS.Msg.Types.SimpleType instance GHC.Enum.Enum Robotics.ROS.Msg.Types.SimpleType instance GHC.Show.Show Robotics.ROS.Msg.Types.SimpleType -- | Parser components for the ROS message description language -- (msg files). See http://wiki.ros.org/msg for -- reference. module Robotics.ROS.Msg.Parser -- | The result of a parse. data Result r :: * -> * -- | The parse failed. The Text is the input that had not yet been -- consumed when the failure occurred. The -- [String] is a list of contexts in which the -- error occurred. The String is the message describing the error, -- if any. Fail :: Text -> [String] -> String -> Result r -- | The parse succeeded. The Text is the input that had not yet -- been consumed (if any) when the parse succeeded. Done :: Text -> r -> Result r -- | Run a parser and return its result. parse :: Parser a -> Text -> Result a -- | The ROS message language parser rosmsg :: Parser MsgDefinition -- | The ROS message language builder from abstract message definition. module Robotics.ROS.Msg.Render -- | Render formal ROS message definition according to: -- -- render :: MsgDefinition -> Builder -- | Like render by first argument is custom type modifier hook render' :: (Text -> Text) -> MsgDefinition -> Builder -- | Robot Operating System (ROS) is a set of software libraries and tools -- that help you build robot applications. From drivers to -- state-of-the-art algorithms, and with powerful developer tools, ROS -- has what you need for your next robotics project. And it's all open -- source. -- -- In ROS a node is a process that performs computation. Nodes -- communicate with each other by publishing messages to topics. A -- message is a simple data structure, comprising typed fields. Standard -- primitive types (integer, floating point, boolean, etc.) are -- supported, as are arrays of primitive types. Messages can include -- arbitrarily nested structures and arrays (much like C structs). -- -- This package provide the ROS message language parser and builder. -- Abstract message representation given by parser can be used in -- TemplateHaskell codegen for native Haskell structures creation. -- --
--   >>> [rosmsgFrom|/opt/ros/jade/share/std_msgs/msg/Byte.msg|]
--   "[Variable (Simple RByte,\"data\")]"
--   
-- --
--   >>> [rosmsgFrom|/opt/ros/jade/share/geometry_msgs/msg/Polygon.msg|]
--   "[Variable (Array (Custom \"Point32\"),\"points\")]"
--   
module Robotics.ROS.Msg -- | Haskell native type for ROS message language described data structure. -- Serialization guaranted by Binary super class. And no more is -- needed for transfer over socket. class Binary a => Message a -- | Get MD5 of formal message representation getDigest :: Message a => a -> MD5Digest -- | Get message type, e.g. std_msgs/Char getType :: Message a => a -> Text -- | Sometime ROS messages have a special Header field. It used -- for tracking package sequence, time stamping and frame tagging. -- Headers is frequently field. The Stamped type class lifts -- header fields on the top of message and abstracting of type. class Message a => Stamped a -- | Get sequence number getSequence :: Stamped a => a -> Word32 -- | Set sequence number setSequence :: Stamped a => Word32 -> a -> a -- | Get timestamp of message getStamp :: Stamped a => a -> ROSTime -- | Get frame of message getFrame :: Stamped a => a -> ByteString -- | A type for fixed arrays in ROS messages newtype ROSFixedArray (n :: Nat) a ROSFixedArray :: Array a -> ROSFixedArray a [unFixedArray] :: ROSFixedArray a -> Array a -- | A type for arrays in ROS messages newtype ROSArray a ROSArray :: Array a -> ROSArray a [unArray] :: ROSArray a -> Array a -- | ROSDuration is a tuple of (seconds, nanoseconds) type ROSDuration = (Word32, Word32) -- | ROSTime is a tuple of (seconds, nanoseconds) type ROSTime = (Word32, Word32) -- | Template Haskell driven code generator from ROS message language to -- Haskell native representation. module Robotics.ROS.Msg.TH -- | QQ for data type and instances generation from ROS message declaration rosmsg :: QuasiQuoter -- | Generate ROS message declarations from .msg file rosmsgFrom :: QuasiQuoter