Skip to content

Commit

Permalink
Add HumanoidSDK.hpp File #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mincheol710313 committed Nov 8, 2024
1 parent 8f53bca commit 4080fa4
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions humanoid_sdk/include/HumanoidSDK.hpp
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_

1 comment on commit 4080fa4

@yeonju52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2

Please sign in to comment.