4 #ifndef ARMADILLO2_HW_ARM_INTERFACE_H 5 #define ARMADILLO2_HW_ARM_INTERFACE_H 12 #define DXL_PROTOCOL1 1.0 13 #define DXL_PROTOCOL2 2.0 69 if (type ==
"Position")
79 bool in_torque =
false;
83 double command_position = 0;
84 double command_velocity = 0.15;
94 int32_t prev_non_zero_velocity_ticks = 4;
97 bool dont_allow_zero_ticks_vel =
true;
104 bool first_pos_read =
true;
108 namespace convertions
111 int32_t
rads2ticks(
double rads,
struct motor &motor,
float protocol);
112 int32_t
rad_s2ticks_s(
double rads,
struct motor &motor,
float protocol);
113 double ticks_s2rad_s(int32_t ticks,
struct motor &motor,
float protocol);
124 bool loadProtocol(uint16_t protocol);
138 PortState openPort(std::string port_name,
139 unsigned int baudrate,
143 bool bulkWriteVelocity(std::vector<motor> & motors);
144 bool bulkWritePosition(std::vector<motor> & motors);
145 bool readMotorsPos(std::vector<motor> & motors);
146 bool readMotorsVel(std::vector<motor> & motors);
147 bool readMotorsLoad(std::vector<motor> &motors);
148 bool readMotorsError(std::vector<motor> & motors);
150 bool broadcastPing(std::vector<uint8_t> result_vec, uint16_t protocol);
151 bool setMotorsLed(std::vector<dxl::motor> &motors,
157 #endif //ARMADILLO2_HW_ARM_INTERFACE_H dynamixel::PortHandler * port_handler_
InterfaceType interface_type
int32_t rads2ticks(double rads, struct motor &motor, float protocol)
uint16_t torque_write_addr
uint16_t len_present_speed
uint16_t current_read_addr
int32_t rad_s2ticks_s(double rads, struct motor &motor, float protocol)
led_color(uint8_t red, uint8_t green, uint8_t blue)
uint16_t len_present_curr
static InterfaceType stringToInterfaceType(std::string type)
double ticks2rads(int32_t ticks, struct motor &motor, float protocol)
dynamixel::PacketHandler * pkt_handler_
double ticks_s2rad_s(int32_t ticks, struct motor &motor, float protocol)