Robotics StackExchange | Archived questions

How to send array of a msg type in a service call over rosbridge?

Hi all, I am trying to send an array of Points(x, y) of a mouse click on a canvas of image from a webbrowser to a ROS service. I am using rosbridge to communicate from a web interface to the ros-node. However I have no clue of how to send an array of the message type in my request call of Javascript. For a single click my code in javascript looks like this.

var request = new ROSLIB.ServiceRequest({
            click:{'x' : x , 'y' :y},
            });

However I want to enable multiple clicks and store it in a array/vector and send that in the request.

Note that: I have no fixed number of clicks in my interface. I want user to be able to click as many clicks as possible and then request for a service.

My system details: Ubuntu 12.04, ROS-groovy

Any comments or pointers would be helpful.

Thanks. Karthik

Asked by karthik on 2014-01-30 08:48:29 UTC

Comments

did you find a way to do that?

Asked by Mehdi. on 2014-04-09 18:40:18 UTC

Answers