27 using ::std::ostringstream;
28 using ::std::shared_ptr;
40 shared_ptr<dynamixel::PacketHandler> packetHandler)
41 : AbstractTtlDriver(std::move(portHandler), std::move(packetHandler))
60 std::string hardware_message;
62 if (hw_state & 1 << 0)
64 hardware_message +=
"Input Voltage";
66 if (hw_state & 1 << 2)
68 if (!hardware_message.empty())
69 hardware_message +=
", ";
70 hardware_message +=
"OverHeating";
72 if (hw_state & 1 << 7)
74 if (!hardware_message.empty())
75 hardware_message +=
", ";
76 hardware_message +=
"Disconnection";
79 if (!hardware_message.empty())
80 hardware_message +=
" Error";
82 return hardware_message;
91 auto v_major =
static_cast<uint8_t
>(fw_version >> 24);
92 auto v_minor =
static_cast<uint8_t
>((fw_version >> 16) & 0xFF);
93 auto v_patch =
static_cast<uint16_t
>(fw_version & 0xFFFF);
95 std::ostringstream ss;
96 ss << std::to_string(v_major) <<
"." << std::to_string(v_minor) <<
"." << std::to_string(v_patch);
97 std::string version = ss.str();
109 common::model::EActionType action = common::model::EActionType::NO_ACTION;
115 action = common::model::EActionType::SINGLE_PUSH_ACTION;
117 else if (value & 1 << 1)
119 action = common::model::EActionType::DOUBLE_PUSH_ACTION;
121 else if (value & 1 << 2)
123 action = common::model::EActionType::LONG_PUSH_ACTION;
125 else if (value & 1 << 3)
127 action = common::model::EActionType::HANDLE_HELD_ACTION;
139 if (cmd && cmd->isValid())
141 switch (common::model::EEndEffectorCommandType(cmd->getCmdType()))
143 case common::model::EEndEffectorCommandType::CMD_TYPE_DIGITAL_OUTPUT:
146 case common::model::EEndEffectorCommandType::CMD_TYPE_PING:
149 case common::model::EEndEffectorCommandType::CMD_TYPE_SET_COLLISION_THRESH:
152 case common::model::EEndEffectorCommandType::CMD_TYPE_SET_COLLISION_THRESH_ALGO_2:
155 case common::model::EEndEffectorCommandType::CMD_TYPE_DIGITAL_INPUT:
159 std::cout <<
"Command not implemented" << std::endl;
171 const std::vector<uint32_t> & )
173 std::cout <<
"Synchronized cmd not implemented for end effector" << std::endl;