Thanks Javi
I understand publisher and subscriber. What is my problem is related to send a 2D matrix as messages. I saw the multiarray definition as a msg but I do not understand the application of it.
Can I define matrix[i][j] as a msg by multiarrays or not? If yes, how?
Do some calculation on each element of 2D matrix in a nested loop (outer loop :rowlength, inner loop:coloumlength) on a 2D matrix is my question
p.s.
for (i=0;i<rowlength;i++) for="" (j="1;j<coloumlength,j++)" mat[i][j]="do" some="" calculation="" on="" each="" element="" of="" it="" i="" never="" see="" the="" nested="" loop="" in="" ros.<="" p="">
Can you please give more details about what you have done and what you have to do?
I have some data from tactile sensors that will be changed during the execution. I want to read them continuously and then make some calculation on this data real-time and then send the some instruction to robot. For example: if (x>100) move right 1cm! x: amount of tactile sensor
And what have you done so far? Because a simple publisher-subscriber scheme should be enough (if the computations over the array are not too expensive) Check the tutorials, all you should do is to include your computation in the subscriber callback.
I am not expert in ROS! The calculation in this step is not high but it will be high in next steps. which section of tutorial? publisher?http://wiki.ros.org/roscpp/Overview/Publishers%20and%20Subscribers
Well, first of all, if you are not experienced in ROS, I recommend to go through all the beginner tutorials: http://wiki.ros.org/ROS/Tutorials And more specifically http://wiki.ros.org/ROS/Tutorials/Wri... and adapt this to your needs.
In the future you would need something a bit more complex, like create your own spin thread and carry out expensive computations outside callbacks,
Thanks Javi; Whould you please let me know the calculation of how amount of data can be done by a single publisher and subscribers? and what I should do for more computation?
I'm not sure I completely understand your question, but I think you are not understanding how ROS works. Publishers and subcribers are a mean to communicate among programs. Each program can do whatever you want it to do, they are just regular C++ programs.