10#ifndef _UPDATE_MODE_HPP
11#define _UPDATE_MODE_HPP
13#include <behaviortree_cpp/action_node.h>
17#include <joy_common_msgs/msg/joy.hpp>
18#include <rclcpp/rclcpp.hpp>
19#include <std_msgs/msg/string.hpp>
41 const std::string & name,
const BT::NodeConfig & config,
42 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr logger_pub,
43 rclcpp::Node::SharedPtr ros_node, uint64_t timeout_ms);
60 BT::NodeStatus
tick()
override;
68 bool _check_value(std::variant<bool, double> value);
70 rclcpp::Node::SharedPtr ros_node_;
71 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr logger_pub_;
72 rclcpp::Subscription<joy_common_msgs::msg::Joy>::SharedPtr joy_sub_;
73 joy_common_msgs::msg::Joy::SharedPtr joy_msg_;
76 joy_common::ButtonMap::iterator manual_it, auto_it;
79 std::shared_ptr<timer::Timeout> timeout_;
Action node to update the robot's operation mode based on Joystick input.
Definition: update_mode.hpp:31
BT::NodeStatus tick() override
Checks joystick state and updates the mode.
Definition: update_mode.cpp:72
static BT::PortsList providedPorts()
Defines the input and output ports for this node.
Definition: update_mode.cpp:63
std::map< std::string, std::function< ButtonValue(const joy_common_msgs::msg::Buttons &)> > ButtonMap
Definition: joy_common.hpp:24