Skip to content

Commit

Permalink
Timer callback
Browse files Browse the repository at this point in the history
  • Loading branch information
akilpath committed May 9, 2024
1 parent 81be633 commit 15c8cb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/robot/control/include/control_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class ControlNode : public rclcpp::Node {

private:
robot::ControlCore control_;
rclcpp::TimerBase::SharedPtr timer_;
void timer_callback();

};

#endif
6 changes: 5 additions & 1 deletion src/robot/control/src/control_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

ControlNode::ControlNode(): Node("control"), control_(robot::ControlCore())
{

timer_ = this->create_wall_timer(std::chrono::milliseconds(1500), std::bind(&ControlNode::timer_callback, this));
}

void ControlNode::timer_callback(){
RCLCPP_INFO(this->get_logger(), "Timer callbakc");
}

int main(int argc, char ** argv)
Expand Down

0 comments on commit 15c8cb4

Please sign in to comment.