21#include <geometry_msgs/msg/twist.hpp>
43 float linearStep = 0.15f,
float angularStep = 0.4f,
44 geometry_msgs::msg::Twist idleTwist = geometry_msgs::msg::Twist())
62 RCLCPP_ERROR(
getLogger(),
"[%s] CpKeyboardListener1 not found",
getName().c_str());
68 getLogger(),
"[%s] CpTopicPublisher<Twist> not found - create it in the orthogonal",
89 geometry_msgs::msg::Twist out;
92 std::lock_guard<std::mutex> lock(
mutex_);
93 auto now = std::chrono::steady_clock::now();
101 "[%s] publishing %s twist: linear=%.2f angular=%.2f",
getName().c_str(),
102 held ?
"held" :
"idle", out.linear.x, out.angular.z);
108 std::lock_guard<std::mutex> lock(
mutex_);
CbKeyboardTwistTeleop(float linearStep=0.15f, float angularStep=0.4f, geometry_msgs::msg::Twist idleTwist=geometry_msgs::msg::Twist())
geometry_msgs::msg::Twist heldTwist_
void onArrowPress(ArrowKey arrow)
std::optional< std::chrono::steady_clock::time_point > lastArrowTime_
smacc2::client_core_components::CpTopicPublisher< geometry_msgs::msg::Twist > * twistPublisher_
std::chrono::milliseconds deadman_
geometry_msgs::msg::Twist idleTwist_
components::CpKeyboardListener1 * keyboardListener_
void OnArrowPress(void(T::*callback)(ArrowKey arrow), T *object)
std::string getName() const
virtual rclcpp::Logger getLogger() const
virtual rclcpp::Node::SharedPtr getNode() const
void requiresComponent(SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
void publish(const MessageType &msg)