The TtlManager class manages the different motor drivers connected on the TTL bus it is used by ttl_interface_core to send or receive data to the ttl bus it also manages the lifecycle of all motors driver (do we need to add also the end effector driver in it ?) More...
#include <ttl_manager.hpp>

Classes | |
| class | CalibrationMachineState |
| struct | GetJointsStepperDriverResult |
Public Member Functions | |
| int | addHardwareComponent (std::shared_ptr< common::model::AbstractHardwareState > &&state) override |
| TtlManager::addHardwareComponent add hardware component like joint, ee, tool... to ttl manager. More... | |
| int | changeId (common::model::EHardwareType motor_type, uint8_t old_id, uint8_t new_id) |
| TtlManager::changeId. More... | |
| void | executeJointTrajectoryCmd (std::vector< std::pair< uint8_t, uint32_t > > cmd_vec) |
| TtlManager::executeJointTrajectoryCmd. More... | |
| int | getAllIdsOnBus (std::vector< uint8_t > &id_list) |
| TtlManager::getAllIdsOnDxlBus. More... | |
| void | getBusState (bool &connection_state, std::vector< uint8_t > &motor_id, std::string &debug_msg) const override |
| TtlManager::getBusState. More... | |
| int32_t | getCalibrationResult (uint8_t id) const override |
| TtlManager::getCalibrationResult. More... | |
| common::model::EStepperCalibrationStatus | getCalibrationStatus () const override |
| TtlManager::getCalibrationStatus. More... | |
| bool | getCollisionStatus () const |
| TtlManager::getCollisionStatus. More... | |
| std::vector< std::shared_ptr< common::model::ConveyorState > > | getConveyorsStates () const |
| std::string | getErrorMessage () const override |
| TtlManager::getErrorMessage. More... | |
| std::shared_ptr< common::model::AbstractHardwareState > | getHardwareState (uint8_t motor_id) const |
| TtlManager::getHardwareState. More... | |
| int | getLedState () const |
| std::vector< std::shared_ptr< common::model::JointState > > | getMotorsStates () const |
| TtlManager::getMotorsStates. More... | |
| size_t | getNbMotors () const override |
| TtlManager::getNbMotors. More... | |
| uint32_t | getPosition (const common::model::JointState &motor_state) |
| TtlManager::getPosition. More... | |
| std::vector< uint8_t > | getRemovedMotorList () const override |
| TtlManager::getRemovedMotorList. More... | |
| bool | hasEndEffector () const |
| TtlManager::hasEndEffector. More... | |
| bool | init (ros::NodeHandle &nh) override |
| TtlManager::init. More... | |
| bool | isCalibrationInProgress () const |
| TtlManager::isCalibrationInProgress. More... | |
| bool | isConnectionOk () const override |
| TtlManager::isConnectionOk. More... | |
| bool | needCalibration () const |
| TtlManager::needCalibration. More... | |
| TtlManager & | operator= (const TtlManager &)=delete |
| TtlManager & | operator= (TtlManager &&)=delete |
| bool | ping (uint8_t id) override |
| TtlManager::ping. More... | |
| bool | readCollisionStatus () |
| TtlManager::readCollisionStatus. More... | |
| int | readControlMode (uint8_t id, uint8_t &control_mode) |
| TtlManager::readControlMode. More... | |
| int | readCustomCommand (uint8_t id, int32_t reg_address, int &value, int byte_number) |
| TtlManager::readCustomCommand. More... | |
| bool | readEndEffectorStatus () |
| TtlManager::readEndEffectorStatus. More... | |
| bool | readHardwareStatus () |
| TtlManager::readHardwareStatus. More... | |
| bool | readHomingAbsPosition () |
| bool | readJointsStatus () |
| TtlManager::readJointsStatus. More... | |
| int | readMotorPID (uint8_t id, uint16_t &pos_p_gain, uint16_t &pos_i_gain, uint16_t &pos_d_gain, uint16_t &vel_p_gain, uint16_t &vel_i_gain, uint16_t &ff1_gain, uint16_t &ff2_gain) |
| TtlManager::readMotorPID. More... | |
| int | readMoving (uint8_t id, uint8_t &status) |
| TtlManager::readMoving. More... | |
| uint8_t | readNed3ProSteppersStatus () |
| uint8_t | readSteppersStatus () |
| TtlManager::readCalibrationStatus : reads specific steppers related information (ned2 only) More... | |
| int | readVelocityProfile (uint8_t id, uint32_t &v_start, uint32_t &a_1, uint32_t &v_1, uint32_t &a_max, uint32_t &v_max, uint32_t &d_max, uint32_t &d_1, uint32_t &v_stop) |
| TtlManager::readVelocityProfile. More... | |
| int | rebootHardware (uint8_t id) |
| TtlManager::rebootHardware. More... | |
| void | removeHardwareComponent (uint8_t id) override |
| TtlManager::removeHardwareComponent. More... | |
| void | resetCalibration () override |
| TtlManager::resetCalibration. More... | |
| void | resetTorques () |
| TtlManager::resetTorques. More... | |
| int | scanAndCheck () override |
| TtlManager::scanAndCheck. More... | |
| int | sendCustomCommand (uint8_t id, int reg_address, int value, int byte_number) |
| TtlManager::sendCustomCommand. More... | |
| int | setLeds (int led) |
| TtlManager::setLeds. More... | |
| void | startCalibration () override |
| TtlManager::startCalibration. More... | |
| TtlManager ()=delete | |
| TtlManager (const TtlManager &)=delete | |
| TtlManager (ros::NodeHandle &nh) | |
| TtlManager::TtlManager. More... | |
| TtlManager (TtlManager &&)=delete | |
| int | writeSingleCommand (std::unique_ptr< common::model::AbstractTtlSingleMotorCmd > &&cmd) |
| TtlManager::writeSingleCommand. More... | |
| int | writeSynchronizeCommand (std::unique_ptr< common::model::AbstractTtlSynchronizeMotorCmd > &&cmd) |
| TtlManager::writeSynchronizeCommand. More... | |
| ~TtlManager () override | |
| TtlManager::~TtlManager. More... | |
Private Member Functions | |
| void | addHardwareDriver (common::model::EHardwareType hardware_type) override |
| TtlManager::addHardwareDriver. More... | |
| bool | checkCollision () |
| TtlManager::checkCollision. More... | |
| GetJointsStepperDriverResult | getJointsStepperDriver () |
| : Return the driver of the joints More... | |
| bool | isMotorType (common::model::EHardwareType type) |
| TtlManager::isMotorType. More... | |
| void | readFakeConfig (bool use_simu_gripper, bool use_simu_conveyor) |
| TtlManager::readFakeConfig. More... | |
| template<typename Reg > | |
| void | retrieveFakeMotorData (const std::string ¤t_ns, std::map< uint8_t, Reg > &fake_params) |
| TtlManager::retrieveFakeMotorData. More... | |
| int | setupCommunication () override |
| TtlManager::setupCommunication. More... | |
Private Attributes | |
| std::vector< uint8_t > | _all_ids_connected |
| int | _baudrate {1000000} |
| CalibrationMachineState | _calib_machine_state |
| common::model::EStepperCalibrationStatus | _calibration_status {common::model::EStepperCalibrationStatus::OK} |
| ros::Publisher | _calibration_status_publisher |
| bool | _collision_status {false} |
| std::vector< uint8_t > | _conveyor_list |
| std::string | _debug_error_message |
| std::shared_ptr< ttl_driver::AbstractTtlDriver > | _default_ttl_driver |
| std::string | _device_name |
| std::map< common::model::EHardwareType, std::shared_ptr< ttl_driver::AbstractTtlDriver > > | _driver_map |
| uint32_t | _end_effector_fail_counter_read {0} |
| std::shared_ptr< FakeTtlData > | _fake_data |
| uint32_t | _hw_fail_counter_read {0} |
| std::map< common::model::EHardwareType, std::vector< uint8_t > > | _ids_map |
| bool | _is_connection_ok {false} |
| bool | _isRealCollision {true} |
| bool | _isWrongAction {false} |
| double | _last_collision_detection_activating {0.0} |
| std::string | _led_motor_type_cfg |
| int | _led_state = 0 |
| ros::NodeHandle | _nh |
| std::shared_ptr< dynamixel::PacketHandler > | _packetHandler |
| std::shared_ptr< dynamixel::PortHandler > | _portHandler |
| std::vector< uint8_t > | _position_goal_ids |
| std::vector< uint32_t > | _position_goal_params |
| std::vector< uint32_t > | _position_list |
| std::vector< uint8_t > | _removed_motor_id_list |
| bool | _simulation_mode {false} |
| std::map< uint8_t, std::shared_ptr< common::model::AbstractHardwareState > > | _state_map |
| std::mutex | _sync_mutex |
Static Private Attributes | |
| static constexpr uint32_t | MAX_HW_FAILURE = 150 |
| static constexpr uint32_t | MAX_READ_EE_FAILURE = 150 |
The TtlManager class manages the different motor drivers connected on the TTL bus it is used by ttl_interface_core to send or receive data to the ttl bus it also manages the lifecycle of all motors driver (do we need to add also the end effector driver in it ?)
Parameters for Stepper
Definition at line 85 of file ttl_manager.hpp.
|
delete |
| ttl_driver::TtlManager::TtlManager | ( | ros::NodeHandle & | nh | ) |
Definition at line 80 of file ttl_manager.cpp.
|
override |
Definition at line 93 of file ttl_manager.cpp.
|
delete |
|
delete |
|
override |
TtlManager::addHardwareComponent add hardware component like joint, ee, tool... to ttl manager.
| state |
Definition at line 207 of file ttl_manager.cpp.
|
overrideprivate |
TtlManager::addHardwareDriver.
| hardware_type |
Definition at line 2145 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::changeId | ( | common::model::EHardwareType | motor_type, |
| uint8_t | old_id, | ||
| uint8_t | new_id | ||
| ) |
|
private |
Definition at line 898 of file ttl_manager.cpp.
| void ttl_driver::TtlManager::executeJointTrajectoryCmd | ( | std::vector< std::pair< uint8_t, uint32_t > > | cmd_vec | ) |
TtlManager::executeJointTrajectoryCmd.
| cmd_vec |
Definition at line 1956 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::getAllIdsOnBus | ( | std::vector< uint8_t > & | id_list | ) |
TtlManager::getAllIdsOnDxlBus.
| id_list |
Definition at line 1432 of file ttl_manager.cpp.
|
override |
| connection_state | |
| motor_id | |
| debug_msg |
Definition at line 2084 of file ttl_manager.cpp.
|
override |
TtlManager::getCalibrationResult.
| motor_id |
Definition at line 2066 of file ttl_manager.cpp.
|
inlineoverride |
|
inline |
| std::vector< std::shared_ptr< ConveyorState > > ttl_driver::TtlManager::getConveyorsStates | ( | ) | const |
Definition at line 2110 of file ttl_manager.cpp.
|
inlineoverride |
| std::shared_ptr< common::model::AbstractHardwareState > ttl_driver::TtlManager::getHardwareState | ( | uint8_t | motor_id | ) | const |
|
private |
: Return the driver of the joints
All stepper joints should have the same type of driver
Definition at line 2268 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::getLedState | ( | ) | const |
| std::vector< std::shared_ptr< JointState > > ttl_driver::TtlManager::getMotorsStates | ( | ) | const |
Definition at line 2095 of file ttl_manager.cpp.
|
inlineoverride |
| uint32_t ttl_driver::TtlManager::getPosition | ( | const common::model::JointState & | motor_state | ) |
|
inlineoverride |
|
inline |
|
override |
|
inline |
|
inlineoverride |
|
private |
|
inline |
|
delete |
|
delete |
|
override |
| id |
Definition at line 472 of file ttl_manager.cpp.
| bool ttl_driver::TtlManager::readCollisionStatus | ( | ) |
| int ttl_driver::TtlManager::readControlMode | ( | uint8_t | id, |
| uint8_t & | control_mode | ||
| ) |
| int ttl_driver::TtlManager::readCustomCommand | ( | uint8_t | id, |
| int32_t | reg_address, | ||
| int & | value, | ||
| int | byte_number | ||
| ) |
TtlManager::readCustomCommand.
| id | |
| reg_address | |
| value | |
| byte_number |
Definition at line 1593 of file ttl_manager.cpp.
| bool ttl_driver::TtlManager::readEndEffectorStatus | ( | ) |
|
private |
Definition at line 2201 of file ttl_manager.cpp.
| bool ttl_driver::TtlManager::readHardwareStatus | ( | ) |
TtlManager::readHardwareStatus.
Definition at line 1048 of file ttl_manager.cpp.
| bool ttl_driver::TtlManager::readHomingAbsPosition | ( | ) |
Definition at line 609 of file ttl_manager.cpp.
| bool ttl_driver::TtlManager::readJointsStatus | ( | ) |
| int ttl_driver::TtlManager::readMotorPID | ( | uint8_t | id, |
| uint16_t & | pos_p_gain, | ||
| uint16_t & | pos_i_gain, | ||
| uint16_t & | pos_d_gain, | ||
| uint16_t & | vel_p_gain, | ||
| uint16_t & | vel_i_gain, | ||
| uint16_t & | ff1_gain, | ||
| uint16_t & | ff2_gain | ||
| ) |
| id | |
| pos_p_gain | |
| pos_i_gain | |
| pos_d_gain | |
| vel_p_gain | |
| vel_i_gain | |
| ff1_gain | |
| ff2_gain |
Definition at line 1643 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::readMoving | ( | uint8_t | id, |
| uint8_t & | status | ||
| ) |
| uint8_t ttl_driver::TtlManager::readNed3ProSteppersStatus | ( | ) |
Definition at line 1332 of file ttl_manager.cpp.
| uint8_t ttl_driver::TtlManager::readSteppersStatus | ( | ) |
TtlManager::readCalibrationStatus : reads specific steppers related information (ned2 only)
Definition at line 1169 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::readVelocityProfile | ( | uint8_t | id, |
| uint32_t & | v_start, | ||
| uint32_t & | a_1, | ||
| uint32_t & | v_1, | ||
| uint32_t & | a_max, | ||
| uint32_t & | v_max, | ||
| uint32_t & | d_max, | ||
| uint32_t & | d_1, | ||
| uint32_t & | v_stop | ||
| ) |
TtlManager::readVelocityProfile.
| id | |
| v_start | |
| a_1 | |
| v_1 | |
| a_max | |
| v_max | |
| d_max | |
| d_1 | |
| v_stop |
Definition at line 1707 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::rebootHardware | ( | uint8_t | hw_id | ) |
|
override |
|
override |
Definition at line 2033 of file ttl_manager.cpp.
| void ttl_driver::TtlManager::resetTorques | ( | ) |
|
private |
TtlManager::retrieveFakeMotorData.
| current_ns | |
| fake_params |
Definition at line 406 of file ttl_manager.hpp.
|
override |
| int ttl_driver::TtlManager::sendCustomCommand | ( | uint8_t | id, |
| int | reg_address, | ||
| int | value, | ||
| int | byte_number | ||
| ) |
TtlManager::sendCustomCommand.
| id | |
| reg_address | |
| value | |
| byte_number |
Definition at line 1543 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::setLeds | ( | int | led | ) |
|
overrideprivate |
|
override |
Definition at line 1994 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::writeSingleCommand | ( | std::unique_ptr< common::model::AbstractTtlSingleMotorCmd > && | cmd | ) |
TtlManager::writeSingleCommand.
| cmd |
Definition at line 1906 of file ttl_manager.cpp.
| int ttl_driver::TtlManager::writeSynchronizeCommand | ( | std::unique_ptr< common::model::AbstractTtlSynchronizeMotorCmd > && | cmd | ) |
TtlManager::writeSynchronizeCommand.
| cmd |
Definition at line 1836 of file ttl_manager.cpp.
|
private |
Definition at line 210 of file ttl_manager.hpp.
|
private |
Definition at line 208 of file ttl_manager.hpp.
|
private |
Definition at line 311 of file ttl_manager.hpp.
|
private |
Definition at line 241 of file ttl_manager.hpp.
|
private |
Definition at line 253 of file ttl_manager.hpp.
|
private |
Definition at line 248 of file ttl_manager.hpp.
|
private |
Definition at line 225 of file ttl_manager.hpp.
|
private |
Definition at line 229 of file ttl_manager.hpp.
|
private |
Definition at line 221 of file ttl_manager.hpp.
|
private |
Definition at line 207 of file ttl_manager.hpp.
|
private |
Definition at line 218 of file ttl_manager.hpp.
|
private |
Definition at line 232 of file ttl_manager.hpp.
|
private |
Definition at line 244 of file ttl_manager.hpp.
|
private |
Definition at line 231 of file ttl_manager.hpp.
|
private |
Definition at line 216 of file ttl_manager.hpp.
|
private |
Definition at line 228 of file ttl_manager.hpp.
|
private |
Definition at line 250 of file ttl_manager.hpp.
|
private |
Definition at line 251 of file ttl_manager.hpp.
|
private |
Definition at line 249 of file ttl_manager.hpp.
|
private |
Definition at line 235 of file ttl_manager.hpp.
|
private |
Definition at line 234 of file ttl_manager.hpp.
|
private |
Definition at line 201 of file ttl_manager.hpp.
|
private |
Definition at line 203 of file ttl_manager.hpp.
|
private |
Definition at line 202 of file ttl_manager.hpp.
|
private |
Definition at line 256 of file ttl_manager.hpp.
|
private |
Definition at line 257 of file ttl_manager.hpp.
|
private |
Definition at line 255 of file ttl_manager.hpp.
|
private |
Definition at line 211 of file ttl_manager.hpp.
|
private |
Definition at line 245 of file ttl_manager.hpp.
|
private |
Definition at line 214 of file ttl_manager.hpp.
|
mutableprivate |
Definition at line 205 of file ttl_manager.hpp.
|
staticconstexprprivate |
Definition at line 237 of file ttl_manager.hpp.
|
staticconstexprprivate |
Definition at line 238 of file ttl_manager.hpp.