More Related Content Similar to Machinekit - Current Status of Machinetalk (20) More from Alexander Rössler (6) Machinekit - Current Status of Machinetalk11. 11
Services & Components
Component Services
Haltalk halrcmd, halrcomp, (halgroup)
msgd log
mklauncher launcher, launchercmd
configserver config
mkwrapper status, command, error, file
previewmodule preview, previewcmd
15. 15
Reasons
● Not only Protobuf + ZMQ + DNS-SD/mDNS
● Knowledge embedded in code
● Repetitive across languages
● Protocols better formalized
● Protobuf Messages↔
16. 16
Imatix/GSL
● Model Oriented Programing
● Control Model + Generator
XML Model
.xml
GSL
Interpreter
Generated
Code
.cpp, .py, ...
GSL Template
.gsl
18. 18
HalremoteinFSMs
down
trying
Start
[Start]
/ Start Socket
/ Reset Heartbeat Liveness
/ Send Ping
/ Start Heartbeat Timer
Stop
[Stop]
/ Stop Heartbeat Timer
/ Stop Socket
up
Any Msg Received
[* Msg Received]
/ Reset Heartbeat Liveness
/ Reset Heartbeat Timer
Stop
[Stop]
/ Stop Heartbeat Timer
/ Stop Socket
Heartbeat Timeout
[Heartbeat Timeout]
/ Stop Socket
/ Start Socket
/ Reset Heartbeat Liveness
/ Send Ping
Heartbeat Timeout
[Heartbeat Timeout]
/ Stop Socket
/ Start Socket
/ Reset Heartbeat Liveness
/ Send Ping
Heartbeat Tick
[Heartbeat Tick]
/ Send Ping
Any Msg Sent
[* Msg Sent]
/ Reset Heartbeat Timer
Heartbeat Tick
[Heartbeat Tick]
/ Send Ping
Any Msg Received
[* Msg Received]
/ Reset Heartbeat Liveness
Any Msg Sent
[* Msg Sent]
/ Reset Heartbeat Timer
down
entry / Set Disconnected
exit / Set Connecting
trying
Connect
[Start]
/ Add Pins
/ Start Halrcmd Channel
Disconnect
[Stop]
/ Stop Halrcmd Channel
/ Stop Halrcomp Channel
/ Remove Pins
bind
Halrcmd Up
[Halrcmd State Up]
/ Bind Component
binding
Halrcomp Bind Msg Sent
[Halrcomp Bind Msg Sent]
syncing
No Bind
[No Bind]
/ Start Halrcomp Channel
Disconnect
[Stop]
/ Stop Halrcmd Channel
/ Stop Halrcomp Channel
/ Remove Pins
Halrcmd Trying
[Halrcmd State Trying] Bind Confirmed
[Halrcomp Bind Confirm Msg Received]
/ Start Halrcomp Channel
error
entry / Set Error
Bind Rejected
[Halrcomp Bind Reject Msg Received]
/ Stop Halrcmd Channel
Disconnect
[Stop]
/ Stop Halrcmd Channel
/ Stop Halrcomp Channel
/ Remove Pins
Halrcmd Trying
[Halrcmd State Trying]
/ Stop Halrcomp Channel
Sync Failed
[Halrcomp Error Msg Received]
/ Stop Halrcomp Channel
/ Stop Halrcmd Channel
synced
entry / Set Connected
Halrcomp Up
[Halrcomp State Up]
Disconnect
[Stop]
/ Stop Halrcmd Channel
/ Stop Halrcomp Channel
/ Remove Pins
Disconnect
[Stop]
/ Stop Halrcmd Channel
/ Stop Halrcomp Channel
/ Remove Pins
Halrcmd Trying
[Halrcmd State Trying]
/ Stop Halrcomp Channel
/ Unsync Pins
/ Set Timeout
Halrcomp Trying
[Halrcomp State Trying]
/ Unsync Pins
/ Set Timeout
Set Rejected
[Halrcomp Set Reject Msg Received]
/ Stop Halrcomp Channel
/ Stop Halrcmd Channel
Halrcomp Set Msg Sent
[Halrcomp Set Msg Sent]
down
trying
Start
[Start]
/ Start Socket
Stop
[Stop]
/ Stop Heartbeat Timer
/ Stop Socket
up
Full Update Received
[Full Update Msg Received]
/ Reset Heartbeat Liveness
/ Start Heartbeat Timer
Stop
[Stop]
/ Stop Heartbeat Timer
/ Stop Socket
Heartbeat Timeout
[Heartbeat Timeout]
/ Stop Heartbeat Timer
/ Stop Socket
/ Start Socket
Heartbeat Tick
[Heartbeat Tick]
/ Reset Heartbeat Timer
Any Msg Received
[* Msg Received]
/ Reset Heartbeat Liveness
/ Reset Heartbeat Timer
26. 26
Machinetalk Generic
● Generalizes
– machinetalk-protobuf
– machinetalk-gsl
● multiple “Machinetalks” can live side-by-side
● Adds project namespace/package
● Generate client and server base
30. 30
Example
import time
from pymachinetalk.dns_sd import ServiceDiscovery
import pymachinetalk.halremote as halremote
sd = ServiceDiscovery()
rcomp = halremote.RemoteComponent('anddemo', debug=False)
rcomp.newpin('button0', halremote.HAL_BIT, halremote.HAL_OUT)
rcomp.newpin('button1', halremote.HAL_BIT, halremote.HAL_OUT)
led_pin = rcomp.newpin('led', halremote.HAL_BIT, halremote.HAL_IN)
sd.register(rcomp)
sd.start()
try:
while True:
if rcomp.connected:
print('LED status %s' %s str(led_pin.value)
time.sleep(0.5)
except KeyboardInterrupt:
pass
sd.stop()