Refactor configuration management by introducing CustomConfig class. Updated config.hpp to streamline settings and removed legacy configuration presets. Adjusted controller and custom_robot classes to utilize the new configuration structure. Enhanced error handling and logging during initialization processes.
This commit is contained in:
@@ -17,19 +17,19 @@ namespace custom {
|
||||
|
||||
class Controller {
|
||||
public:
|
||||
explicit Controller(const std::string& networkInterface);
|
||||
Controller();
|
||||
~Controller();
|
||||
|
||||
bool initialize();
|
||||
bool start();
|
||||
bool stop();
|
||||
void shutdown() { stop(); }
|
||||
bool isRunning() const { return running_; }
|
||||
|
||||
// Sport
|
||||
bool StandUp();
|
||||
bool StandDown();
|
||||
bool Sit();
|
||||
bool Lie();
|
||||
bool Damp();
|
||||
bool RecoveryStand();
|
||||
bool StopMove();
|
||||
@@ -47,12 +47,11 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
std::unique_ptr<unitree::robot::go2::SportClient> sportClient_;
|
||||
std::unique_ptr<unitree::robot::go2::ObstaclesAvoidClient> obstacleClient_;
|
||||
std::unique_ptr<unitree::robot::go2::SportClient> sc_;
|
||||
std::unique_ptr<unitree::robot::go2::ObstaclesAvoidClient> oac_;
|
||||
|
||||
std::atomic<bool> running_;
|
||||
std::atomic<bool> initialized_;
|
||||
std::string networkInterface_;
|
||||
};
|
||||
|
||||
} // namespace custom
|
||||
|
||||
Reference in New Issue
Block a user