Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the diagnostic of quadrature encoder #972

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/libraries/icubmod/embObjLib/diagnosticInfoParsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void MotionControlParser::parseInfo()
} break;


case eoerror_value_MC_motor_qencoder_dirty:
//case eoerror_value_MC_motor_qencoder_dirty:
case eoerror_value_MC_motor_qencoder_phase: //TBD: check encoder raw value
{
uint16_t joint_num = m_dnginfo.param16;
Expand All @@ -659,6 +659,20 @@ void MotionControlParser::parseInfo()
m_dnginfo.baseInfo.finalMessage.append(str);
} break;

case eoerror_value_MC_motor_qencoder_dirty:
{
uint16_t joint_num = m_dnginfo.param16;
uint16_t dirty_error = m_dnginfo.param64 & 0xffff;
uint16_t index_error = (m_dnginfo.param64 & 0xffff0000)>>16;
uint16_t phase_error = (m_dnginfo.param64 & 0xffff00000000)>>32;
m_entityNameProvider.getAxisName(joint_num, m_dnginfo.baseInfo.axisName);

snprintf(str, sizeof(str), " %s (Joint=%s (NIB=%d), index=%d, dirty=%d, phase=%d)",
m_dnginfo.baseMessage.c_str(), m_dnginfo.baseInfo.axisName.c_str(), joint_num, index_error, dirty_error, phase_error
);
m_dnginfo.baseInfo.finalMessage.append(str);
} break;

case eoerror_value_MC_generic_error: //TBD Check print
{
eOmc_motorFaultState_t motor_status;
Expand Down