Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 314

Bidirectional rosserial communication

$
0
0
Hello everyone, I am having some trouble regarding a program that connects a RPi3 with ROS and a UNO board. The idea is that the node in RPi advertises on a certain topic that UNO's node is suscribed to. Also, the other way around is meant with another topic, in which the UNO advertises. I have some trouble when defining the publisher on the UNO's code, I don't know if i should put something like: a) ros::Publisher pub_boton("topic", &message); b) ros::Publisher pub_boton = nh.advertise ("topic", 1000); I saw a) in many examples, but I don't find it in any official documentation. Another problem I have is that, when I try to publish a std_msgs/Int8, by doing: #include "std_msgs/Int8.h" std_msgs::Int8 message; int b=1; message.data=b; ros::Publisher pub_boton("topic",&message); I get the following error: **Nodo_rosserial_ultrasonicov2.ino:12:1: error: ‘message’ does not name a type** I don't get it, as I do specify the type of the message. Thank you in advance.

Viewing all articles
Browse latest Browse all 314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>