-
Notifications
You must be signed in to change notification settings - Fork 1
moteus arm control #71
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
Changes from 1 commit
18ab254
1926226
9f2924c
f4f1129
89561a5
72666ea
1694dbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,10 +20,21 @@ include_directories( | |
| ${arm_control_INCLUDE_DIRS} | ||
| ) | ||
|
|
||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| moteus | ||
| GIT_REPOSITORY https://github.com/mjbots/moteus.git | ||
| GIT_TAG aa96bf0ae847921a79d2d3d241d65505ee10e209) | ||
|
|
||
| FetchContent_MakeAvailable(moteus) | ||
|
|
||
| add_library(${PROJECT_NAME} src/armprotocol.cpp include/arm_hardware_interface/ArmSerialProtocol.h) | ||
|
|
||
| add_executable(arm_serial_driver src/ArmSerialInterface.cpp include/ArmSerialInterface.h include/arm_hardware_interface/ArmSerialProtocol.h) | ||
| # For old and new arm | ||
| # add_executable(arm_serial_driver src/ArmSerialInterface.cpp include/ArmSerialInterface.h include/arm_hardware_interface/ArmSerialProtocol.h) | ||
|
||
| add_executable(arm_serial_driver src/MoteusInterface.cpp include/ArmSerialInterface.h include/arm_hardware_interface/ArmSerialProtocol.h) | ||
|
|
||
| target_link_libraries(arm_serial_driver moteus::cpp) | ||
| ament_target_dependencies(arm_serial_driver rclcpp sensor_msgs serial rover_msgs arm_control) | ||
|
|
||
| if(BUILD_TESTING) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| #include <thread> | ||
| #include <chrono> | ||
|
|
||
| #include "moteus.h" | ||
| #include <arm_hardware_interface/ArmSerialProtocol.h> | ||
|
|
||
|
|
||
|
|
@@ -26,6 +27,7 @@ | |
| #define AXIS_6_DIR 1 | ||
|
|
||
| using std::string; | ||
| using namespace mjbots; | ||
|
|
||
| class ArmSerial : public rclcpp::Node { | ||
| public: | ||
|
|
@@ -52,6 +54,11 @@ class ArmSerial : public rclcpp::Node { | |
| serial::Timeout timeout_uart = serial::Timeout::simpleTimeout(1000); // E.g., 1000 ms or 1 second | ||
|
|
||
|
|
||
| std::map<int, std::shared_ptr<moteus::Controller>> controllers; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should moteus stuff be in the serial driver? i thought serial driver was purely for old arm |
||
| std::map<int, moteus::Query::Result> servo_data; | ||
| std::shared_ptr<moteus::Transport> transport; | ||
| bool send_angles = true; | ||
|
|
||
| struct Axis{ | ||
| float curr_pos; | ||
| float target_pos; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.