Home | Tutorials | Wiki | Issues
Ask Your Question
0

Communicating between a Camera Plugin and a Model Plugin

asked 2013-05-02 16:11:28 -0500

Bharadwaj Ramesh gravatar image

My goal is to use the camera to plugin and develop a simple image processing program which finds a red ball in the frame and it determines the center position of the ball.

Once my camera determines these coordinates I need a model plugin to work based on the position of the ball. Basically determining the angle to turn.

Q1 ) How do i communicate between these two plugins ?

Q2 ) Are there tutorials for this ?

-Thanks Bharadwaj

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-05-03 12:23:49 -0500

scpeters gravatar image

You can communicate using gztopic messages using the gazebo::transport system. There are two example programs that use gazebo::transport, publisher and listener. You should be able to replicate this code in your plugins using gazebo's built-in protobuf message types to accomplish your goal. Feel free to keep asking if you need more guidance.

edit flag offensive delete link more

Comments

Hay scpeters : Thanks a lot ! THose are exactly the codes I am looking at. Thanks. I will basically be sending a angular data from my camera plugin to my model plygin, which I would expect to be a float data. But I see an integer type of message but not float or double type of message sendable. Should I be creating a custom message for this ?

Bharadwaj Ramesh gravatar imageBharadwaj Ramesh ( 2013-05-03 18:17:34 -0500 )edit

It would be easier to use a part of a Vector2d or Vector3d message.

scpeters gravatar imagescpeters ( 2013-05-03 20:02:38 -0500 )edit

I'm tryin to make a custom message using the following tutorial,but its not workin

https://bitbucket.org/osrf/gazebo/src/256f98f2318b/examples/plugins/custom_messages?at=default

I tried changing the main(the one that connects to the .cc file) CMakeLists.txt file to:

linkdirectories(${GAZEBOLIBRARYDIRS} ${CMAKECURRENTBINARYDIR}/msgs)

I did that change to CMake file from the following tutorial :

http://gazebosim.org/wiki/Tutorials/1.4/custom_messages do you kno wats wrong

Bharadwaj Ramesh gravatar imageBharadwaj Ramesh ( 2013-05-03 21:13:43 -0500 )edit

Hay cah you please check this post and help me with figuring what is wrong : http://answers.gazebosim.org/question/2676/simple-subscribing-plugin/

Bharadwaj Ramesh gravatar imageBharadwaj Ramesh ( 2013-05-04 10:03:35 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-05-02 16:11:28 -0500

Seen: 1,002 times

Last updated: May 03 '13