MARIE 0.5 mailbox
From MARIEWiki
Contents |
Version
0.5
Description
A mailbox typically creates buffering interface between asynchronous components. Transmitter pushes a message in the mailbox when it is ready to do so, without bothering if receiver is ready to receive it. Receiver needs to poll the mailbox to see if new message is available. Pull frequency might not be equal to the transitter push frequency. Pull and peek access are available to retrieve messages (peek being a pull without consumming data).

Requirements
Pull serialized message need to be represented like this : <pull> Peek serialized message need to be represented like this : <peek> Buffer Size The data buffered in the Mailbox is treated as a queue, with the oldest data being replaced by the newest data if the Mailbox has reached its size limit.
Modes
Pull Mode
Two modes are available for getting data :
- pullOne : get the first and thus the oldest data in the queue
- pullAll : get all the data in the queue.
Peek Mode
Two modes are available for getting data :
- peekOne : get the first and thus the oldest data in the queue
- peekAll : get all the data in the queue.
Configuration
Note : see Configuration Description Language for syntax details.
# C mailbox
o KV size
o KV pullMode
o KV peekMode
# Q groupA
1-N T port
# Q groupB
1-N T port
- size : Buffer size (default = 1)
- pullMode : pull mode (default = pullOne)
- peekMode : peek mode (default = peekOne)
Notes :
- Ports name must be unique.
- Data must be stored in a serialize format (char*, size)
See available Ports for port configuration details.
Usage
usage : mailbox -n component_name [-t component_type] [-d director_port_number] [-c configurator_port_number]
-n #Specify component's name
-t #Specify component's control type :
# DEFAULT - use when controlled by appman Application Manager (default)
# MPI - use when controlled by ammpi Application Manager
-d #Specify director server socket port number (mandatory in DEFAULT component's control type)
-c #Specify configurator server socket port number (mandatory in DEFAULT component's control type)
Executing aacarmen in project
This section shows how to use mailbox in a Project..
In .setup file, add the following processes :
# T process # KV name # KV type = MARIE:MPI # KV executableName = mailbox # KV configFile
- name : Specify a reference name for the process
- type : Specify component's control type
- executableName : Specify the executable name
- configFile : Specify path to aafd configuration file (see Configuration)
Executing aacarmen with appman [deprecated]
This section shows how to use mailbox with appman Application Manager from a terminal script.
Start component
mailbox -n component_name -t MARIE -d director_port_number -c configurator_port_number sleep 4 # Sleep time (plateform specific) appman -p configurator_port_number -c sxml:PathToConfigFile sleep 1 # Sleep time (plateform specific) appman -p director_port_number -c init sleep 1 # Sleep time (plateform specific) appman -p director_port_number -c start
Component can take couple of seconds to boot, configure and initialize before being ready to receive requests on director and configurator ports. Delays are required and must be adjusted depending on the running platform.
Stop component
appman -p director_port_number -c stop sleep 1 # Sleep time (plateform specific)
Component can take couple of seconds to stop before being ready to receive requests on director and configurator ports. Delay is required and must be adjusted depending on the running platform.
Quit component
appman -p director_port_number -c quit
Authors
- Carle Cote
- Mathieu Lajoie
Contributors
- Nick Hawes
- Clement Raievsky
- Patrick Frenette
License
MARIE - Mobile and Autonomous Robotics Integration Environment Copyright (C) 2004-2006 Carle Cote, Mathieu Lajoie
This library and its documentation are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library and documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You can contact MARIE development team at http://marie.sourceforge.net.

