UCLV Dynamixel Utils
|
The FingerMotor class represents a finger motor, which is a specific type of motor. More...
#include <fingermotor.hpp>
Public Member Functions | |
FingerMotor (const std::string &serial_port, int baudrate, float protocol_version, dynamixel::PortHandler *const &portHandler, dynamixel::PacketHandler *const &packetHandler, uint8_t id) | |
Constructs a FingerMotor object with specified parameters. | |
FingerMotor (const std::string &serial_port, int baudrate, float protocol_version, uint8_t id) | |
Constructs a FingerMotor object with specified parameters. | |
FingerMotor () | |
Default constructor. | |
![]() | |
Motor (const std::string &serial_port, int baudrate, float protocol_version, dynamixel::PortHandler *const &portHandler, dynamixel::PacketHandler *const &packetHandler, uint8_t id) | |
Constructs a Motor object with specified parameters. | |
Motor (const std::string &serial_port, int baudrate, float protocol_version, uint8_t id) | |
Constructs a Motor object with specified parameters. | |
Motor () | |
Default constructor. | |
void | setId (uint8_t id) |
Sets the identifier of the motor. | |
uint8_t | getId () |
Gets the identifier of the motor. | |
void | setAddrTargetPosition (uint16_t addrTargetPosition) |
Sets the address for the target position. | |
uint16_t | getAddrTargetPosition () const |
Gets the address for the target position. | |
void | setAddrPresentPosition (uint16_t addrPresentPosition) |
Sets the address for the present position. | |
uint16_t | getAddrPresentPosition () const |
Gets the address for the present position. | |
void | setLenAddrTargetPosition (uint16_t lenAddrTargetPosition) |
Sets the size (nr of bytes to write) for address of the target position. | |
uint16_t | getLenAddrTargetPosition () const |
Gets the size (nr of bytes to write) for address of the target position. | |
void | setLenAddrPresentPosition (uint16_t lenAddrPresentPosition) |
Sets the size (nr of bytes to write) for address of the present position. | |
uint16_t | getLenAddrPresentPosition () const |
Gets the size (nr of bytes to write) for address of the present position. | |
void | setAddrTorqueEnable (uint16_t addrTorqueEnable) |
uint16_t | getAddrTorqueEnable () const |
void | setTargetPosition (float position) |
Sets the target position of the motor. | |
uint16_t | readPresentPosition () |
Reads the present position of the motor. | |
void | write1OnAddress (uint8_t id, uint16_t address, uint8_t data) |
Writes a byte to the specified address of the motor. | |
void | write2OnAddress (uint8_t id, uint16_t address, uint16_t data) |
Writes two bytes to the specified address of the motor. | |
uint8_t | read1FromAddress (uint8_t id, uint16_t address) |
Reads a byte from the specified address of the motor. | |
uint16_t | read2FromAddress (uint8_t id, uint16_t address) |
Reads two bytes from the specified address of the motor. | |
bool | enableTorque () |
Enables torque for the motor. | |
bool | disableTorque () |
Disables torque for the motor. | |
The FingerMotor class represents a finger motor, which is a specific type of motor.
FingerMotor::FingerMotor | ( | const std::string & | serial_port, |
int | baudrate, | ||
float | protocol_version, | ||
dynamixel::PortHandler *const & | portHandler, | ||
dynamixel::PacketHandler *const & | packetHandler, | ||
uint8_t | id ) |
Constructs a FingerMotor object with specified parameters.
Constructor of the FingerMotor class.
serial_port | The serial port to which the motor is connected. |
baudrate | The baudrate for the serial communication. |
protocol_version | The protocol version used for communication. |
portHandler | Pointer to the port handler. |
packetHandler | Pointer to the packet handler. |
id | Identifier of the motor. |
This constructor initializes the FingerMotor class with the provided parameters.
serial_port | The serial port to which the motor is connected. |
baudrate | The baudrate of the serial communication. |
protocol_version | The version of the protocol used. |
portHandler | Pointer to the port handler. |
packetHandler | Pointer to the packet handler. |
id | The identifier of the motor. |
FingerMotor::FingerMotor | ( | const std::string & | serial_port, |
int | baudrate, | ||
float | protocol_version, | ||
uint8_t | id ) |
Constructs a FingerMotor object with specified parameters.
Constructor of the FingerMotor class.
serial_port | The serial port to which the motor is connected. |
baudrate | The baudrate for the serial communication. |
protocol_version | The protocol version used for communication. |
id | Identifier of the motor. |
This constructor initializes the FingerMotor class with the provided parameters. It creates the port and packet handlers based on the serial port and protocol version.
serial_port | The serial port to which the motor is connected. |
baudrate | The baudrate of the serial communication. |
protocol_version | The version of the protocol used. |
id | The identifier of the motor. |
FingerMotor::FingerMotor | ( | ) |
Default constructor.
Default constructor of the FingerMotor class.
This constructor initializes the FingerMotor class with default values.