16 #ifndef BEHAVIORS__ASSISTED_TELEOP__ASSISTED_TELEOP_BEHAVIOR_TESTER_HPP_
17 #define BEHAVIORS__ASSISTED_TELEOP__ASSISTED_TELEOP_BEHAVIOR_TESTER_HPP_
19 #include <gtest/gtest.h>
25 #include "geometry_msgs/msg/pose_stamped.hpp"
26 #include "geometry_msgs/msg/pose_with_covariance_stamped.hpp"
27 #include "geometry_msgs/msg/twist_stamped.hpp"
28 #include "geometry_msgs/msg/pose.hpp"
29 #include "nav2_costmap_2d/costmap_topic_collision_checker.hpp"
30 #include "nav2_msgs/action/assisted_teleop.hpp"
31 #include "nav2_ros_common/node_thread.hpp"
32 #include "nav2_util/robot_utils.hpp"
33 #include "rclcpp_action/rclcpp_action.hpp"
34 #include "rclcpp/executors/single_threaded_executor.hpp"
35 #include "rclcpp/node.hpp"
36 #include "rclcpp/publisher.hpp"
37 #include "rclcpp/time.hpp"
38 #include "std_msgs/msg/empty.hpp"
40 #include "tf2/utils.hpp"
41 #include "nav2_ros_common/tf2_factories.hpp"
43 namespace nav2_system_tests
49 using AssistedTeleop = nav2_msgs::action::AssistedTeleop;
55 bool defaultAssistedTeleopTest(
69 void sendInitialPose();
71 void amclPoseCallback(geometry_msgs::msg::PoseWithCovarianceStamped::ConstSharedPtr);
73 void filteredVelCallback(geometry_msgs::msg::TwistStamped::ConstSharedPtr msg);
75 unsigned int counter_;
77 bool initial_pose_received_;
80 nav2::TransformBuffer::SharedPtr tf_buffer_;
81 nav2::TransformListener::SharedPtr tf_listener_;
83 rclcpp::Node::SharedPtr node_;
84 rclcpp::executors::SingleThreadedExecutor executor_;
87 rclcpp::Publisher<geometry_msgs::msg::PoseWithCovarianceStamped>::SharedPtr initial_pose_pub_;
88 rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr preempt_pub_;
89 rclcpp::Publisher<geometry_msgs::msg::TwistStamped>::SharedPtr cmd_vel_pub_;
92 nav2::Subscription<geometry_msgs::msg::PoseWithCovarianceStamped>::SharedPtr subscription_;
93 nav2::Subscription<geometry_msgs::msg::TwistStamped>::SharedPtr filtered_vel_sub_;
96 nav2::ActionClient<AssistedTeleop>::SharedPtr client_ptr_;
99 std::shared_ptr<nav2_costmap_2d::CostmapSubscriber> costmap_sub_;
100 std::shared_ptr<nav2_costmap_2d::FootprintSubscriber> footprint_sub_;
101 std::unique_ptr<nav2_costmap_2d::CostmapTopicCollisionChecker> collision_checker_;