Skip to content

Commit

Permalink
Test tweaks (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Oct 19, 2021
1 parent 6a9b6d6 commit 2c517c3
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
1 change: 1 addition & 0 deletions dolly/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<exec_depend>dolly_follow</exec_depend>
<exec_depend>dolly_gazebo</exec_depend>
<exec_depend>dolly_ignition</exec_depend>
<exec_depend>dolly_tests</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
1 change: 1 addition & 0 deletions dolly_ignition/launch/dolly.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def generate_launch_description():
)

# Spawn dolly
# TODO: expose pose as a launch argument
spawn = Node(package='ros_ign_gazebo', executable='create',
arguments=[
'-name', 'dolly',
Expand Down
1 change: 0 additions & 1 deletion dolly_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ if(BUILD_TESTING)
find_package(launch_testing_ament_cmake REQUIRED)
ament_find_gtest()

set("PROJECT_BINARY_PATH" ${CMAKE_CURRENT_BINARY_DIR})
set("PROJECT_SOURCE_PATH" ${CMAKE_CURRENT_SOURCE_DIR})
configure_file(test/constants.hh.in constants.hh @ONLY)

Expand Down
32 changes: 16 additions & 16 deletions dolly_tests/launch/follow_ignition_TEST.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@

def generate_test_description():

# Test fixture
gazebo_test_fixture = Node(
package='dolly_tests',
executable='follow_ignition_TEST',
output='screen'
)

# Spawn dolly
pkg_dolly_ignition = get_package_share_directory('dolly_ignition')
spawn = Node(package='ros_ign_gazebo', executable='create',
Expand All @@ -37,6 +44,15 @@ def generate_test_description():
'model.sdf')],
output='screen')

# Bridge
bridge = Node(
package='ros_ign_bridge',
executable='parameter_bridge',
arguments=['/dolly/cmd_vel@geometry_msgs/msg/[email protected]',
'/dolly/laser_scan@sensor_msgs/msg/[email protected]'],
output='screen'
)

# Follow node
follow = Node(
package='dolly_follow',
Expand All @@ -48,22 +64,6 @@ def generate_test_description():
]
)

# Bridge
bridge = Node(
package='ros_ign_bridge',
executable='parameter_bridge',
arguments=['/dolly/cmd_vel@geometry_msgs/msg/[email protected]',
'/dolly/laser_scan@sensor_msgs/msg/[email protected]',
'/dolly/odometry@nav_msgs/msg/[email protected]'],
output='screen'
)

# Test
gazebo_test_fixture = Node(
package='dolly_tests',
executable='follow_ignition_TEST',
output='screen'
)

return launch.LaunchDescription([
gazebo_test_fixture,
Expand Down
7 changes: 7 additions & 0 deletions dolly_tests/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<!-- ament -->
<depend>ament_cmake_gtest</depend>
<depend>ament_lint_auto</depend>
<depend>ament_lint_common</depend>

<!-- dolly -->
<depend>dolly_follow</depend>
<depend>dolly_ignition</depend>

<!-- ROS launch -->
<depend>launch_testing</depend>
<depend>ros2launch</depend>

<!-- gazebo -->
<depend>ros_ign_bridge</depend>

<!-- Fortress -->
Expand Down
1 change: 0 additions & 1 deletion dolly_tests/test/constants.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#ifndef DOLLY_TESTS__CONSTANTS_HH__
#define DOLLY_TESTS__CONSTANTS_HH__
#cmakedefine PROJECT_BINARY_PATH "@PROJECT_BINARY_PATH@"
#cmakedefine PROJECT_SOURCE_PATH "@PROJECT_SOURCE_PATH@"
#endif

2 changes: 1 addition & 1 deletion dolly_tests/test/follow_ignition_TEST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ TEST(DollyTests, Follow)
EXPECT_NE(ignition::gazebo::kNullEntity, targetEntity);
EXPECT_LT(0u, dollyPoses.size());

// Dolly hasn't moved, because simulation is paused
// Dolly hasn't moved yet
{
const auto & pose = dollyPoses.back();
EXPECT_NEAR(0.0, pose.Pos().X(), 1e-3);
Expand Down

0 comments on commit 2c517c3

Please sign in to comment.