Skip to content

Commit

Permalink
[diff_drive] REwrite test and add simple validation (partial backport #…
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed May 9, 2024
1 parent fe07b83 commit a724a45
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 203 deletions.
6 changes: 3 additions & 3 deletions diff_drive_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ if(BUILD_TESTING)
find_package(ros2_control_test_assets REQUIRED)

ament_add_gmock(test_diff_drive_controller
test/test_diff_drive_controller.cpp
ENV config_file=${CMAKE_CURRENT_SOURCE_DIR}/test/config/test_diff_drive_controller.yaml)
test/test_diff_drive_controller.cpp)
target_link_libraries(test_diff_drive_controller
diff_drive_controller
)
Expand All @@ -69,8 +68,9 @@ if(BUILD_TESTING)
tf2_msgs
)

ament_add_gmock(test_load_diff_drive_controller
add_rostest_with_parameters_gmock(test_load_diff_drive_controller
test/test_load_diff_drive_controller.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/config/test_diff_drive_controller.yaml
)
ament_target_dependencies(test_load_diff_drive_controller
controller_manager
Expand Down
10 changes: 8 additions & 2 deletions diff_drive_controller/src/diff_drive_controller_parameter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ diff_drive_controller:
left_wheel_names: {
type: string_array,
default_value: [],
description: "Link names of the left side wheels",
description: "Names of the left side wheels' joints",
validation: {
not_empty<>: []
}
}
right_wheel_names: {
type: string_array,
default_value: [],
description: "Link names of the right side wheels",
description: "Names of the right side wheels' joints",
validation: {
not_empty<>: []
}
}
wheel_separation: {
type: double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ test_diff_drive_controller:
ros__parameters:
left_wheel_names: ["left_wheels"]
right_wheel_names: ["right_wheels"]
write_op_modes: ["motor_controller"]

wheel_separation: 0.40
wheels_per_side: 1 # actually 2, but both are controlled by 1 signal
Expand All @@ -21,7 +20,7 @@ test_diff_drive_controller:
open_loop: true
enable_odom_tf: true

cmd_vel_timeout: 500 # milliseconds
cmd_vel_timeout: 0.5 # seconds
publish_limited_velocity: true
velocity_rolling_window_size: 10

Expand Down
Loading

0 comments on commit a724a45

Please sign in to comment.