RethinkRobotics-opensource / Rosnodejs

Licence: apache-2.0
Client library for writing ROS nodes in JavaScript with nodejs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Rosnodejs

Awesome Robotic Tooling
Tooling for professional robotic development in C++ and Python with a touch of ROS, autonomous driving and aerospace.
Stars: ✭ 1,876 (+1193.79%)
Mutual labels:  robotics, ros, robot
Weloveinterns
中科院软件所智能软件中心实习生社区
Stars: ✭ 143 (-1.38%)
Mutual labels:  robotics, ros, robot
Free gait
An Architecture for the Versatile Control of Legged Robots
Stars: ✭ 263 (+81.38%)
Mutual labels:  robotics, ros, robot
Robotics setup
Setup Ubuntu 18.04, 16.04 and 14.04 with machine learning and robotics software plus user configuration. Includes ceres tensorflow ros caffe vrep eigen cudnn and cuda plus many more.
Stars: ✭ 110 (-24.14%)
Mutual labels:  robotics, ros, robot
Ev3dev Lang Java
A project to learn Java and create software for Mindstorms Robots using hardware supported by EV3Dev & the LeJOS way.
Stars: ✭ 79 (-45.52%)
Mutual labels:  robotics, ros, robot
ROS-TCP-Connector
No description or website provided.
Stars: ✭ 123 (-15.17%)
Mutual labels:  robot, robotics, ros
Dolly
🤖🐑 It's a sheep, it's a dolly, it's a following robot. Dolly was born to be cloned.
Stars: ✭ 113 (-22.07%)
Mutual labels:  robotics, ros, robot
Handeye calib camodocal
Easy to use and accurate hand eye calibration which has been working reliably for years (2016-present) with kinect, kinectv2, rgbd cameras, optical trackers, and several robots including the ur5 and kuka iiwa.
Stars: ✭ 364 (+151.03%)
Mutual labels:  robotics, ros, robot
Ros Academy For Beginners
中国大学MOOC《机器人操作系统入门》代码示例 ROS tutorial
Stars: ✭ 861 (+493.79%)
Mutual labels:  robotics, ros, robot
Fourth robot pkg
4号機(KIT-C4)用リポジトリ
Stars: ✭ 7 (-95.17%)
Mutual labels:  robotics, ros, robot
erwhi-hedgehog
Erwhi Hedgehog main repository
Stars: ✭ 31 (-78.62%)
Mutual labels:  robot, robotics, ros
Webots
Webots Robot Simulator
Stars: ✭ 1,324 (+813.1%)
Mutual labels:  robotics, ros, robot
Ros robotics projects
Example codes of new book ROS Robotics Projects
Stars: ✭ 240 (+65.52%)
Mutual labels:  robotics, ros, robot
erdos
Dataflow system for building self-driving car and robotics applications.
Stars: ✭ 135 (-6.9%)
Mutual labels:  robot, robotics, ros
Awesome Robotics
A curated list of awesome links and software libraries that are useful for robots.
Stars: ✭ 478 (+229.66%)
Mutual labels:  robotics, ros, robot
Rvd
Robot Vulnerability Database. An archive of robot vulnerabilities and bugs.
Stars: ✭ 87 (-40%)
Mutual labels:  robotics, ros, robot
Grl
Robotics tools in C++11. Implements soft real time arm drivers for Kuka LBR iiwa plus V-REP, ROS, Constrained Optimization based planning, Hand Eye Calibration and Inverse Kinematics integration.
Stars: ✭ 105 (-27.59%)
Mutual labels:  robotics, ros, robot
Navbot
Using RGB Image as Visual Input for Mapless Robot Navigation
Stars: ✭ 111 (-23.45%)
Mutual labels:  ros, robot
Iros20 6d Pose Tracking
[IROS 2020] se(3)-TrackNet: Data-driven 6D Pose Tracking by Calibrating Image Residuals in Synthetic Domains
Stars: ✭ 113 (-22.07%)
Mutual labels:  robotics, robot
Robotics Coursework
🤖 Places where you can learn robotics (and stuff like that) online 🤖
Stars: ✭ 1,810 (+1148.28%)
Mutual labels:  robotics, ros

