Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription Failure #158

Closed
eden-desta opened this issue Oct 28, 2020 · 5 comments
Closed

Subscription Failure #158

eden-desta opened this issue Oct 28, 2020 · 5 comments

Comments

@eden-desta
Copy link

eden-desta commented Oct 28, 2020

Hi everyone!
I was running the simple example and experimenting with different types of ROS messages when I had a failure trying to subscribe to a Joy data.

I am attaching my publisher.html and subscription.html for your to recreate.

For your reference -- the error ONLY occurs on subscription. without trying to subscribe to the Joystick data the publisher is able to happily publish the data with no problem (and i can echo it out in my terminal).

But this is my error below:

 Fatal error in , line 0
 Check failed: length == backing_store->byte_length().

#FailureMessage Object: 0x7fff5bb2cc10
 1: 0xacbb41  [node]
 2: 0x1aa66d4 V8_Fatal(char const*, ...) [node]
 3: 0xf23bba v8::internal::GlobalBackingStoreRegistry::Lookup(void*, unsigned long) [node]
 4: 0xc6256f  [node]
 5: 0xc62774 v8::ArrayBuffer::New(v8::Isolate*, void*, unsigned long, v8::ArrayBufferCreationMode) [node]
 6: 0x7f2ae45014af rclnodejs::CreateArrayBufferFromAddress(Nan::FunctionCallbackInfo<v8::Value> const&) [/home/eden/Desktop/nvs/webapp_ws/ros2-web-bridge/node_modules/rclnodejs/build/Release/rclnodejs.node]
 7: 0x7f2ae44f29ac  [/home/eden/Desktop/nvs/webapp_ws/ros2-web-bridge/node_modules/rclnodejs/build/Release/rclnodejs.node]
 8: 0xca1cfb  [node]
 9: 0xca32ac  [node]
10: 0xca3926 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x14c19b9  [node]
Illegal instruction (core dumped)

PUBLISHER

  const joy_data = {
    header: {
      stamp: {sec: 1603917727, nanosec: 208370251},
      frame_id: "joy",
    },
    axes: [0.2, 1.5, 8.9, 3.1],
    buttons: [1, 32],
  }

  const joy_publisher = new ROSLIB.Topic({
    ros: ros,
    name: '/joy_data',
    messageType : 'sensor_msgs/Joy',
  });

  setInterval(() => {
    joy_publisher.publish(joy_data);
  }, 1000);

SUBSCRIPTION

const joy_publisher = new ROSLIB.Topic({
    ros: ros,
    name: '/joy_data',
    messageType : 'sensor_msgs/Joy',
  });

  joy_publisher.subscribe(function(message) {
    document.getElementById("header").innerText = message.header.frame_id
  });
@minggangw
Copy link
Member

Hi @edesta-be thanks for reporting the issue, would you please offer your detailed env, e.g. ROS2/nodejs/rclnodejs version? I try to reproduce it on my local Linux host, but it seems workable.

My env is:

@eden-desta
Copy link
Author

eden-desta commented Oct 29, 2020

Env:
Node.js: v15.0.1
ROS2 Foxy Fitzroy -- Patch Release 3
Ubuntu 20.04
rclnodejs v0.16.0

Thank you @minggangw

@minggangw
Copy link
Member

Because rclnodejs, ROS2 Node.js client, hasn't been verified on Node.js higher than 12, I suggest you could downgrade your Node.js. Actually, there is some known issue (RobotWebTools/rclnodejs#713) on the higher version of Node.js

@eden-desta
Copy link
Author

Hi! Thank you for your help! I downgraded to 12.19.0 Node.js and it worked!

It might be worth investigating still but for the time being I am all set! Thank you for your time!

@minggangw
Copy link
Member

My pleasure, I will update here once it works on Node.js v14.x and v15.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants