do some mathematical calculation and algorithms on dynamic data
Hi all I have some dynamic data in ROS. I want to put them in an array or in a pointer and do realtime calculation on this data? Is there anybody help me?
Asked by Fi on 2015-06-06 22:28:23 UTC
Answers
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.
Asked by Fi on 2015-06-19 15:03:54 UTC
Comments
Please don't use answers to ask a question. If you'd like to provide additional information, edit your original question. When inserting code snippets you should either highlight the code and click the button with "101010" on it or press Ctrl+k. This will result in nicely formatted code.
Asked by jarvisschultz on 2015-06-20 11:17:04 UTC
Also, hopefully my answer to your other question no helps you get started.
Asked by jarvisschultz on 2015-06-20 11:18:36 UTC
Comments
Can you please give more details about what you have done and what you have to do?
Asked by Javier V. Gómez on 2015-06-08 01:41:44 UTC
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
Asked by Fi on 2015-06-09 10:37:13 UTC
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.
Asked by Javier V. Gómez on 2015-06-09 10:54:52 UTC
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
Asked by Fi on 2015-06-09 11:24:30 UTC
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/WritingPublisherSubscriber%28c%2B%2B%29 and adapt this to your needs.
Asked by Javier V. Gómez on 2015-06-09 12:11:01 UTC
In the future you would need something a bit more complex, like create your own spin thread and carry out expensive computations outside callbacks,
Asked by Javier V. Gómez on 2015-06-09 12:12:48 UTC
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?
Asked by Fi on 2015-06-18 16:35:30 UTC
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.
Asked by Javier V. Gómez on 2015-06-19 01:46:37 UTC