rosnodejs Build Status

Install

npm install rosnodejs

Start a node

const rosnodejs = require('rosnodejs');
rosnodejs.initNode('/my_node')
.then(() => {
  // do stuff
});

Publish/Subscribe

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 transport (Experimental)

const nh = rosnodejs.nh;
const sub = nh.subscribe('/chatter', 'std_msgs/String', (msg) => {
  console.log('Got msg on chatter: %j', msg);
}, {
  transports: ["TCPROS", "UDPROS"],  // specify transports, default ["TCPROS"]
  dgramSize: 1500   // optional: datagram packet size, default: 1500 bytes
});

const pub = nh.advertise('/chatter', 'std_msgs/String');
pub.publish({ data: "hi" });

Services

const service = nh.advertiseService('/add_two_ints', 'beginner_tutorials/AddTwoInts', (req, res) => {
  res.sum = req.a + req.b;
  return true;
});

const client = nh.serviceClient('/add_two_ints', 'beginner_tutorials/AddTwoInts');
client.call({a: 1, b: 2});

Params

nh.setParam('val', 2);
nh.getParam('val')
.then((val) => {
  // do stuff
});

Generating Messages

Messages can be generated in a number of ways depending on the versions of ROS and Node.js you're using.

  • catkin - works in ROS Kinetic and later for Node.js v6+.
$ catkin_make
OR
$ catkin build
  • loadAllPackages() - One-time "build" call available through rosnodejs for versions of ROS before Kinetic and Node.js v6+. Should be called separately and in advance of processes attempting to use messages.
const rosnodejs = require('rosnodejs');
rosnodejs.loadAllPackages();
  • On the fly - all versions of ROS and Node.js 4.5+. When generating on the fly, messages can not be required until the node has initialized.
const rosnodejs = require('rosnodejs');
rosnodejs.initNode('my_node', { onTheFly: true }).then(() => {
  const stdMsgs = rosnodejs.require('std_msgs');
  ...
}
Pre-Kinetic Kinetic & Later
Node.js >= v6 loadAllPackages(), on the fly catkin, loadAllPackages(), on the fly
Node.js < v6 on the fly on the fly

Using Messages

const sensorMsgs = rosnodejs.require('sensor_msgs');

const image = new sensorMsgs.msg.Image();
const temperature = new sensorMsgs.msg.Temperature({ temperature: 32 });

const SetCameraInfo = sensorMsgs.srv.SetCameraInfo;
const setRequest = new SetCameraInfo.Request();

// messages can be used when advertising/subscribing
const nh = rosnodejs.nh;
const StringMsg = rosnodejs.require('std_msgs').msg.String;
const sub = nh.subscribe('/chatter', StringMsg, (msg) => { ... });
const pub = nh.advertise('/chatter', StringMsg);

const AddTwoInts = rosnodejs.require('beginner_tutorials').srv.AddTwoInts;
const service = nh.advertiseService('/add_two_ints', AddTwoInts, (req, res) => { ... });
const client = nh.serviceClient('/add_two_ints', AddTwoInts);

Actions (Experimental)

const nh = rosnodejs.nh;
const as = new rosnodejs.ActionServer({
  nh,
  type: 'turtle_actionlib/Shape',
  actionServer: '/turtle_shape'
});

as.on('goal', function (goal) {
  goal.setAccepted();
});

as.start();

const ac = new rosnodejs.ActionClient({
  nh,
  type: 'turtle_actionlib/Shape',
  actionServer:'/turtle_shape'
});

ac.sendGoal({edges: 3, radius: 1});

Run the turtlesim example

Start:

roscore
rosrun turtlesim turtlesim_node
rosrun turtle_actionlib shape_server

Then run

node src/examples/turtle.js

or, if you are running an older version of node:

npm run compile
node dist/examples/turtle.js

Catkin-Like

Checkout rosnodejs_examples for a more catkin-inspired take on using rosnodejs.

Inspired By

rosnodejs was inspired by other work that you can learn more about here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].