roshask-0.2.1: Haskell support for the ROS robotics framework.

Safe HaskellNone
LanguageHaskell2010

Ros.Node

Description

The primary entrypoint to the ROS client library portion of roshask. This module defines the actions used to configure a ROS Node.

Synopsis

Documentation

data Node a Source

A Node carries with it parameters, topic remappings, and some state encoding the status of its subscriptions and publications.

runNode :: NodeName -> Node a -> IO () Source

Run a ROS Node.

advertise :: (RosBinary a, MsgInfo a, Typeable a) => TopicName -> Topic IO a -> Node () Source

Advertise a Topic publishing a stream of values produced in the IO monad.

advertiseBuffered :: (RosBinary a, MsgInfo a, Typeable a) => Int -> TopicName -> Topic IO a -> Node () Source

Advertise a Topic publishing a stream of IO values with a per-client transmit buffer of the specified size.

subscribe :: (RosBinary a, MsgInfo a, Typeable a) => TopicName -> Node (Topic IO a) Source

Subscribe to the given Topic. Returns a shared Topic.

getShutdownAction :: Node (IO ()) Source

Get an action that will shutdown this Node.

runHandler :: (a -> IO b) -> Topic IO a -> Node ThreadId Source

Spin up a thread within a Node. This is typically used for message handlers. Note that the supplied Topic is traversed solely for any side effects of its steps; the produced values are ignored.

getParam :: (XmlRpcType a, FromParam a) => String -> a -> Node a Source

Get the value associated with the given parameter name. If the parameter is not set, return the second argument as the default value.

getParamOpt :: (XmlRpcType a, FromParam a) => String -> Node (Maybe a) Source

Get the value associated with the given parameter name. If the parameter is not set, then Nothing is returned; if the parameter is set to x, then Just x is returned.

getName :: Node String Source

Get the current node's name.

getNamespace :: Node String Source

Get the current namespace.

newtype Topic m a Source

A Topic is an infinite stream of values that steps between values in a Monad.

Constructors

Topic 

Fields

runTopic :: m (a, Topic m a)
 

topicRate :: (Functor m, MonadIO m) => Double -> Topic m a -> Topic m a Source

The application topicRate rate t runs Topic t no faster than rate Hz.

liftIO :: MonadIO m => forall a. IO a -> m a

Lift a computation from the IO monad.