Skip to content
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

pi3hat hardware interface #14

Merged
merged 137 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
80647d6
Created pi3hat package and copied moteus and pi3hat srource code
BartlomiejK2 Jul 5, 2024
9f03de1
Removed unused files
BartlomiejK2 Jul 5, 2024
a7aafa8
Added standard exceptions
BartlomiejK2 Jul 5, 2024
dd71d0a
Added base wrapper and for moteus actuator
BartlomiejK2 Jul 5, 2024
8f7950c
Changed directory to actuator_wrappers
BartlomiejK2 Jul 6, 2024
bb0752e
Created Transmission and JointActuatorTransform classes
BartlomiejK2 Jul 6, 2024
51daf54
Modified wrapper classes
BartlomiejK2 Jul 6, 2024
4130827
Fixed directories for source code
BartlomiejK2 Jul 6, 2024
dc7abb3
Added comments to code
BartlomiejK2 Jul 6, 2024
0a55027
Added offsets to joints
BartlomiejK2 Jul 7, 2024
23ccbdb
Added first iteration of header file
BartlomiejK2 Jul 7, 2024
61b9d90
Added visibility control
BartlomiejK2 Jul 7, 2024
92b3609
Changed names for wrappers and pi3hat
BartlomiejK2 Jul 8, 2024
487d009
First iteration of pi3hat cpp file
BartlomiejK2 Jul 8, 2024
d5fe519
Added MotorState and working on hardware interface
BartlomiejK2 Jul 8, 2024
0d51339
Making changes for MotorState struct
BartlomiejK2 Jul 8, 2024
a4be754
Name changes
BartlomiejK2 Jul 9, 2024
3188ebc
Changed interface for actuator wrappers
BartlomiejK2 Jul 10, 2024
0ea879b
Added reading state from RX CAN frame
BartlomiejK2 Jul 11, 2024
367376b
Added init to actuator wrappers and edited pi3hat interface
BartlomiejK2 Jul 11, 2024
dc9cf42
Added test for controlling 1 moteus actuator
BartlomiejK2 Jul 12, 2024
7ad0254
Fixed small problems
BartlomiejK2 Jul 12, 2024
4f76197
Testing
BartlomiejK2 Jul 12, 2024
d5339fe
Changed bus
BartlomiejK2 Jul 12, 2024
9b72ecf
Testing
BartlomiejK2 Jul 12, 2024
e40f570
Testing
BartlomiejK2 Jul 12, 2024
21d7ade
Testing
BartlomiejK2 Jul 12, 2024
bdbf1ef
Testing
BartlomiejK2 Jul 12, 2024
c81c077
Testing
BartlomiejK2 Jul 13, 2024
4a03fa8
Added new states for actuator wrapper and new function for creating w…
BartlomiejK2 Jul 13, 2024
60674b7
Added IMUTransform object
BartlomiejK2 Jul 14, 2024
0cb51f6
Modified wrappers
BartlomiejK2 Jul 14, 2024
52ec030
Modified pi3hat hardware interface
BartlomiejK2 Jul 14, 2024
ebad618
Added interface for creating transmissions
BartlomiejK2 Jul 15, 2024
63ce53f
Added simple example
BartlomiejK2 Jul 16, 2024
c027773
Quick update
BartlomiejK2 Jul 16, 2024
1eee040
Starting making transmission interface
BartlomiejK2 Jul 17, 2024
7f3ab3e
Define function for SimpleTransmission and utility transmission funct…
BartlomiejK2 Jul 18, 2024
5698465
Testing
BartlomiejK2 Jul 19, 2024
f570131
Testing
BartlomiejK2 Jul 19, 2024
cdc77d8
Testing
BartlomiejK2 Jul 19, 2024
3b72fdf
Testing
BartlomiejK2 Jul 19, 2024
d53d71c
Fixed wrappers
BartlomiejK2 Jul 19, 2024
cf19da9
Updated main_test
BartlomiejK2 Jul 19, 2024
5ce2bc9
Updated main_test
BartlomiejK2 Jul 19, 2024
1636e6d
Updated main_test
BartlomiejK2 Jul 19, 2024
757deb0
Changed command to tx_frame
BartlomiejK2 Jul 19, 2024
4b3e0d8
Edited tests
BartlomiejK2 Jul 19, 2024
c48d1f2
Added sleep to test
BartlomiejK2 Jul 19, 2024
f444c57
Tests edited
BartlomiejK2 Jul 19, 2024
85d5b19
Tests edited
BartlomiejK2 Jul 19, 2024
1761ed3
Tests edited
BartlomiejK2 Jul 19, 2024
30d09cc
Single wrapper tested
BartlomiejK2 Jul 19, 2024
08527e9
Quick fix
BartlomiejK2 Jul 19, 2024
f5a2b52
Quick fix
BartlomiejK2 Jul 19, 2024
caaf397
Removed useless imports
BartlomiejK2 Jul 19, 2024
bf6bc3e
Edited transmissions loading
BartlomiejK2 Jul 20, 2024
d2afc11
Added loader for fourbarlinkage transmission
BartlomiejK2 Jul 21, 2024
a28760a
Added differential transmision loader
BartlomiejK2 Jul 21, 2024
740d3fe
Defined transmissions loader funtions
BartlomiejK2 Jul 21, 2024
d887b21
Added hrdware test for two motors
BartlomiejK2 Jul 22, 2024
26ed345
Fixed segfault
BartlomiejK2 Jul 22, 2024
606ecb7
Moved tests directory
BartlomiejK2 Jul 23, 2024
beaca58
Edited actuator wrappers
BartlomiejK2 Jul 23, 2024
6f188fa
Added actuator creation in init method
BartlomiejK2 Jul 23, 2024
eaccd06
Small edits
BartlomiejK2 Jul 24, 2024
012d0c3
Refactoring controller pi3hat interface
BartlomiejK2 Jul 26, 2024
d79a94d
Renaming
BartlomiejK2 Jul 26, 2024
95bd945
Updated tests
BartlomiejK2 Jul 26, 2024
5629a97
Name changing and added directory for 3rd party libraries
BartlomiejK2 Jul 26, 2024
79db0e7
Few fixes, refactoring init function
BartlomiejK2 Jul 26, 2024
2362b91
Removed changes
BartlomiejK2 Jul 26, 2024
5241294
Changed controller bridge
BartlomiejK2 Jul 27, 2024
ac3d566
Implemented on_configure() and added new helper functions
BartlomiejK2 Jul 27, 2024
6132fe4
Updated tests
BartlomiejK2 Jul 28, 2024
ae5724d
Finished implementation of pi3hat interface, time for tests
BartlomiejK2 Jul 28, 2024
2793afa
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
9c61566
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
3b335b7
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
c5baa3e
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
34f7117
Fixed controller wrappers, fixing tests
BartlomiejK2 Jul 29, 2024
c7dbae0
Fixing includes
BartlomiejK2 Jul 29, 2024
b2cc333
Fixing includes
BartlomiejK2 Jul 29, 2024
0c8e76e
Added config file
BartlomiejK2 Jul 29, 2024
291d02f
Fixed CMake
BartlomiejK2 Jul 29, 2024
b9803bf
Fixed compilation errors
BartlomiejK2 Jul 29, 2024
db79f58
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
a17420a
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
b5c6268
Fixing compilation errors
BartlomiejK2 Jul 29, 2024
17a8030
Changed directory for tests
BartlomiejK2 Jul 29, 2024
ba0bf2b
Edited pi3hat interface, compilation successful
BartlomiejK2 Jul 29, 2024
93463b8
Added urdf tests
BartlomiejK2 Jul 29, 2024
94b0880
Adding default constructors for wrappers and edited starting controll…
BartlomiejK2 Jul 30, 2024
ed2df70
Edited single_motor_test urdf
BartlomiejK2 Jul 31, 2024
1a619ec
Changed constructor for MoteusWrapper class
BartlomiejK2 Aug 1, 2024
c337c61
Fixed issiue with moving wrappers to bridge
BartlomiejK2 Aug 2, 2024
f76d35d
Changing pointer to moteus_controller object
BartlomiejK2 Aug 2, 2024
c317db7
Changed strategy for making moteus wrappers
BartlomiejK2 Aug 2, 2024
df988b2
Fixing moteus issiue
BartlomiejK2 Aug 2, 2024
9b9d48a
Fixing moteus issiue
BartlomiejK2 Aug 2, 2024
6eca905
Fixing moteus issiue
BartlomiejK2 Aug 2, 2024
6f55e66
Added second test for moteus controller
BartlomiejK2 Aug 2, 2024
2bf5ad2
Edited second test for moteus controller
BartlomiejK2 Aug 2, 2024
18c059a
Added test for moteus wrapper
BartlomiejK2 Aug 2, 2024
dab498d
Fixed MoteusWrapper constructor
BartlomiejK2 Aug 2, 2024
e79d33e
Got back to Edited single_motor_test urdf
BartlomiejK2 Aug 2, 2024
7748548
Added function for creating moteus wrapper
BartlomiejK2 Aug 2, 2024
ede35a2
Changed make_moteus_wrapper
BartlomiejK2 Aug 2, 2024
1cfa3a5
Changed make_moteus_wrapper
BartlomiejK2 Aug 2, 2024
3893689
Fixed moteus wrapper error
BartlomiejK2 Aug 2, 2024
9c9ca20
Making tests for pi3hat_hardware_interface
BartlomiejK2 Aug 2, 2024
02e9071
Fixed Cmake
BartlomiejK2 Aug 2, 2024
cf555ee
Changed launch file
BartlomiejK2 Aug 2, 2024
14790b8
Editing launchfiles
BartlomiejK2 Aug 2, 2024
87b2c67
Editing launchfiles
BartlomiejK2 Aug 2, 2024
38066e0
New changes for testing on pi3hat
BartlomiejK2 Aug 3, 2024
e663efc
Changed CMake file
BartlomiejK2 Aug 4, 2024
a648bce
Fixing includes
BartlomiejK2 Aug 4, 2024
9787b48
Changes for launch tests and pi3hat interface
BartlomiejK2 Aug 4, 2024
4174ecd
Finished tests for pi3hat, all passed!
BartlomiejK2 Aug 5, 2024
f7d5886
Cleaned up pi3hat_interface
BartlomiejK2 Aug 6, 2024
4161759
Removed start_up, added make_query
BartlomiejK2 Aug 7, 2024
495d3bf
Added 0 initialization to controller structures
BartlomiejK2 Aug 7, 2024
92d9d0c
Changed initialization for motors and getting ids from motors
BartlomiejK2 Aug 7, 2024
a154542
Updated tests
BartlomiejK2 Aug 7, 2024
49493f0
Cleaned CMakeLists
BartlomiejK2 Aug 8, 2024
7c80bfb
Renamed tests for controller bridges
BartlomiejK2 Aug 8, 2024
02af7e2
Added function for controller bridge
BartlomiejK2 Aug 9, 2024
2d770ee
Changed start for motors and added params for can buses
BartlomiejK2 Aug 9, 2024
61b912d
Changed constructor for ControllerBridge
BartlomiejK2 Aug 9, 2024
ec32ad7
Changed tests
BartlomiejK2 Aug 9, 2024
7f54d6f
Removed controller bridge creation for constructor
BartlomiejK2 Aug 9, 2024
cc94e84
Removed old code
BartlomiejK2 Aug 9, 2024
bd8eec1
Added license to files and documented code
BartlomiejK2 Aug 9, 2024
ea096aa
Removed commented code
BartlomiejK2 Aug 9, 2024
f6aa599
Changed LICENSE
BartlomiejK2 Aug 9, 2024
2e9444a
Added README.md
BartlomiejK2 Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions src/meldog_hardware/pi3hat_hardware_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
cmake_minimum_required(VERSION 3.8)
project(pi3hat_hardware_interface)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies

