Robotics StackExchange | Archived questions

How to pass data to a node from an arduino board using rosserial?

Hi I am very new to ROS. I was going through this tutorial: http://wiki.ros.org/navigation/Tutorials/RobotSetup/Odom

Here i wanted to pass my vx, vy and th values from a arduino board using rosserial. Is it possible to do so? How to do it? The rosserial node publishes string msg, so i want to use it in this odometry publishing node.

EDIT ::

I have found a way to do this but have little problem with it. Posted a question relating it on this link. [http://answers.ros.org/question/190424/problem-with-subscribing-a-custom-message-publishing-topic/]

It would be great if you can help me with it.

Asked by Bhargav on 2014-08-15 18:07:40 UTC

Comments

You may want to look at http://wiki.ros.org/ros_arduino_bridge

Asked by ahendrix on 2014-08-15 19:39:30 UTC

Similarly, you can take a look at ros_arduino.

Asked by tonybaltovski on 2014-08-19 20:33:40 UTC

Answers

I solved this problem by referring to the publisher subscriber tutorial. Used rosserial to publish a node from arduino and a used a subscriber node to listen to these parameters. You can have a look at this answer [http://answers.ros.org/question/190424/problem-with-subscribing-to-a-custom-message-publishing-topic/]

Asked by Bhargav on 2014-08-19 15:00:23 UTC

Comments

In ROS parlance, parameters refer to the values you use to configure a node externally, usually during startup. You might want to edit the title or delete this question altogether to prevent confusion.

Asked by paulbovbel on 2014-08-19 15:35:41 UTC

I've updated the question appropriately

Asked by ahendrix on 2014-08-19 20:07:22 UTC

Bhargav, I wrote some weeks ago a small server/client program with Arduino. It is not more complicated than a pub/sub application. I used the example in this link: https://github.com/ros-drivers/rosserial/tree/indigo-devel/rosserial_embeddedlinux/src/examples/ExampleServiceClient I found it very useful and I could run a server on Arduino and a clinet in the PC and viceversa. I used it as servo controller. From the PC I could send the exact value to drive the servos. I m not at home now, but if you want I can send you tomorrow evening my code as example. Regards

Asked by Andromeda on 2014-08-19 16:50:41 UTC

Comments

hi, would you mind sending me the example? I am doing something very similar, but have been struggling with it for a few days now.

Asked by mugenzebra on 2014-08-26 16:30:12 UTC

yes of course, it is really simple but it works. How can I contact you? Your email is not visible to me.

Asked by Andromeda on 2014-08-27 11:56:54 UTC

@ Andromeda: I'm just learning to control a rc car via ros and arduino, so your code would be great help. How can I contact you ( pm ? ) ... thanks very much ...

Asked by scriptwriter on 2016-07-01 08:33:25 UTC

I have the code no more

Asked by Andromeda on 2016-08-02 00:44:19 UTC