Home‎ > ‎

First Steps


So you have downloaded and built core-moos (build instructions are on the examples page). What next? How for example do you test the build?

Basic Testing with umm

If you look in the bin directory of the build location you will see (amoungst others)  two executables -  MOOSDB and also umm. Of these, the former is the most important it acts as a router for all information. You need to start it in a terminal. No need to use any command line options - the defaults will work just fine for now.


Now start another terminal window and move once more to the <build>/bin directory. Lets here start an instance of umm. This is the swiss army knife of MOOS and should be your first port of call when you want to verify or test anything to do with MOOS. Remember, if you are thinking "umm..I wonder what is wrong?", then you have already decided on the next step: using umm. 

So in that new terminal window lets start umm of and tell it to publish a numeric variable called x at 10Hz

>> ./umm -p=x@10

And in another window lets start another umm up to subscribe to x and print out its value

>> ./umm -s=x --verbose

you should see something like this in the MOOSDB terminal

>>  ./MOOSDB
------------------- MOOSDB V10 -------------------
  Hosting  community                "#1"
  Name look up is                   off
  Asynchronous support is           on
  Connect to this server on port    9000
network performance data published on localhost:9020
listen with "nc -u -lk 9020"

New client connected:
  Handshaking   :  OK
  Client's name :  umm-689
  Type          :  Asynchronous
  Priority      :  normal
  Total Clients :  1

New client connected:
  Handshaking   :  OK
  Client's name :  umm-511
  Type          :  Asynchronous
  Priority      :  normal
  Total Clients :  2
+ subs of "umm-511" to "x" every 0.0 seconds

Here you can see confirmation that two clients (the umms) are connecting to a MOOS community and in the last line confirmation that one of these is subscribing to "x".

The subscribing umm window should be showing something like this:

./umm -s=x --verbose
note mission file Mission.moos was not found

-------------- moos connect ----------------------
  contacting a MOOS server LOCALHOST:9000 -  try 00001
  Handshaking as umm-621                [ok]
  DB reports async support is           [on]
  DB is running on                      PaulMBP.local
  Timing skew estimation is             [off] (not needed)

+Subscribing to x@0
umm-621 is Running:
 |-Baseline AppTick   @ 100.0 Hz
 |--Comms is Full Duplex and Asynchronous
 |--Iterate Mode 1 :
   |-Dynamic iterate speed driven by message delivery at up to 400Hz

name                source              contents
x                   umm-799             6.00000
x                   umm-799             7.00000
x                   umm-799             8.00000
x                   umm-799             9.00000

This shows the client connecting to the MOOSDB, subscribing for "x", printing out some information about the way in which communication will proceed. After that we can see (because of the --verbose flag) the received "x"s being printed out. The contents are incrementing because that is what umm does when it publishes numeric data.

OK so lets do something more interesting. Lets send some binary data and lets see how quickly it is received. Kill the subscribing umm. No need to touch the MOOSDB - that fella can live for ever.

Lets start  another umm off publishing some  50KB chunks of data at 20Hz and other 10KB chunks at 4Hz. Easy:

./umm -p=y:50000@20,z:10000@4

and lets be lazy and simply get another umm to subscribe to everything that is going on.

./umm -s=x,y,z --verbose

So we have one umm publishing x and another publishing y and z so you should see x and y and z being printed out.

Speed Testing with umm

You might be interested in seeing how long it takes to send and receive this data. So make sure you have a release build (if you want great performance but debug is pretty swift) and ask umm to print message latencies. We could use a single umm to do this (but feel free to separate send and receive if you like) and have it publish and subscribe to the same variable:

./umm -p=v  -s=v --latency

you should see latency times being printed and they should be small. Of course you can have multiple umms subscribing to the same message and see how latencies change around your network. For example, typing each line is different terminals

./umm -p=u:100000@100
./umm -s=u --verbose --latency

will send 100KB messages at 100Hz, if your network and take it (it should!). You might also be interested in seeing the bandwidth being achieved:

./umm -s=u --bandwidth --verbose

Using umm as a spy

There will be many times when you simply want to look at what is being sent around the MOOS community. Umm must be your first point of call. Try

./umm --spy

for a summary every second, or

./umm --spy_all

to see each and every message being send