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

asked 2014-01-30 07:48:29 -0500

karthik gravatar image

updated 2014-04-20 14:09:28 -0500

ngrennan gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-08-14 01:33:43.251978

Comments

did you find a way to do that?

Mehdi. gravatar image Mehdi.  ( 2014-04-09 18:40:18 -0500 )edit