set(THIS_PACKAGE_INCLUDE_DEPENDS
pluginlib
hardware_interface
rclcpp
rclcpp_lifecycle
transmission_interface

)
find_package(ament_cmake REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()

## Hardware Interface
add_library(
pi3hat_hardware_interface
SHARED
src/pi3hat_hardware_interface.cpp
)
# add include directory
target_include_directories(pi3hat_hardware_interface
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")

target_compile_features(
pi3hat_hardware_interface PUBLIC cxx_std_17)

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME} PRIVATE "PI3HAT_HARDWARE_INTERFACE_BUILDING_DLL")


## Pi3hat library by mjbots
add_library(
pi3hat
SHARED
include/3rd_libs/pi3hat/pi3hat.cc
)

# add include directory
target_include_directories(pi3hat
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")

target_compile_features(
pi3hat PUBLIC cxx_std_17)


## Custom controller bridge library
add_library(controllers SHARED
src/controllers/ControllerBridge.cpp
src/controllers/wrappers/ControllerWrapper.cpp
src/controllers/wrappers/MoteusWrapper.cpp
)

# add include directory
target_include_directories(controllers
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")

target_compile_features(
controllers PUBLIC cxx_std_17)


## Custom library for IMU transformations
add_library(
imu_transform
SHARED
src/imu_transform/IMUTransform.cpp
)

# add include directory
target_include_directories(imu_transform
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")

target_compile_features(
imu_transform PUBLIC cxx_std_17)


target_link_libraries(
pi3hat_hardware_interface
PUBLIC pi3hat
PUBLIC controllers
PUBLIC imu_transform
PUBLIC bcm_host
)

ament_target_dependencies(
pi3hat_hardware_interface PUBLIC
${THIS_PACKAGE_INCLUDE_DEPENDS}
)


## Export hardware plugins
pluginlib_export_plugin_description_file(hardware_interface pi3hat_hardware_interface.xml)


## Install
install(TARGETS
${PROJECT_NAME}
pi3hat
controllers
imu_transform

EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

install(
DIRECTORY include/${PROJECT_NAME}/
DESTINATION include/${PROJECT_NAME}
)

install(
DIRECTORY urdf
DESTINATION share/${PROJECT_NAME}
)
install(DIRECTORY
bringup/launch
DESTINATION share/${PROJECT_NAME}
)

install(DIRECTORY
bringup/config
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()


# exports
ament_export_include_directories(
include
)
ament_export_targets(
export_${PROJECT_NAME} HAS_LIBRARY_TARGET
)

ament_export_dependencies(
${THIS_PACKAGE_INCLUDE_DEPENDS}
)

ament_package()
Loading
Loading