I have been working on arduino and ros communication for few days and now I have an arduino code which have two subscribers as;
ros::Subscriber<std_msgs::UInt16> sub("red", redLED); ros::Subscriber<std_msgs::UInt16> sub2("yellow", yellowLED);
So, when I input "rostopic pub red -r 1 std_msgs/UInt16 1000" it lights up the LED then waits 1 second and turns it off and does that at 1 Hz.
What I want to do is writing a ros code so that when I press up key on keyboard, this rostopic I mentioned above will be sent or the subscriber will be called, however it works.
How can I do that, which topics do I have to look at? Keep in mind that I have no experience with ROS
Post score: 0