Hi RWT community,
I have a problem with uint8 array messages over rosbridge websocket to roslibjs. Instead of the array I put in the message the browser outputs weird stuff.
I publish a uint8[] array from the console with
$ rostopic pub /array std_msgs/UInt8MultiArray "layout:
dim:
- label: ''
size: 0
stride: 0
data_offset: 0
data: [1, 2]"
and print it in the browser with
var sub = new ROSLIB.Topic({
ros : ros,
name : '/array',
messageType : 'std_msgs/UInt8MultiArray'
});
sub.subscribe(function(msg) {
console.log(msg);
}
This results in this:
You see I get the string "AQI=". It isn't an array any more.
The array [0] results in "AA=="
With UInt16MultiArray it works as expected:
Tested with Chromium and Firefox on 14.04 and Indigo.
Is this a problem of the rosbridge or is this related to roslibjs? Any suggestions on how to solve this?