15 #include <std_msgs/UInt16.h> 21 #elif defined(TARGET_KL25Z) || defined(TARGET_NUCLEO_F401RE) 24 #error "You need to specify a pin for the Servo" 26 DigitalOut
myled(LED1);
28 void servo_cb(
const std_msgs::UInt16& cmd_msg) {
29 servo.position(cmd_msg.data);
void servo_cb(const std_msgs::UInt16 &cmd_msg)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::Subscriber< std_msgs::UInt16 > sub("servo", servo_cb)