如何启动Aldebaran ServiceManager?
How to initiate Aldebaran ServiceManager?
我想在我的应用程序运行期间通过 ServiceManager
停止和启动 ALTactileGesture
服务。我正在使用 Choregraphe
和 python 框。我尝试了不同的选项来启动 ServiceManager
,但其中 none 有效。有什么办法吗?
编辑:
我已经尝试过 self.sm = session.service('ServiceManager')
但没有成功。
想法是在应用启动后立即停止 ALTactileGesture
:
(1) ServiceManager.stopService('ALTactileGesture')
(见this)
和start/restartALTactileGesture
申请结束前:
(2) ServiceManager.startService('ALTactileGesture')
我的问题是如何达到 ServiceManager
以便我可以使用 (1) 和 (2)?
只需在机器人 shell 中尝试此操作(旧式代理连接):
$ python
import naoqi
s = naoqi.ALProxy("ALServiceManager", "localhost", 9559 )
s.stopService('ALTactileGesture')
>>> False
s.startService('ALTactileGesture')
>>> False # (a bit weird, but ...)
所以我认为它还不能完全正常工作,但至少你可以按要求连接到 ServiceManager...
你要明白,"service"这个词在NAOqi中其实是两个不同的意思。见 an explanation here:
NAOqi services (also called "modules"), that expose an API and are
registered to the ServiceDirectory. You can call them with qicli,
subscribe to their signals, etc.
systemd services, that are standalone executables packaged in an
Application Package, declared in it's manifest with a tag.
These are managed by ALServiceManager, who can start and stop them
(they will have their own process). For clarity's sake, these are
called "Executables" in this doc.
The confusion between the two is increased by the fact that a common
pattern is to write an executable whose sole purpose is to run a NAOqi
service, and sometimes to identify both with the same name (e.g. both
are called “ALFuchsiaBallTracker”).
您的问题是 NAOqi 服务 ALTactileGesture
是由在 ID ALTactileGesture-serv
下注册的可执行文件 运行。所以你需要做
ALServiceManager.stop("ALTactileGesture-serv")
(我刚测试过,没问题)
(edit) 顺便说一下,我不确定实际停止和启动 ALTactileGesture 是做你想做的事情的最好方法(对我来说这似乎有点老套),但是 如果你想那样做,就是这样:)
我想在我的应用程序运行期间通过 ServiceManager
停止和启动 ALTactileGesture
服务。我正在使用 Choregraphe
和 python 框。我尝试了不同的选项来启动 ServiceManager
,但其中 none 有效。有什么办法吗?
编辑:
我已经尝试过 self.sm = session.service('ServiceManager')
但没有成功。
想法是在应用启动后立即停止 ALTactileGesture
:
(1) ServiceManager.stopService('ALTactileGesture')
(见this)
和start/restartALTactileGesture
申请结束前:
(2) ServiceManager.startService('ALTactileGesture')
我的问题是如何达到 ServiceManager
以便我可以使用 (1) 和 (2)?
只需在机器人 shell 中尝试此操作(旧式代理连接):
$ python
import naoqi
s = naoqi.ALProxy("ALServiceManager", "localhost", 9559 )
s.stopService('ALTactileGesture')
>>> False
s.startService('ALTactileGesture')
>>> False # (a bit weird, but ...)
所以我认为它还不能完全正常工作,但至少你可以按要求连接到 ServiceManager...
你要明白,"service"这个词在NAOqi中其实是两个不同的意思。见 an explanation here:
NAOqi services (also called "modules"), that expose an API and are registered to the ServiceDirectory. You can call them with qicli, subscribe to their signals, etc.
systemd services, that are standalone executables packaged in an Application Package, declared in it's manifest with a tag. These are managed by ALServiceManager, who can start and stop them (they will have their own process). For clarity's sake, these are called "Executables" in this doc.
The confusion between the two is increased by the fact that a common pattern is to write an executable whose sole purpose is to run a NAOqi service, and sometimes to identify both with the same name (e.g. both are called “ALFuchsiaBallTracker”).
您的问题是 NAOqi 服务 ALTactileGesture
是由在 ID ALTactileGesture-serv
下注册的可执行文件 运行。所以你需要做
ALServiceManager.stop("ALTactileGesture-serv")
(我刚测试过,没问题)
(edit) 顺便说一下,我不确定实际停止和启动 ALTactileGesture 是做你想做的事情的最好方法(对我来说这似乎有点老套),但是 如果你想那样做,就是这样:)