Javascript 节点dbus中的setVariable

Javascript 节点dbus中的setVariable,javascript,node.js,dbus,Javascript,Node.js,Dbus,首先,对不起,我的英语很差 今年圣诞节我收到了百里香。为了好玩,我把我的机器人和一个树莓圆周率挂钩。 根据Thymio文档,我们可以使用DBU与该机器人通信 我想使用Node.js远程访问我的Thymio,所以我找到了Node dbus库并帮助我 实际上,我可以通过以下方法获得Thymio的变量值: aseba.GetVariable("thymio-II", "prox.ground.ambiant",function(error,data){}); 但我不能为移动我的机器人设置变量。在Py

首先,对不起,我的英语很差

今年圣诞节我收到了百里香。为了好玩,我把我的机器人和一个树莓圆周率挂钩。 根据Thymio文档,我们可以使用DBU与该机器人通信

我想使用Node.js远程访问我的Thymio,所以我找到了Node dbus库并帮助我

实际上,我可以通过以下方法获得Thymio的变量值:

aseba.GetVariable("thymio-II", "prox.ground.ambiant",function(error,data){});
但我不能为移动我的机器人设置变量。在Python中,此脚本可以工作:

network.SetVariable(“thymio II”,“motor.left.target”,[300])
但是在Node.js中:


嗯,
aseba.SetVariable(“thymio II”,“motor.left.target”,[300])
是正确的调用方式-签名是“ssaq”:
SetVariable(String nodeName,String variableName,Array variableData)
在发布堆栈跟踪之前有任何消息吗?不幸的是,没有,我以前没有任何错误。我找到了函数setVariable的代码:
function(){//如果(sent)返回则防止双重回调;sent=true;var args=toArray(参数);debug('sending ack%j',args);var type=hasBin(args)?parser.BINARY\u ack:parser.ack;self.packet({type:type,id:id,data:args})}
带“toArray”,我认为
aseba.SetVariable(“thymio II”,“motor.left.target”,300)应该工作,但没有…设置变量
代码来自哪里?thymio sdk?在thymio sdk或dbus中,我不知道dbus。我使用“console.log(aseba.setVariable)”跟踪函数以查找此代码。在节点dbus库中没有出现“setVariable”getService(destination).getInterface(字符串,字符串,函数(){})。是将我连接到DBU的好方法吗?没有其他方法了?您可以使用dbus内省和脚本自动生成js代码。
aseba.SetVariable("thymio-II", "motor.left.target",[300]);
events.js:72 throw er; // Unhandled 'error' event ^ Error: write EPIPE at errnoException (net.js:905:11) at Object.afterWrite (net.js:721:19)
aseba.SetVariable("thymio-II", "motor.left.target",300);