Rosbridge: How to read value in from rostopic and set javascript variable
Hi, I am trying to figure out how to fetch the values coming back from a ros topic over the rosbridge. Below is the output of the topic when I echo it. I want to grab the width and height of the image output and assign them to javascript variables that I can later use to set a canvas width and height dynamically. Thanks in advance for help. -Scott
Here is the line I am using to try to subscribe to the topic over rosbridge connection.callService('/rosjs/subscribe', {data: ['/camera/rgb/camera_info', 2000]});
topic name: /camera/rgb/camera_info
Topic output on echo:
header: seq: 377284 stamp: secs: 1332175927 nsecs: 249637808 frame_id: /openni_rgb_optical_frame height: 480 width: 640 distortion_model: plumb_bob D: [0.0, 0.0, 0.0, 0.0, 0.0] K: [525.0, 0.0, 319.5, 0.0, 525.0, 239.5, 0.0, 0.0, 1.0] R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] P: [525.0, 0.0, 319.5, 0.0, 0.0, 525.0, 239.5, 0.0, 0.0, 0.0, 1.0, 0.0] binning_x: 0 binning_y: 0 roi: x_offset: 0 y_offset: 0 height: 0 width: 0