forked from ROBOTIS-GIT/DynamixelSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f53bca
commit 4080fa4
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,39 @@ | ||
#ifndef HHUMANOID_SDK_HUMANOIDSDK_HPP_ | ||
#define HUMANOID_SDK_HUMANOIDSDK_HPP_ | ||
|
||
#include "dynamixel_sdk/dynamixel_sdk.h" | ||
|
||
// Control table address for AX-12A | ||
#define ADDR_TORQUE_ENABLE 24 | ||
#define ADDR_GOAL_POSITION 30 | ||
#define ADDR_PRESENT_POSITION 36 | ||
|
||
// Protocol version | ||
#define PROTOCOL_VERSION 1.0 // Default Protocol version of DYNAMIXEL AX-12A | ||
|
||
// Default setting | ||
#define BAUDRATE 1000000 // Default Baudrate of DYNAMIXEL AX-12A | ||
#define DEVICE_NAME "/dev/ttyUSB0" // [Linux]: "/dev/ttyUSB*", [Windows]: "COM*" | ||
|
||
class HumanoidSDK | ||
{ | ||
public: | ||
HumanoidSDK(); | ||
~HumanoidSDK(); | ||
|
||
/* Humanoid Setup API */ | ||
void setupDynamixel(uint8_t dxl_id); | ||
|
||
/* Humanoid Control API */ | ||
void setGoalPosition(uint8_t dxl_id, uint32_t goal_position); | ||
|
||
private: | ||
dynamixel::PortHandler * portHandler; | ||
dynamixel::PacketHandler * packetHandler; | ||
|
||
uint8_t dxl_error = 0; | ||
uint32_t goal_position = 0; | ||
int dxl_comm_result = COMM_TX_FAIL; | ||
}; | ||
|
||
#endif // HHUMANOID_SDK_HUMANOIDSDK_HPP_ |
4080fa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2