Integration tests for the DriveBot ROS 2 service node.
More...
|
| void | SetUp () override |
| | Sets up the test environment with DriveBot server and test client.
|
| |
| void | TearDown () override |
| | Tears down the test environment.
|
| |
| template<typename FutureT> |
| bool | spinUntilComplete (FutureT &future, std::chrono::seconds timeout=std::chrono::seconds(2)) |
| | Spins the executor until a future resolves or timeout elapses.
|
| |
|
|
std::shared_ptr< robot_control::ball_chaser::DriveBot > | m_server |
| | DriveBot service node being tested.
|
| |
|
std::shared_ptr< rclcpp::Node > | m_client |
| | Test client node.
|
| |
|
rclcpp::Client< DriveToTarget >::SharedPtr | m_requester |
| | Client to call the DriveToTarget service.
|
| |
|
rclcpp::executors::SingleThreadedExecutor | m_executor |
| | Executor to spin nodes during tests.
|
| |
Integration tests for the DriveBot ROS 2 service node.
Tests verify that the DriveBot service:
- Is properly advertised and discoverable
- Echoes requested velocities in the response
- Publishes velocity commands to /cmd_vel topic
◆ SetUp()
| void DriveBotTest::SetUp |
( |
| ) |
|
|
inlineoverrideprotected |
Sets up the test environment with DriveBot server and test client.
Initializes the DriveBot node, a test client node, creates the service requester, and registers both nodes with the executor.
◆ spinUntilComplete()
template<typename FutureT>
| bool DriveBotTest::spinUntilComplete |
( |
FutureT & | future, |
|
|
std::chrono::seconds | timeout = std::chrono::seconds(2) ) |
|
inlineprotected |
Spins the executor until a future resolves or timeout elapses.
- Template Parameters
-
| FutureT | Type of the future (deduced). |
- Parameters
-
| future | Future to wait for completion. |
| timeout | Maximum time to wait (default 2 seconds). |
- Returns
- True if the future completed, false if timeout elapsed.
◆ TearDown()
| void DriveBotTest::TearDown |
( |
| ) |
|
|
inlineoverrideprotected |
Tears down the test environment.
Removes both the server and client nodes from the executor for cleanup.
The documentation for this class was generated from the following file:
- src/robot_control/tests/integration/ball_chaser/test_drive_bot.cpp