Code Monkey home page Code Monkey logo

gazebojs's Introduction

gazebojs

This project offers NodeJs bindings for the Gazebo simulator (http://www.gazebosim.org/)

  • Gazebo must be installed first.
  • The version of gazebojs follows the version of Gazebo, so you should use gazebojs 6 if you have Gazebo 6 installed

Prerequisites

In addition to Gazebo, you must also install:

Setup

Here are the steps for Xenial

mkdir simjs
cd simjs

# install node and gazebo
sudo apt install -y gazebo7 libgazebo7-dev libjansson-dev npm nodejs nodejs-legacy 

# setup an empty node project 
npm init -y
npm install gazebojs

Please take a moment to look at the tutorials: http://gazebosim.org/tutorials?cat=gazebojs

Ubuntu and node

In Ubuntu Trusty (14.04), the default version of Node is 0.10.x. In Ubuntu Xenial (16.04), the default version of Node is 4.2.x

Node 0.10 is compatible with Gazebo 4 to 6, while 4.2.x is required for Gazebo 7 and up. Please refer to the installation tutorial http://gazebosim.org/tutorials?tut=gazebojs_install&cat=gazebojs for more details on how to change your version of Node.

gazebojs's People

Contributors

chapulina avatar dependabot[bot] avatar iche033 avatar mayman99 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

srmainwaring

gazebojs's Issues

node deprecation warning

Original report (archived issue) by Hugo Boyer (Bitbucket: hugomatic, GitHub: hugomatic).


npm install issues the following warning:


(node) child_process: options.customFds option is deprecated. Use options.stdio instead.


It is because of chilld_process code like this:


proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });

This happens with node v5.10.1

Fails to install on node 16.x

~/D/c/s/gazebo-js> yarn add gazebojs
yarn add v1.22.10
...
[4/4] ๐Ÿ”จ  Building fresh packages...
error /myproject/gazebo-js/node_modules/gazebojs: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /myproject/gazebo-js/node_modules/gazebojs
Output:
fs.js:47
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:47:5
    at req_ (/myproject/gazebo-js/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/myproject/gazebo-js/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/myproject/gazebo-js/node_modules/node-gyp/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Looks related: https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node-js

I'm on:
MacOS 11.4
Node.js 16.2.0
Gazebo 11

Failure to install gazebojs on Mac 10.11.6 under either Node 4.8.4 or Node 8.4.0

Original report (archived issue) by Khalid Adil (Bitbucket: Khalid Adil).


I have gazebo9 and other dependencies installed properly.

When I try to install gazebojs in a new node project after running npm init by doing:
npm install gazebojs --save

I end up with these errors:
https://cl.ly/3Z2m3q343x2Z/gazebojs_errors.png

When running node-gyp rebuild in the Node REPL, I see these errors:
https://cl.ly/pbWt/Image%202018-02-16%20at%205.53.01%20PM.png

Any idea what I may be doing wrong?

exiting gazebojs

Original report (archived issue) by Mohamd Ayman (Bitbucket: Mohamd Ayman).


I wasn't calling the unsubscribe function the right way, there is no use for this issue now, so if anyone would delete.

whenever i close gazebojs after subscribing to a topic i get this error msg

#!python

node: /usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::transport::Connection; typename boost::detail::sp_member_access<T>::type = gazebo::transport::Connection*]: Assertion `px != 0' failed.
Aborted (core dumped)

to reproduce:
-run gazebo
-run node -> var gazebojs = require("gazebojs") -> var gazebo = new gazebojs.Gazebo() -> gazebo.subscribe('gazebo.msgs.Model','~/model/info',console.log)
-insert any model into gazebo if you want to see the log
-close nodejs.

subscription works for a single message

Original report (archived issue) by Hugo Boyer (Bitbucket: hugomatic, GitHub: hugomatic).


The callback is not invoked afterwards.

This problem only happens on certain machines. To try to reproduce, setup a cemera in Gazebo and run the save_jpeg example.

NOTE:

I am not sure what causes the problem, but it looks like it can be circumvented if the gazebo instance is used in the loop at the end. It looks like the garbage collector is trying to delete the gazebo instance prematurely. The following code hides the problem:

#!python

console.log('setup a loop with 5 sec interval tick');
setInterval(function (){
  console.log('tick');
 
  // ADD THIS LINE TO HIDE THE PROBLEM
  var x = gazebo;

},1000);

Can't install GazeboJS with different versions of node and npm

Original report (archived issue) by Justine Lam (Bitbucket: koalaninja).


This is the error message with:

node -v v4.2.1
npm -v 1.2.18

Justines-MacBook-Pro:gz_node_inst justinelam$ npm install gazebojs
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/gazebojs
npm http 304 https://registry.npmjs.org/gazebojs
npm http GET https://registry.npmjs.org/node-gyp
npm http 304 https://registry.npmjs.org/node-gyp
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/osenv
npm http GET https://registry.npmjs.org/npmlog
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/osenv
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/npmlog
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/which
npm ERR! Error: No compatible version found: mkdirp@'^0.5.0'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.1.0","0.2.0","0.2.1","0.2.2","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.4.0","0.4.1","0.4.2","0.5.0","0.5.1"]
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:685:10)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:607:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Darwin 14.5.0
npm ERR! command "mailto:[email protected]">[email protected]

npm ERR! System Darwin 14.5.0 npm ERR! command "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install" "gazebojs" npm ERR! cwd /Users/justinelam/Sites/gazebo tutorial/gz_node_inst npm ERR! node -v v4.2.1 npm ERR! npm -v 1.2.18 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/justinelam/Sites/gazebo tutorial/gz_node_inst/npm-debug.log npm ERR! not ok code 0

npm ERR! npm -v 1.2.18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.