@@ -54,13 +54,13 @@ AssistedTeleopBehaviorTester::AssistedTeleopBehaviorTester()
54
54
node_->create_publisher <std_msgs::msg::Empty>(" preempt_teleop" , 10 );
55
55
56
56
cmd_vel_pub_ =
57
- node_->create_publisher <geometry_msgs::msg::Twist >(" cmd_vel_teleop" , 10 );
57
+ node_->create_publisher <geometry_msgs::msg::TwistStamped >(" cmd_vel_teleop" , 10 );
58
58
59
59
subscription_ = node_->create_subscription <geometry_msgs::msg::PoseWithCovarianceStamped>(
60
60
" amcl_pose" , rclcpp::QoS (rclcpp::KeepLast (1 )).transient_local ().reliable (),
61
61
std::bind (&AssistedTeleopBehaviorTester::amclPoseCallback, this , std::placeholders::_1));
62
62
63
- filtered_vel_sub_ = node_->create_subscription <geometry_msgs::msg::Twist >(
63
+ filtered_vel_sub_ = node_->create_subscription <geometry_msgs::msg::TwistStamped >(
64
64
" cmd_vel" ,
65
65
rclcpp::SystemDefaultsQoS (),
66
66
std::bind (&AssistedTeleopBehaviorTester::filteredVelCallback, this , std::placeholders::_1));
@@ -167,9 +167,9 @@ bool AssistedTeleopBehaviorTester::defaultAssistedTeleopTest(
167
167
counter_ = 0 ;
168
168
auto start_time = std::chrono::system_clock::now ();
169
169
while (rclcpp::ok ()) {
170
- geometry_msgs::msg::Twist cmd_vel = geometry_msgs::msg::Twist ();
171
- cmd_vel.linear .x = lin_vel;
172
- cmd_vel.angular .z = ang_vel;
170
+ geometry_msgs::msg::TwistStamped cmd_vel = geometry_msgs::msg::TwistStamped ();
171
+ cmd_vel.twist . linear .x = lin_vel;
172
+ cmd_vel.twist . angular .z = ang_vel;
173
173
cmd_vel_pub_->publish (cmd_vel);
174
174
175
175
if (counter_ > 1 ) {
@@ -265,9 +265,9 @@ void AssistedTeleopBehaviorTester::amclPoseCallback(
265
265
}
266
266
267
267
void AssistedTeleopBehaviorTester::filteredVelCallback (
268
- geometry_msgs::msg::Twist ::SharedPtr msg)
268
+ geometry_msgs::msg::TwistStamped ::SharedPtr msg)
269
269
{
270
- if (msg->linear .x == 0 .0f ) {
270
+ if (msg->twist . linear .x == 0 .0f ) {
271
271
counter_++;
272
272
} else {
273
273
counter_ = 0 ;
0 commit comments