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:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <memory>
|
||||
#include <atomic>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unitree/robot/go2/robot_state/robot_state_client.hpp>
|
||||
|
||||
namespace custom {
|
||||
@@ -18,6 +20,8 @@ public:
|
||||
bool initialize();
|
||||
bool start();
|
||||
|
||||
Controller* getController() const { return controller_.get(); }
|
||||
|
||||
// Robot state methods
|
||||
bool GetServiceList(std::vector<unitree::robot::go2::ServiceState>& serviceList);
|
||||
bool SwitchService(const std::string& serviceName, bool enable);
|
||||
@@ -25,8 +29,9 @@ public:
|
||||
|
||||
private:
|
||||
std::unique_ptr<Controller> controller_;
|
||||
std::unique_ptr<unitree::robot::go2::RobotStateClient> stateClient_;
|
||||
std::unique_ptr<unitree::robot::go2::RobotStateClient> rsc_;
|
||||
|
||||
CustomConfig config_;
|
||||
std::atomic<bool> running_;
|
||||
std::atomic<bool> initialized_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user