You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did 'roscore','roslaunch rosbridge_server rosbridge_websocket.launch', and played an appropriate rosbag file, which has a topic named '/os1_node/points'.
But the browser console makes an error "Uncaught Cannot process BSON encoded message without BSON header." at roslib.min.js:1.
The cbor-compressed message can't be decoded because the error comes out even before the function called in listener.subscribe() works.
Thank you.
The text was updated successfully, but these errors were encountered:
This is happening because the CDN version of roslibjs has not been updated with CBOR support. You can try building roslibjs from the develop branch and loading that instead, or wait for the next release which is currently in progress.
Thank you for answer. I built from the develop branch and did the same thing but same error occurs. Is there a code using cbor compression that I can refer to?
I wrote a simple code like below and included it in an html file.
<script type="text/javascript" src="http://static.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<script type="text/javascript" src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"></script>
<script src="bower_components/cbor/cbor.js" type="text/javascript"></script>
<script>
var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});
ros.on('connection', function() {
console.log('Connected to websocket server.');
});
ros.on('error', function(error) {
console.log('Error connecting to websocket server: ', error);
});
ros.on('close', function() {
console.log('Connection to websocket server closed.');
});
var listener = new ROSLIB.Topic({
ros : ros,
name : '/os1_node/points',
messageType : 'sensor_msgs/PointCloud2',
compression : 'cbor',
});
console.log(listener);
listener.subscribe(
function(message) {
}
);
</script>
I did
'roscore',
'roslaunch rosbridge_server rosbridge_websocket.launch'
, and played an appropriaterosbag
file, which has a topic named'/os1_node/points'
.But the browser console makes an error "Uncaught Cannot process BSON encoded message without BSON header." at roslib.min.js:1.
The cbor-compressed message can't be decoded because the error comes out even before the function called in listener.subscribe() works.
Thank you.
The text was updated successfully, but these errors were encountered: