Ros2 Qos Deadline usage
I am trying to get a watchdog timer running to see if my joystick is continously publishing. In another Question i got the hint to use QoS Deadline. I found one example but I cant get it working the way i want it to work. All I want is to start the topic_callback function to set a variable if the duration is longer than xx milliseconds.
My Joy_node publishes: pub_ = create_publisher<sensor_msgs::msg::Joy>("joy", rclcpp::QoS(10));
and I am checking it like this:
rclcpp::QoS qos_profile(10);
qos_profile.deadline(deadline_duration);
subscription_ = this->create_subscription<sensor_msgs::msg::Joy>(
"joy", qos_profile, std::bind(&JoyToVel::topic_callback, this, _1));
Its not doing anything until i set the deadline_duration to 0. Than it starts the topic_callback function. Does anyone know if there is just a simple coding failure or am I using the deadline feature completely wrong?
Thanks in advance!