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

How do I communicate between 3 nodes ? (Arduino/QT/Sensors)

asked 2016-06-16 16:14:16 -0600

silverbullet gravatar image

I want to establish communication between an IMU sensor ( https://github.com/udmamrl/SpartonCom... ) and Arduino+QT. How should I proceed ? I am new to ROS and have read many tutorials but still it seems complicated. Can someone give a little overview on how to proceed with this ? Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-17 07:06:16 -0600

pablocesar gravatar image

updated 2016-06-17 08:50:10 -0600

ROS architecture brings several advantages, like being able to reuse the work or research (packages) developed by others. if you read a bit more about ROS ( http://wiki.ros.org/ROS/Introduction , http://wiki.ros.org/ROS/Technical%20O... ) way of working you will understand that you might be able to publish/subscribe (topics) or receive/response (services) to most running nodes, so, you should now identify how to subscribe your Arduino+QT to the:

Pos_pub  = rospy.Publisher('imu/HeadingTrue', Pose2D)
PosD_pub = rospy.Publisher('imu/HeadingTrue_degree', Pose2D)
Imu_pub = rospy.Publisher('imu/data', Imu)

topics (the topics are the first parameter inside the parenthesis ;-)). So, be aware of structuring your design, your ROS master must be running somewhere and all external nodes must be connected to it.

The Arduino has I/O pins to communicate to and from, but, you can't run ROS in an Arduino, so you must connect the Arduino to the "OS" where ROS Master is running and get the info from the messages. There is a package that does the trick for using Arduino with ROS ( http://wiki.ros.org/rosserial_arduino... ), just reed it and look at some projects in github that have use this package.

For QT, I don't see any problem if it is running in a device that can run ROS (Ubuntu). Qt is broadly used by the ROS (c++) community, so you can find plenty of info for configuring it for listening to ROS topics ( http://wiki.ros.org/qt_create/Tutoria... ).

Thanks for providing more info, it is not difficult to set up the project that you have in mind, please, structure your project architecture and start implementing it, if you still have doubts, then start from the basics, reed: https://www.intorobotics.com/ros-tuto...

edit flag offensive delete link more

Comments

Hi! Thanks for the response. Sure I can give you some more details. Basically I am working with OpenCV for image processing. The results of OpenCV(numerical values)should be communicated to arduino via ROS. But this communication is not direct, I am using a GUI based on QT to send it.

silverbullet gravatar image silverbullet  ( 2016-06-17 07:12:48 -0600 )edit

Then lastly I have this sensor( AHRS-8 ) which should be publishing information to Arduino. So I think my nodes in this case would be QT, Arduino and the sensor ? Since the sensor already has all the topics and stuff specified, I need to work on QT and Arduino's codes.

silverbullet gravatar image silverbullet  ( 2016-06-17 07:14:47 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-16 16:14:16 -0600

Seen: 743 times

Last updated: Jun 17 '16