Skip to content

Commit

Permalink
Fix ackerman steering load controller
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Aug 20, 2024
1 parent 017e97e commit b092fc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 2 additions & 4 deletions ackermann_steering_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ if(BUILD_TESTING)
find_package(ros2_control_test_assets REQUIRED)


add_rostest_with_parameters_gmock(test_load_ackermann_steering_controller
test/test_load_ackermann_steering_controller.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/ackermann_steering_controller_params.yaml
)
add_definitions(-DTEST_FILES_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/test")
ament_add_gmock(test_load_ackermann_steering_controller test/test_load_ackermann_steering_controller.cpp)
ament_target_dependencies(test_load_ackermann_steering_controller
controller_manager
hardware_interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ TEST(TestLoadAckermannSteeringController, load_controller)

controller_manager::ControllerManager cm(
executor, ros2_control_test_assets::minimal_robot_urdf, true, "test_controller_manager");
const std::string test_file_path =
std::string(TEST_FILES_DIRECTORY) + "/ackermann_steering_controller_params.yaml";

ASSERT_NE(
cm.load_controller(
"test_ackermann_steering_controller",
"ackermann_steering_controller/AckermannSteeringController"),
nullptr);
cm.set_parameter({"test_ackermann_steering_controller.params_file", test_file_path});
cm.set_parameter(
{"test_ackermann_steering_controller.type",
"ackermann_steering_controller/AckermannSteeringController"});

ASSERT_NE(cm.load_controller("test_ackermann_steering_controller"), nullptr);
}

int main(int argc, char ** argv)
Expand Down

0 comments on commit b092fc7

Please sign in to comment.