Add navigation functionality to CustomRobot and Controller classes. Introduced Navigation class for handling mapping and pose navigation commands. Updated CustomRobot to process navigation commands and manage Navigation instance. Enhanced Controller with motion switching capabilities, improving overall robot control and navigation features.
This commit is contained in:
29
include/navigation.hpp
Normal file
29
include/navigation.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef NAVIGATION_HPP
|
||||
#define NAVIGATION_HPP
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "unitree/robot/client/client.hpp"
|
||||
|
||||
class Navigation {
|
||||
public:
|
||||
Navigation();
|
||||
~Navigation();
|
||||
|
||||
void Init();
|
||||
|
||||
bool startMapping();
|
||||
bool endMapping(const std::string& address);
|
||||
bool initializePose(double x, double y, double z, double q_x, double q_y, double q_z, double q_w, const std::string& address);
|
||||
bool poseNavigation(double x, double y, double z, double q_x, double q_y, double q_z, double q_w, int mode, double speed);
|
||||
bool pauseNavigation();
|
||||
bool resumeNavigation();
|
||||
bool closeSlam();
|
||||
|
||||
private:
|
||||
std::unique_ptr<unitree::robot::Client> client_;
|
||||
bool callSlamService(int api_id, const nlohmann::json& data);
|
||||
};
|
||||
|
||||
#endif // NAVIGATION_HPP
|
||||
Reference in New Issue
Block a user