Trying to have publisher and subscriber in same node.
I am quite new to ROS, hence my doubt. My project is as follows:
Arduino sends ultrasonic sensor data to my laptop. My laptop checks if the data is less than a value say 15.0. I want my laptop to send 1 (Bool) if it is less than 15 and 0 if it is more than 15 to the Arduino. The first half works, i.e. I can send data from Arduino to the laptop. But at the callback() function in my laptop_node, I am not able to publish a message to the Arduino. My Arduino also has a subscriber. What would be your approach to this problem? Could someone please send a sample code if possible?
Thanks.