@transitive-sdk/utils-ros
v0.11.0
Published
Utils for using ROS with Transitive
Readme
ROS utils for Transitive
Install
npm i @transitive-sdk/utils-rosExample
const { ROSs, getForVersion } = require('@transitive-sdk/utils-ros');
const demo = async (version) => {
const ros = getForVersion(version);
await ros.init();
const topic = '/utils_ros/test1';
const type = version == 1 ? 'std_msgs/String' : 'std_msgs/msg/String';
const interval = setInterval(() => {
ros.publish(topic, type, {data: String(Date.now())});
});
const sub = ros.subscribe(topic, type, (msg) => {
console.log('received', msg.data);
});
};
demo(1); // ROS 1
demo(2); // ROS 2Running Tests
Before you can run tests you need to make sure all optional dependencies are installed which requires you to first source a ROS2 distribution (e.g., . /opt/ros/galactic/setup/.bash followed by npm i).
To run tests, start a roscore, then:
npm testChangelog
- v0.10: using [email protected] with pre-built binaries if possible (Humble+)
- v0.9: added support for ROS parameters
