rosnodejs
安装
npm install rosnodejs
启动一个节点
const rosnodejs = require('rosnodejs');
rosnodejs.initNode('/my_node')
.then(() => {
// do stuff
});
发布/订阅
const nh = rosnodejs.nh;
const sub = nh.subscribe('/chatter', 'std_msgs/String', (msg) => {
console.log('Got msg on chatter: %j', msg);
});
const pub = nh.advertise('/chatter', 'std_msgs/String');
pub.publish({ data: "hi" });
UDP运输(实验性)
const nh
1