Hi,

I am trying to build userspace hal components, and I am trying to build 
them with python.

I can find a lot of examples in the repository calling 
machinekit.rtapi.loadrt, but I have the vague idea of using 
machinekit.hal.loadusr

Until now the only solution i have found is something structured like this
#comp file
from machinekit import hal

comp=hal.component("name")
comp.newpin("a", HAL.IN , HAL.BIT)

while 1:
  comp["a"]=comp["b"]
  time.sleep(1)



and loading

hal.loadusr("comp")



Is this the way it should be used?

I know the hal.addf function, I would like to use it to load function on 
threads. Is it possible to export function from userspace components? I 
haven't found any way of exporting functions from python

I would like to write something like that
#comp file
from machinekit import hal

comp=hal.component("name")
#comp.newpin...

def foo():
  comp["a"]=comp["b"]

hal.export(foo)


hal.loadusr("comp")
hal.addf("foo","servo-thread")



Can you please give me some advice?

mngr












































-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/321cb3b5-7379-447e-8532-063f2e50e47c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to