-
Notifications
You must be signed in to change notification settings - Fork 381
Added Swerve Drive Controller Package #1694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nitin2606
wants to merge
11
commits into
ros-controls:master
Choose a base branch
from
nitin2606:feature/swerve-drive-controller
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
51c5c08
Add swerve_drive_controller package with tests and documentation
nitin2606 2cb3f0f
Merge branch 'ros-controls:master' into feature/swerve-drive-controller
nitin2606 89c269d
Merge branch 'ros-controls:master' into feature/swerve-drive-controller
nitin2606 a6b6ac7
Added Swerve Drive In mobile_robot_kinematics.rst and fixed CMakeList…
nitin2606 a146ff8
Merge branch 'ros-controls:master' into feature/swerve-drive-controller
nitin2606 369bfd3
Merge branch 'master' into feature/swerve-drive-controller
bmagyar 647b161
Apply suggestions from code review
bmagyar 8b72f06
Update swerve_drive_controller/src/swerve_drive_controller.cpp
nitin2606 ee8d704
Added Swerve Drive Kinematics in mobile_robot_kinematics.rst
nitin2606 5b7b077
Changed Wheel and Axle handles to unique_ptr
nitin2606 7c7c149
Code Refactoring
nitin2606 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(swerve_drive_controller) | ||
|
||
find_package(ros2_control_cmake REQUIRED) | ||
set_compiler_options() | ||
export_windows_symbols() | ||
|
||
set(THIS_PACKAGE_INCLUDE_DEPENDS | ||
controller_interface | ||
generate_parameter_library | ||
geometry_msgs | ||
hardware_interface | ||
nav_msgs | ||
pluginlib | ||
rclcpp | ||
rclcpp_lifecycle | ||
rcpputils | ||
realtime_tools | ||
tf2 | ||
tf2_msgs | ||
) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(backward_ros REQUIRED) | ||
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
find_package(${Dependency} REQUIRED) | ||
endforeach() | ||
add_compile_definitions(RCPPUTILS_VERSION_MAJOR=${rcpputils_VERSION_MAJOR}) | ||
add_compile_definitions(RCPPUTILS_VERSION_MINOR=${rcpputils_VERSION_MINOR}) | ||
|
||
generate_parameter_library(swerve_drive_controller_parameters | ||
src/swerve_drive_controller_parameter.yaml | ||
) | ||
|
||
add_library(swerve_drive_controller SHARED | ||
src/swerve_drive_controller.cpp | ||
src/swerve_drive_kinematics.cpp | ||
) | ||
|
||
target_compile_features(swerve_drive_controller PUBLIC cxx_std_17) | ||
target_include_directories(swerve_drive_controller PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include/swerve_drive_controller> | ||
) | ||
|
||
target_link_libraries(swerve_drive_controller | ||
PUBLIC | ||
swerve_drive_controller_parameters) | ||
ament_target_dependencies(swerve_drive_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
pluginlib_export_plugin_description_file(controller_interface swerve_drive_plugin.xml) | ||
|
||
if(BUILD_TESTING) | ||
|
||
find_package(controller_manager REQUIRED) | ||
find_package(ament_cmake_gmock REQUIRED) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
find_package(ros2_control_test_assets REQUIRED) | ||
|
||
ament_add_gtest(test_swerve_drive_controller | ||
test/test_swerve_drive_controller.cpp | ||
) | ||
|
||
target_link_libraries(test_swerve_drive_controller | ||
swerve_drive_controller | ||
) | ||
ament_target_dependencies(test_swerve_drive_controller | ||
geometry_msgs | ||
controller_interface | ||
hardware_interface | ||
nav_msgs | ||
rclcpp | ||
rclcpp_lifecycle | ||
realtime_tools | ||
tf2 | ||
tf2_msgs | ||
) | ||
|
||
add_definitions(-DTEST_FILES_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/test") | ||
ament_add_gmock(test_load_swerve_drive_controller test/test_load_swerve_drive_controller.cpp) | ||
ament_target_dependencies(test_load_swerve_drive_controller | ||
controller_manager | ||
ros2_control_test_assets | ||
) | ||
endif() | ||
|
||
install( | ||
DIRECTORY include/ | ||
DESTINATION include/swerve_drive_controller | ||
) | ||
|
||
install(TARGETS swerve_drive_controller swerve_drive_controller_parameters | ||
EXPORT export_swerve_drive_controller | ||
RUNTIME DESTINATION bin | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
) | ||
|
||
|
||
ament_export_libraries(swerve_drive_controller) | ||
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
ament_package() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.