Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
|
Register-reading functions. More...
![]() |
Functions | |
void | Dynamixel_GetPosition (Dynamixel_HandleTypeDef *hdynamixel) |
Reads the angular position of the motor in degrees. More... | |
void | Dynamixel_GetVelocity (Dynamixel_HandleTypeDef *hdynamixel) |
Reads the angular velocity of the motor in RPM. More... | |
void | Dynamixel_GetLoad (Dynamixel_HandleTypeDef *hdynamixel) |
Reads the "load", the percentage of the maximum torque the motor is exerting. More... | |
float | Dynamixel_GetVoltage (Dynamixel_HandleTypeDef *hdynamixel) |
Reads the motor supply voltage. More... | |
uint8_t | Dynamixel_GetTemperature (Dynamixel_HandleTypeDef *hdynamixel) |
Reads the internal motor temperature. More... | |
bool | Dynamixel_IsRegistered (Dynamixel_HandleTypeDef *hdynamixel) |
Used to tell if a command sent was written to motor registers. More... | |
bool | Dynamixel_IsMoving (Dynamixel_HandleTypeDef *hdynamixel) |
Indicates whether the motor is in motion. More... | |
bool | Dynamixel_IsJointMode (Dynamixel_HandleTypeDef *hdynamixel) |
Indicates whether the motor is operating in joint mode or wheel mode. More... | |
Register-reading functions.
This subsection provides a set of functions which provide interfaces for reading motor register values.
void Dynamixel_GetLoad | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Reads the "load", the percentage of the maximum torque the motor is exerting.
Reads addresses 0x28 and 0x29 in the motor RAM to see what the current load is. Load is a percentage of the maximum torque. A value of 0-1023 gets translated into a counterclockwise load (positive), and a value of 1024-2047 gets translated into a clockwise load (negative). The results are written to hdynamixel -> _lastLoad
, and hdynamixel -> _lastReadIsValid
is set if the checksum is verified, and is cleared otherwise
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 869 of file DynamixelProtocolV1.c.
void Dynamixel_GetPosition | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Reads the angular position of the motor in degrees.
Reads addresses 0x24 and 0x25 in the motors RAM to see what the current position of the motor is. The results are written to hdynamixel -> _lastPosition
, and hdynamixel -> _lastReadIsValid
is set if the checksum is verified, and is cleared otherwise
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 799 of file DynamixelProtocolV1.c.
uint8_t Dynamixel_GetTemperature | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Reads the internal motor temperature.
Reads address 0x2B in the motor RAM to see what the current temperature is inside the motor. Results are in degrees Celsius
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 921 of file DynamixelProtocolV1.c.
void Dynamixel_GetVelocity | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Reads the angular velocity of the motor in RPM.
Reads addresses 0x26 and 0x27 in the motor RAM to see what the current velocity of the motor is. The results are written to hdynamixel -> _lastVelocity
, and hdynamixel -> _lastReadIsValid
is set if the checksum is verified, and is cleared otherwise
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 828 of file DynamixelProtocolV1.c.
float Dynamixel_GetVoltage | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Reads the motor supply voltage.
Reads address 0x2A in the motor RAM to see what the current voltage is. The value retrieved from motor is 10 times the actual voltage. The results are written to hdynamixel -> _lastLoad
, and hdynamixel -> _lastReadIsValid
is set if the checksum is verified, and is cleared otherwise
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 903 of file DynamixelProtocolV1.c.
bool Dynamixel_IsJointMode | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Indicates whether the motor is operating in joint mode or wheel mode.
Reads the CW (addr: 0x06) and CCW (addr: 0x08) angle limits. If both are 0, motor is in wheel mode and can spin indefinitely. Otherwise, motor is in joint mode and has angle limits set
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 967 of file DynamixelProtocolV1.c.
bool Dynamixel_IsMoving | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Indicates whether the motor is in motion.
Reads the 0x2E address in motor RAM to see if motor is moving.
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 951 of file DynamixelProtocolV1.c.
bool Dynamixel_IsRegistered | ( | Dynamixel_HandleTypeDef * | hdynamixel | ) |
Used to tell if a command sent was written to motor registers.
Can also be used to see if the instruction in the motor register has been executed. If the ACTION command is executed, the value read is changed to 0
Read address: 0x2C
Default value: 0x00
hdynamixel | pointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor |
Definition at line 939 of file DynamixelProtocolV1.c.