moved state update function to agilex base class

This commit is contained in:
Ruixiang Du
2021-07-14 10:53:24 +08:00
parent 257787eb1b
commit 0d99c56f95
12 changed files with 176 additions and 166 deletions

View File

@@ -58,8 +58,13 @@ void ScoutRobot::SetLightCommand(LightMode f_mode, uint8_t f_value,
scout->SetLightCommand(f_mode, f_value, r_mode, r_value);
}
ScoutState ScoutRobot::GetRobotState() {
ScoutCoreState ScoutRobot::GetRobotState() {
auto scout = dynamic_cast<ScoutInterface*>(robot_);
return scout->GetRobotState();
}
ScoutActuatorState ScoutRobot::GetActuatorState() {
auto scout = dynamic_cast<ScoutInterface*>(robot_);
return scout->GetActuatorState();
}
} // namespace westonrobot

View File

@@ -194,8 +194,8 @@ bool DecodeCanFrameV2(const struct can_frame *rx_frame, AgxMessage *msg) {
msg->type = AgxMsgMotionModeState;
MotionModeStateFrame *frame = (MotionModeStateFrame *)(rx_frame->data);
msg->body.motion_mode_feedback_msg.motion_mode = frame->motion_mode;
msg->body.motion_mode_feedback_msg.mode_changing = frame->mode_changing;
msg->body.motion_mode_state_msg.motion_mode = frame->motion_mode;
msg->body.motion_mode_state_msg.mode_changing = frame->mode_changing;
break;
}
/****************** sensor frame *****************/