Package: pygecko
:lizard:  pyGeckoMy robot software.Doesn't useROS, ROS is a pain to install and maintain
on macOS and various linux systemsUses some of the same ideas, constructs, architecture ideas, APIs but
not strictly adhering to themUsesZero MQas the inter-process communication
(uses both TCP and UDS) instead of RPC-XMLlooked at Google's protobuf, but was more complex than I neededusingmsgpackto serialize data currently,
but could be changed to something differentinstead ofroscoreusegeckocore.pyas the message hubproduces performance data (see below)instead ofroslaunchusegeckolaunch.pyjson- config and launch filesAll of this runs onRaspberry Pi 3Also runs on macOS (UNIX)ArchitectureGeckoCore is a hub that tracks what computer publishes what topic and prints
node cpu/memory usageActually, when gecko processes start up, they tell geckocore their pid
numbers so it can track usage usingpsutillibraryObviously this only works on processes located on the same machine as geckocoreGeckoCore really just displays info and keeps track of publisher topics/addressesAny number of pubs can talk to any number of sub ... it is not a one-to-one relationshipPubs/Subs can exist on remote machinesIf a Pub/Sub is on a remote machine, then it's performance data is not displayedThere currently is no mechanism to get the remote performance datageckocore.pyBinder opens a random port for dataNote: either a publisher or a subscriber can bind to a portBinder tells GeckoCore the topic and address/portGeckoCore acknowledges the binderA connector wants to connect to a topic and asks GeckoCore for the address/portGeckoCore:If topic is found, return the address/port and an ok statusIf topic isnotfound, returns NoneConnector connects to the binder with the given address/portBinder:only 1 per port, can be either pub or subConnecter:can be many per port, can be pub or subThis is the main message hub. GeckoCore also is passed the PIDs for processes on the
local machine and prints performance data on each process:+========================================|ProcessesPerformance|[24790]GeckoCore.............cpu:0.3%mem:0.0%|[24793]pub_ryan..............cpu:0.1%mem:0.0%|[24795]pub_mike..............cpu:0.1%mem:0.0%|[24796]sub_mike..............cpu:20.5%mem:0.0%|[24797]pub_sammie............cpu:0.1%mem:0.0%|[24798]sub_sammie............cpu:20.5%mem:0.0%
+------------------------------|ESTABLISHEDConnections|pub_mike............192.168.86.22:50551-->192.168.86.22:50557|sub_mike............192.168.86.22:50557-->192.168.86.22:50551|pub_sammie..........192.168.86.22:50554-->192.168.86.22:50558|sub_sammie..........192.168.86.22:50558-->192.168.86.22:50554
+------------------------------|LISTENConnections|GeckoCore...........192.168.86.22:11311|pub_ryan............192.168.86.22:50548|pub_mike............192.168.86.22:50551|pub_sammie..........192.168.86.22:50554
+========================================|PublishedTopics<topic>@tcp://<ip>:<port>|1:ryan@tcp://192.168.86.22:50548|2:mike@tcp://192.168.86.22:50551|3:sammie@tcp://192.168.86.22:50554
+================================================================================Geckocore[65975]-------------Key:localHostIP:10.0.1.57Listeningon:224.3.29.110:11311
-------------
KnownServices[6]*hello:........................tcp://10.0.1.57:65303*heythere:....................tcp://10.0.1.57:65304*ryan:.........................tcp://10.0.1.57:65310*mike:.........................tcp://10.0.1.57:65311*sammie:.......................tcp://10.0.1.57:65312*scott:........................tcp://10.0.1.57:65313

Binders[6][65993]hello.................cpu:0.0%mem:0.0%[65994]heythere.............cpu:0.0%mem:0.0%[66008]ryan..................cpu:0.1%mem:0.0%[66010]mike..................cpu:0.1%mem:0.0%[66012]sammie................cpu:0.1%mem:0.0%[66014]scott.................cpu:0.1%mem:0.0%

Connections[8][65995]hello.................cpu:20.7%mem:0.0%[65996]hello.................cpu:20.9%mem:0.0%[65997]heythere.............cpu:21.0%mem:0.0%[65998]heythere.............cpu:20.8%mem:0.0%[66011]mike..................cpu:19.0%mem:0.0%[66013]sammie................cpu:19.0%mem:0.0%[66015]scott.................cpu:19.4%mem:0.0%[66009]ryan..................cpu:18.7%mem:0.0%geckolaunch.pygeckolaunch.pyallows you to launch a bunch of processes quickly using a launch
file. A launch file is just a simple json file where each line takes the form:[file, function, kwargs]. Here is an example:{"processes":[["process","publish",{"topic":"hello"}],["process","publish",{"topic":"hey there"}],["process","subscribe2",{"topic":"hello"}],["process","subscribe2",{"topic":"hello"}],["process","subscribe2",{"topic":"hey there"}],["process","subscribe2",{"topic":"hey there"}],["process","subscribe2",{"topic":"cv"}],["process","subscribe2",{"topic":"cv"}],["process","pcv",{"topic":"cv"}]],"geckocore":{"host":"localhost"# or hostname.local}}geckopySee the examples, but this acts like arospyand helps make writing
pub/sub processes easy. See the/examplesfolder to see it in action.init_node:this sets up the the process for communications withgeckocorelogxxx:prints log messagesfrompygeckoimportgeckopygeckopy.loginfo('this is a info message')# just send a stringgeckopy.logwarn('this is a warning message')geckopy.logerror('this is a error message')geckopy.logdebug('this is a debug message')Subscriber:creates a subscriber and appends the callback function to an
array in geckopyPublisher:creates a publisher and returns itRate:given a frequency of how often a loop should run (i.e., 10Hz), the
returned object will dynamically set the sleep interval to achieve the rate. Ex:frompygeckoimportgeckopyrate=geckopy.Rate(20)# run loop at 20 HzwhileTrue:rate.sleep()Basic User APIgeckopy.*init_node(kwargs)logX(test, topic='log')X: Error, Debug, Info, Warningis_shutdown()Publisher(topics, addr=None, queue_size=10, bind=True)Subscriber(topics, callback=None, addr=None, bind=False)Change LogDateVersionNotes2019-May-181.3.0working with c++2019-Mar-021.2.0set multicast as the default method to find nodes2018-Oct-281.1.0simplified and removed geckocore as the main hub2018-Sep-161.0.3implemented a multicast connection process2018-Sep-161.0.2dropping python 2.7 support, only 3.7+2018-Sep-111.0.1working, but still need to flush it out some more2018-Jul-281.0.0totally nuked everything from orbit and started over2017-May-140.8.3updates and refactor2017-Apr-020.8.2fix pypi doc and refactor2017-Mar-190.7.0refactored2017-Mar-120.6.0changed messages from dict to classes2016-Dec-260.5.0refactor2016-Oct-090.4.1published to PyPi2010-Mar-100.0.1initMIT LicenseCopyright (c) 2010 Kevin J. WalchkoPermission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.