Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot

Register-reading functions. More...

Collaboration diagram for Getters:

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...
 

Detailed Description

Register-reading functions.

Getter functions

This subsection provides a set of functions which provide interfaces for reading motor register values.

Function Documentation

◆ Dynamixel_GetLoad()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
None

Definition at line 869 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_GetPosition()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
None

Definition at line 799 of file DynamixelProtocolV1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_GetTemperature()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
The internal motor temperature in degrees Celsius

Definition at line 921 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_GetVelocity()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
None

Definition at line 828 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_GetVoltage()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
The voltage in volts if the last read is valid, otherwise INFINITY

Definition at line 903 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_IsJointMode()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
1 if in joint mode, 0 if in wheel mode

Definition at line 967 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_IsMoving()

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.

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
1 if moving, otherwise 0

Definition at line 951 of file DynamixelProtocolV1.c.

Here is the call graph for this function:

◆ Dynamixel_IsRegistered()

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

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
Returns
1 if there are commands transmitted by REG_WRITE, 0 otherwise

Definition at line 939 of file DynamixelProtocolV1.c.

Here is the call graph for this function: