Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
da3a1ac
Add usb communication option
Roelemans Aug 16, 2020
5b2897a
Pass usb_master to create_joints
Roelemans Aug 16, 2020
eafdcb0
createOdrive and move odrive objects to march_hardware
Roelemans Aug 16, 2020
8f01c11
Fix tests and cmake
Roelemans Aug 16, 2020
f58ea51
Create Motor Controller interface methods
Roelemans Aug 16, 2020
b2a8979
fix return type of methods
Roelemans Aug 16, 2020
14324c5
Make (empty) implementation of the remaining template methods
Roelemans Aug 17, 2020
8896e69
Set testjoint controllers yaml to torque mode
Roelemans Aug 17, 2020
3490875
Change IU torque to Ampere
Roelemans Aug 17, 2020
af80495
check communication after fetching joint
JorisWeeda Aug 17, 2020
758c1e1
Set odrive config to creation in hardware_builder.cpp
JorisWeeda Aug 17, 2020
b65d7b4
Add error messages and update initialisation.
JorisWeeda Aug 17, 2020
3bae4e7
fixing clang format
JorisWeeda Aug 17, 2020
498e601
Clang
Roelemans Aug 17, 2020
3cb78ed
Added the configuration of the Json file to the odrive object.
JorisWeeda Aug 17, 2020
aa8e1bf
Updated the configurations to every valid type
JorisWeeda Aug 17, 2020
eff8243
Fix some bugs
Roelemans Aug 17, 2020
7d0261a
Add two_odrive_joints robot
Roelemans Aug 18, 2020
df625d0
Add two_odrive_joints robot #2
Roelemans Aug 18, 2020
30dfc9a
Remove one joint
Roelemans Aug 18, 2020
b07636f
Added current control bandwith to the json and updated the format.
JorisWeeda Aug 18, 2020
a37af6d
updated json configurations
JorisWeeda Aug 18, 2020
4bf6e93
Read parameters only once each cycle
Roelemans Aug 18, 2020
e011f29
added read after the initiation.
JorisWeeda Aug 18, 2020
ae85cdd
Added all the configurations to launch two motors
JorisWeeda Aug 19, 2020
7120112
Reverse encoder counting
Roelemans Aug 21, 2020
55c9efb
Fix merge conflicts
Roelemans Aug 21, 2020
42299a0
Fix comment
Roelemans Aug 21, 2020
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
228 changes: 125 additions & 103 deletions march_hardware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,37 @@ project(march_hardware)
add_compile_options(-std=c++14 -Wall -Wextra -Werror)

find_package(catkin REQUIRED COMPONENTS
roscpp
soem
urdf
)
roscpp
soem
urdf
)
find_package(PkgConfig REQUIRED)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
roscpp
soem
urdf
LIBRARIES ${PROJECT_NAME}
CFG_EXTRAS
${PROJECT_NAME}-extras.cmake
INCLUDE_DIRS include
CATKIN_DEPENDS
message_runtime
roscpp
roslib
soem
urdf
LIBRARIES ${PROJECT_NAME}
CFG_EXTRAS
${PROJECT_NAME}-extras.cmake
)

pkg_check_modules(JSONCPP jsoncpp)
pkg_check_modules(LIBUSB1 libusb-1.0)

link_libraries(${JSONCPP_LIBRARIES} ${LIBUSB1_LIBRARIES})

include(cmake/${PROJECT_NAME}-extras.cmake)

include_directories(
include
SYSTEM
${catkin_INCLUDE_DIRS}
${soem_INCLUDE_DIRS}/soem
include
SYSTEM
${catkin_INCLUDE_DIRS}
${soem_INCLUDE_DIRS}/soem
)

# needed to circumvent LD_LIBRARY_PATH being emptied through ethercat_grant
Expand All @@ -41,114 +49,128 @@ if(CATKIN_ENABLE_TESTING AND ENABLE_COVERAGE_TESTING)
endif()

add_library(${PROJECT_NAME}
include/${PROJECT_NAME}/encoder/absolute_encoder.h
include/${PROJECT_NAME}/encoder/encoder.h
include/${PROJECT_NAME}/encoder/incremental_encoder.h
include/${PROJECT_NAME}/error/error_type.h
include/${PROJECT_NAME}/error/hardware_exception.h
include/${PROJECT_NAME}/error/motion_error.h
include/${PROJECT_NAME}/ethercat/ethercat_master.h
include/${PROJECT_NAME}/ethercat/pdo_interface.h
include/${PROJECT_NAME}/ethercat/pdo_map.h
include/${PROJECT_NAME}/ethercat/pdo_types.h
include/${PROJECT_NAME}/ethercat/sdo_interface.h
include/${PROJECT_NAME}/ethercat/slave.h
include/${PROJECT_NAME}/motor_controller/actuation_mode.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube_states.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube_state_of_operation.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube_target_state.h
include/${PROJECT_NAME}/motor_controller/motor_controller.h
include/${PROJECT_NAME}/motor_controller/motor_controller_states.h
include/${PROJECT_NAME}/joint.h
include/${PROJECT_NAME}/march_robot.h
include/${PROJECT_NAME}/power/boot_shutdown_offsets.h
include/${PROJECT_NAME}/power/high_voltage.h
include/${PROJECT_NAME}/power/low_voltage.h
include/${PROJECT_NAME}/power/net_driver_offsets.h
include/${PROJECT_NAME}/power/net_monitor_offsets.h
include/${PROJECT_NAME}/power/power_distribution_board.h
include/${PROJECT_NAME}/temperature/temperature_ges.h
include/${PROJECT_NAME}/temperature/temperature_sensor.h
src/encoder/absolute_encoder.cpp
src/encoder/encoder.cpp
src/encoder/incremental_encoder.cpp
src/error/error_type.cpp
src/error/motion_error.cpp
src/ethercat/ethercat_master.cpp
src/ethercat/pdo_interface.cpp
src/ethercat/pdo_map.cpp
src/ethercat/sdo_interface.cpp
src/imotioncube/imotioncube.cpp
src/imotioncube/imotioncube_target_state.cpp
src/joint.cpp
src/march_robot.cpp
src/power/high_voltage.cpp
src/power/low_voltage.cpp
src/power/power_distribution_board.cpp
src/temperature/temperature_ges.cpp
)
include/${PROJECT_NAME}/encoder/absolute_encoder.h
include/${PROJECT_NAME}/encoder/encoder.h
include/${PROJECT_NAME}/encoder/incremental_encoder.h
include/${PROJECT_NAME}/error/error_type.h
include/${PROJECT_NAME}/error/hardware_exception.h
include/${PROJECT_NAME}/error/motion_error.h
include/${PROJECT_NAME}/ethercat/ethercat_master.h
include/${PROJECT_NAME}/ethercat/pdo_interface.h
include/${PROJECT_NAME}/ethercat/pdo_map.h
include/${PROJECT_NAME}/ethercat/pdo_types.h
include/${PROJECT_NAME}/ethercat/sdo_interface.h
include/${PROJECT_NAME}/ethercat/slave.h
include/${PROJECT_NAME}/motor_controller/actuation_mode.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube_states.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube_state_of_operation.h
include/${PROJECT_NAME}/motor_controller/imotioncube/imotioncube_target_state.h
include/${PROJECT_NAME}/motor_controller/motor_controller.h
include/${PROJECT_NAME}/motor_controller/motor_controller_states.h
include/${PROJECT_NAME}/joint.h
include/${PROJECT_NAME}/march_robot.h
include/${PROJECT_NAME}/motor_controller/odrive/odrive.h
include/${PROJECT_NAME}/motor_controller/odrive/odrive_endpoint.h
include/${PROJECT_NAME}/motor_controller/odrive/odrive_enums.h
include/${PROJECT_NAME}/motor_controller/odrive/odrive_motor.h
include/${PROJECT_NAME}/motor_controller/odrive/usb_master.h
include/${PROJECT_NAME}/power/boot_shutdown_offsets.h
include/${PROJECT_NAME}/power/high_voltage.h
include/${PROJECT_NAME}/power/low_voltage.h
include/${PROJECT_NAME}/power/net_driver_offsets.h
include/${PROJECT_NAME}/power/net_monitor_offsets.h
include/${PROJECT_NAME}/power/power_distribution_board.h
include/${PROJECT_NAME}/temperature/temperature_ges.h
include/${PROJECT_NAME}/temperature/temperature_sensor.h
src/encoder/absolute_encoder.cpp
src/encoder/encoder.cpp
src/encoder/incremental_encoder.cpp
src/error/error_type.cpp
src/error/motion_error.cpp
src/ethercat/ethercat_master.cpp
src/ethercat/pdo_interface.cpp
src/ethercat/pdo_map.cpp
src/ethercat/sdo_interface.cpp
src/imotioncube/imotioncube.cpp
src/imotioncube/imotioncube_target_state.cpp
src/joint.cpp
src/march_robot.cpp
src/odrive/odrive.cpp
src/odrive/odrive_endpoint.cpp
src/odrive/odrive_motor.cpp
src/odrive/usb_master.cpp
src/power/high_voltage.cpp
src/power/low_voltage.cpp
src/power/power_distribution_board.cpp
src/temperature/temperature_ges.cpp
)

target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} pthread)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
pthread
${LIBUSB1_LIBRARIES}
${JSONCPP_LIBRARIES}
yaml-cpp)

add_executable(slave_count_check check/slave_count.cpp)
target_link_libraries(slave_count_check ${PROJECT_NAME})
ros_enable_rpath(slave_count_check)

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

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(TARGETS slave_count_check
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY launch config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

## Add gtest based cpp test target and link libraries
if(CATKIN_ENABLE_TESTING)
catkin_add_gmock(${PROJECT_NAME}_test
test/encoder/absolute_encoder_test.cpp
test/encoder/encoder_test.cpp
test/encoder/incremental_encoder_test.cpp
test/error/hardware_exception_test.cpp
test/error/motion_error_test.cpp
test/ethercat/pdo_map_test.cpp
test/ethercat/slave_test.cpp
test/imotioncube/imotioncube_test.cpp
test/joint_test.cpp
test/mocks/mock_absolute_encoder.h
test/mocks/mock_encoder.h
test/mocks/mock_motor_controller.h
test/mocks/mock_incremental_encoder.h
test/mocks/mock_joint.h
test/mocks/mock_pdo_interface.h
test/mocks/mock_sdo_interface.h
test/mocks/mock_slave.h
test/mocks/mock_temperature_ges.h
test/power/boot_shutdown_offsets_test.cpp
test/power/high_voltage_test.cpp
test/power/low_voltage_test.cpp
test/power/net_driver_offsets_test.cpp
test/power/net_monitor_offsets_test.cpp
test/power/power_distribution_board_test.cpp
test/temperature/temperature_ges_test.cpp
test/test_runner.cpp
)
test/encoder/absolute_encoder_test.cpp
test/encoder/encoder_test.cpp
test/encoder/incremental_encoder_test.cpp
test/error/hardware_exception_test.cpp
test/error/motion_error_test.cpp
test/ethercat/pdo_map_test.cpp
test/ethercat/slave_test.cpp
test/imotioncube/imotioncube_test.cpp
test/joint_test.cpp
test/mocks/mock_absolute_encoder.h
test/mocks/mock_encoder.h
test/mocks/mock_motor_controller.h
test/mocks/mock_incremental_encoder.h
test/mocks/mock_joint.h
test/mocks/mock_pdo_interface.h
test/mocks/mock_sdo_interface.h
test/mocks/mock_slave.h
test/mocks/mock_temperature_ges.h
test/power/boot_shutdown_offsets_test.cpp
test/power/high_voltage_test.cpp
test/power/low_voltage_test.cpp
test/power/net_driver_offsets_test.cpp
test/power/net_monitor_offsets_test.cpp
test/power/power_distribution_board_test.cpp
test/temperature/temperature_ges_test.cpp
test/test_runner.cpp
)
target_link_libraries(${PROJECT_NAME}_test ${catkin_LIBRARIES} ${PROJECT_NAME})

if(ENABLE_COVERAGE_TESTING)
set(COVERAGE_EXCLUDES "*/${PROJECT_NAME}/test/*" "*/${PROJECT_NAME}/check/*")
add_code_coverage(
NAME coverage_report
DEPENDENCIES ${PROJECT_NAME}_test
NAME coverage_report
DEPENDENCIES ${PROJECT_NAME}_test
)
endif()
endif()
73 changes: 73 additions & 0 deletions march_hardware/config/right_hip_fe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[
{
"name":"axis0.motor.config.current_lim",
"type":"float",
"value":30.0
},
{
"name":"axis0.encoder.config.cpr",
"type":"int32",
"value":4096
},
{
"name":"axis0.encoder.config.use_index",
"type":"bool",
"value":1
},
{
"name":"config.brake_resistance",
"type":"float",
"value":0.0
},
{
"name":"axis0.motor.config.pole_pairs",
"type":"int32",
"value":21
},
{
"name":"axis0.motor.config.calibration_current",
"type":"float",
"value":10.0
},
{
"name":"axis0.controller.config.vel_limit",
"type":"float",
"value":200000.0
},
{
"name":"axis0.motor.config.current_control_bandwidth",
"type":"float",
"value":100.0
},

{
"name":"axis0.motor.config.motor_type",
"type":"uint8",
"value":0
},
{
"name":"axis0.controller.config.vel_gain",
"type":"float",
"value":0.01
},
{
"name":"axis0.controller.config.vel_integrator_gain",
"type":"float",
"value":0.05
},
{
"name":"axis0.controller.config.control_mode",
"type":"uint8",
"value":1
},
{
"name":"axis0.sensorless_estimator.config.pm_flux_linkage",
"type":"float",
"value":0.001944723
},
{
"name":"axis0.config.watchdog_timeout",
"type":"float",
"value":0
},
]
Loading