Skip to content

OTL/jps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jps

jps is simple pub/sub system for python(v2.7 is supported now). It is very easy to install and it is easy to understand if you have experience of ROS(Robot Operating System).

see http://jps.readthedocs.org/

Build Status

Install

$ sudo pip install jps

If it fails, try below.

sudo apt-get install python2.7-dev

Publisher

publisher.py

import jps
import time

pub = jps.Publisher('/hoge1')
i = 0
while True:
    pub.publish('hello! jps{0}'.format(i))
    i += 1
    time.sleep(0.5)

Subscriber

subscriber.py

import jps
for msg in jps.Subscriber('/hoge1'):
    print msg

How to Run

You need three consoles.

$ jps_master
$ python publisher.py
$ python subscriber.py