How to add control algorithm in ROS
I get values from an analog sensor via rosserial and I want to add an if condition to glow the LED if the sensor reading exceeds the threshold value. How can I add the if condition in ROS to accomplish this?