refactor(controller): Remove unused motion control methods and update CMake configuration

- Removed several unused methods from the Controller class, including HandStand, ClassicWalk, AutoRecoverSet, StaticWalk, TrotRun, EconomicGait, and SwitchAvoidMode.
- Updated CMakeLists.txt to remove the hardcoded include path for unitree SDK, streamlining the include directories for the main target.
This commit is contained in:
2025-09-22 16:03:43 +08:00
parent af7eeafd0f
commit 1a0618f50f
4 changed files with 0 additions and 66 deletions

View File

@@ -297,12 +297,6 @@ bool Controller::BackFlip() {
});
}
bool Controller::HandStand(bool flag) {
return ExecuteSportCmd([flag](auto* sc) {
return sc->HandStand(flag);
});
}
bool Controller::FreeWalk() {
return ExecuteSportCmd([](auto* sc) {
return sc->FreeWalk();
@@ -327,12 +321,6 @@ bool Controller::FreeAvoid(bool flag) {
});
}
bool Controller::ClassicWalk(bool flag) {
return ExecuteSportCmd([flag](auto* sc) {
return sc->ClassicWalk(flag);
});
}
bool Controller::WalkUpright(bool flag) {
return ExecuteSportCmd([flag](auto* sc) {
return sc->WalkUpright(flag);
@@ -345,36 +333,6 @@ bool Controller::CrossStep(bool flag) {
});
}
bool Controller::AutoRecoverSet(bool flag) {
return ExecuteSportCmd([flag](auto* sc) {
return sc->AutoRecoverSet(flag);
});
}
bool Controller::StaticWalk() {
return ExecuteSportCmd([](auto* sc) {
return sc->StaticWalk();
});
}
bool Controller::TrotRun() {
return ExecuteSportCmd([](auto* sc) {
return sc->TrotRun();
});
}
bool Controller::EconomicGait() {
return ExecuteSportCmd([](auto* sc) {
return sc->EconomicGait();
});
}
bool Controller::SwitchAvoidMode() {
return ExecuteSportCmd([](auto* sc) {
return sc->SwitchAvoidMode();
});
}
bool Controller::TrajectoryFollow(const std::vector<std::array<float, 6>>& path) {
// This function requires special handling as it needs to convert the path format
// For now, we'll provide a basic implementation

View File

@@ -587,8 +587,6 @@ bool CustomRobot::processSportCmd(const std::string& cmd, const nlohmann::json&
return controller_->LeftFlip();
} else if (cmd == "BackFlip") {
return controller_->BackFlip();
} else if (cmd == "HandStand") {
return controller_->HandStand(message["param"]["flag"]);
} else if (cmd == "FreeWalk") {
return controller_->FreeWalk();
} else if (cmd == "FreeBound") {
@@ -597,22 +595,10 @@ bool CustomRobot::processSportCmd(const std::string& cmd, const nlohmann::json&
return controller_->FreeJump(message["param"]["flag"]);
} else if (cmd == "FreeAvoid") {
return controller_->FreeAvoid(message["param"]["flag"]);
} else if (cmd == "ClassicWalk") {
return controller_->ClassicWalk(message["param"]["flag"]);
} else if (cmd == "WalkUpright") {
return controller_->WalkUpright(message["param"]["flag"]);
} else if (cmd == "CrossStep") {
return controller_->CrossStep(message["param"]["flag"]);
} else if (cmd == "AutoRecoverSet") {
return controller_->AutoRecoverSet(message["param"]["flag"]);
} else if (cmd == "StaticWalk") {
return controller_->StaticWalk();
} else if (cmd == "TrotRun") {
return controller_->TrotRun();
} else if (cmd == "EconomicGait") {
return controller_->EconomicGait();
} else if (cmd == "SwitchAvoidMode") {
return controller_->SwitchAvoidMode();
} else if (cmd == "TrajectoryFollow") {
return controller_->TrajectoryFollow(message["param"]["path"]);
} else if (cmd == "FootRaiseHeight") {