Skip to content

Comments

Add gtest#7

Open
Taka-Kazu wants to merge 2 commits intoros2from
add-gtest
Open

Add gtest#7
Taka-Kazu wants to merge 2 commits intoros2from
add-gtest

Conversation

@Taka-Kazu
Copy link
Contributor

twist_to_roombactrl_converterのテストを追加しました

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テスト内でTwistToRoombactrlConverterクラスを使うために宣言をヘッダファイルに分離しました

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テスト内でTwistToRoombactrlConverterクラスを使うためにmain()を別ファイルに分離しました


TEST_F(TwistToRoombactrlConverterTest, cmd_vel)
{
rclcpp::executors::SingleThreadedExecutor executor;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1プロセスで2つのノードを動かすため、Executorを使っています

Comment on lines +63 to +65
EXPECT_EQ(received_control_->mode, roomba_500driver_meiji::msg::RoombaCtrl::DRIVE_DIRECT);
EXPECT_EQ(received_control_->cntl.linear.x, twist_msg->linear.x);
EXPECT_EQ(received_control_->cntl.angular.z, twist_msg->angular.z);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node_がpublishしたTwistに対して、converter_nodeがpublishした(node_が受け取った)RoombaCtrlの中身が意図したものになっているか確認しています

Comment on lines +57 to +62
while (rclcpp::ok()) {
if (received_control_) {
break;
}
executor.spin_once();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node_がRoombaCtrlを受け取るまでspinしています

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant