ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Arduino Publisher/Suscriber for Gazebo

asked 2012-11-12 21:55:33 -0500

monidiaz gravatar image

updated 2012-11-13 06:51:47 -0500

SL Remy gravatar image

I have a program in arduino that is reading the values from a flex sensor, and publish them in a topic like the Example in here/Rosserial_arduino/publisher.

Now I need to send that values to gazebo, to move a 3D object. I tried to make a suscriber like all the examples in rosserial_arduino tutorials, and like the examples of ROS tutorials but the question is that in all the examples the suscriber and the Publisher are .cpp files and in this case the publisher is the arduino that is a .ino file. Anyway tried to make a file .cpp for the suscriber, and add the line

rosbuild_add_executable(listener src/listener.cpp)

in the Cmakelists.txt but of course here is an error cause he didn't find the topic that he is trying to suscribe.

Really I don't know how to communicate the arduino with gazebo. or create a suscriber that i can use in gazebo that listen the publication of arduino.

edit retag flag offensive close merge delete


Move a 3D object how? What is the type of the message are you currently publishing?

SL Remy gravatar image SL Remy  ( 2012-11-13 02:41:48 -0500 )edit

Actually i have a kind of hand, made by boxes, each one of the parts of the fingers is a diferent box, is defined in a .urdf file with joints,etc. The type of message i'm publishin' is a float. is a value that gives me the sensor.

monidiaz gravatar image monidiaz  ( 2012-11-13 02:44:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-13 06:50:33 -0500

SL Remy gravatar image

updated 2012-11-15 01:11:26 -0500

Better answer found to this question

I have not done this myself.. It's on the list though... I think that the closest tutorial out there to a what you'd like to do (right now) is the control_model tutorial. (The animate_joint tutorial does something a little different.) You also should take a look at how the simple_arm.model is set up. You'd to add the logic to subscribe to the topic(s) that have the control information.

The essence of what you're asking has been done (in urdf not sdf) in the sr_hand package, so I would also take a look at their tutorials, and their source code.

edit flag offensive delete link more

Question Tools


Asked: 2012-11-12 21:55:33 -0500

Seen: 534 times

Last updated: Nov 15 '12