Fix bug that not to get expected data because use less timeout (#548)
Fix bug that not to get expected data because use less timeout (#548)

* Fix bug that not to get expected data because use less timeout

Signed-off-by: Barry Xu <a5cbcf23018c1d25ee2c369acefb36aa829b740e@sony.com>

* Use a more precise way to compare message data

Signed-off-by: Barry Xu <a5cbcf23018c1d25ee2c369acefb36aa829b740e@sony.com>

* Use loop with a time limit rather than a cycle count

Signed-off-by: Barry Xu <a5cbcf23018c1d25ee2c369acefb36aa829b740e@sony.com>

* update code to avoid error generated by flake8

Signed-off-by: Barry Xu <a5cbcf23018c1d25ee2c369acefb36aa829b740e@sony.com>
ros2/rclpy,ros2/rclpy