This commit is contained in:
2025-09-24 10:53:28 +08:00
commit f8e4df77fb
856 changed files with 140098 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#ifndef __UT_ROBOT_B2_BACK_VIDEO_API_HPP__
#define __UT_ROBOT_B2_BACK_VIDEO_API_HPP__
#include <unitree/common/json/jsonize.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*service name*/
const std::string ROBOT_BACK_VIDEO_SERVICE_NAME = "back_videohub";
/*api version*/
const std::string ROBOT_BACK_VIDEO_API_VERSION = "1.0.0.0";
/*api id*/
const int32_t ROBOT_BACK_VIDEO_API_ID_GETIMAGESAMPLE = 1001;
}
}
}
#endif //__UT_ROBOT_B2_BACK_VIDEO_API_HPP__

View File

@@ -0,0 +1,34 @@
#ifndef __UT_ROBOT_B2_BACK_VIDEO_CLIENT_HPP__
#define __UT_ROBOT_B2_BACK_VIDEO_CLIENT_HPP__
#include <unitree/robot/client/client.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* BackVideoClient
*/
class BackVideoClient : public Client
{
public:
explicit BackVideoClient();
~BackVideoClient();
void Init();
/*
* @brief GetImageSample
* @api: 1001
*/
int32_t GetImageSample(std::vector<uint8_t>&);
};
}
}
}
#endif//__UT_ROBOT_B2_BACK_VIDEO_CLIENT_HPP__

View File

@@ -0,0 +1,17 @@
#ifndef __UT_ROBOT_B2_BACK_VIDEO_ERROR_HPP__
#define __UT_ROBOT_B2_BACK_VIDEO_ERROR_HPP__
#include <unitree/common/decl.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
UT_DECL_ERR(UT_ROBOT_BACK_VIDEO_ERR_COMM, 100, "Invalid parameter")
}
}
}
#endif//__UT_ROBOT_B2_BACK_VIDEO_ERROR_HPP__

View File

@@ -0,0 +1,210 @@
#ifndef __UT_ROBOT_B2_CONFIG_API_HPP__
#define __UT_ROBOT_B2_CONFIG_API_HPP__
#include <unitree/common/json/jsonize.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* service name
*/
const std::string CONFIG_SERVICE_NAME = "config";
/*
* api version
*/
const std::string CONFIG_API_VERSION = "1.0.0.1";
/*
* api id
*/
const int32_t CONFIG_API_ID_SET = 1001;
const int32_t CONFIG_API_ID_GET = 1002;
const int32_t CONFIG_API_ID_DEL = 1003;
const int32_t CONFIG_API_ID_META = 1004;
/*
* data type
*/
class JsonizeConfigMeta : public common::Jsonize
{
public:
JsonizeConfigMeta()
{}
~JsonizeConfigMeta()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
common::FromJson(json["lastModified"], lastModified);
common::FromJson(json["size"], size);
common::FromJson(json["epoch"], epoch);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
common::ToJson(lastModified, json["lastModified"]);
common::ToJson(size, json["size"]);
common::ToJson(epoch, json["epoch"]);
}
public:
std::string name;
std::string lastModified;
int32_t size;
int32_t epoch;
};
class ConfigSetParameter : public common::Jsonize
{
public:
ConfigSetParameter()
{}
~ConfigSetParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
common::FromJson(json["content"], content);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
common::ToJson(content, json["content"]);
}
public:
std::string name;
std::string content;
};
class ConfigGetParameter : public common::Jsonize
{
public:
ConfigGetParameter()
{}
~ConfigGetParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
}
public:
std::string name;
};
class ConfigGetData : public common::Jsonize
{
public:
ConfigGetData()
{}
~ConfigGetData()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["content"], content);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(content, json["content"]);
}
public:
std::string content;
};
class ConfigDelParameter : public common::Jsonize
{
public:
ConfigDelParameter()
{}
~ConfigDelParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
}
public:
std::string name;
};
class ConfigMetaParameter : public common::Jsonize
{
public:
ConfigMetaParameter()
{}
~ConfigMetaParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
}
public:
std::string name;
};
class ConfigMetaData : public common::Jsonize
{
public:
ConfigMetaData()
{}
~ConfigMetaData()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["meta"], meta);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(meta, json["meta"]);
}
public:
JsonizeConfigMeta meta;
};
}
}
}
#endif//__UT_ROBOT_B2_CONFIG_API_HPP__

View File

@@ -0,0 +1,68 @@
#ifndef __UT_ROBOT_B2_CONFIG_CLIENT_HPP__
#define __UT_ROBOT_B2_CONFIG_CLIENT_HPP__
#include <unitree/robot/client/client.hpp>
#include <unitree/robot/channel/channel_subscriber.hpp>
#include <unitree/idl/go2/ConfigChangeStatus_.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* @brief ConfigMeta
*/
class ConfigMeta
{
public:
ConfigMeta() : size(-1), epoch(-1)
{}
~ConfigMeta()
{}
public:
std::string name;
std::string lastModified;
int32_t size;
int32_t epoch;
};
/*
* @brief ConfigClient
*/
using ConfigChangeStatusCallback = std::function<void(const std::string&,const std::string&)>;
class ConfigClient : public Client
{
public:
explicit ConfigClient();
~ConfigClient();
void Init();
int32_t Set(const std::string& name, const std::string& content);
int32_t Get(const std::string& name, std::string& content);
int32_t Del(const std::string& name);
int32_t Meta(const std::string& name, ConfigMeta& meta);
int32_t Meta(const std::string& name, std::string& meta);
void SubscribeChangeStatus(const std::string& name, const ConfigChangeStatusCallback& callback);
private:
void ChangeStatusMessageHandler(const void* message);
private:
unitree::common::Mutex mLock;
std::map<std::string,ConfigChangeStatusCallback> mNameCallbackMap;
ChannelSubscriberPtr<unitree_go::msg::dds_::ConfigChangeStatus_> mSubscriberPtr;
};
}
}
}
#endif//__UT_ROBOT_B2_CONFIG_CLIENT_HPP__

View File

@@ -0,0 +1,29 @@
#ifndef __UT_ROBOT_B2_CONFIG_ERROR_HPP__
#define __UT_ROBOT_B2_CONFIG_ERROR_HPP__
namespace unitree
{
namespace robot
{
namespace b2
{
UT_DECL_ERR(UT_CONFIG_ERR_PARAMETER, 8201, "parameter error.")
UT_DECL_ERR(UT_CONFIG_ERR_NOT_FOUND, 8202, "config name is not found.")
UT_DECL_ERR(UT_CONFIG_ERR_NAME, 8203, "name is invalid.")
UT_DECL_ERR(UT_CONFIG_ERR_LIMITED, 8204, "name/content length limited.")
UT_DECL_ERR(UT_CONFIG_ERR_LOCK, 8205, "lock error.")
UT_DECL_ERR(UT_CONFIG_ERR_LOAD_META, 8206, "load meta error.")
UT_DECL_ERR(UT_CONFIG_ERR_SAVE_META, 8207, "save meta error.")
UT_DECL_ERR(UT_CONFIG_ERR_TEMP_META, 8208, "save meta temp error.")
UT_DECL_ERR(UT_CONFIG_ERR_FORMAL_META, 8209, "formalize meta error.")
UT_DECL_ERR(UT_CONFIG_ERR_REMOVE_META, 8210, "remove meta error.")
UT_DECL_ERR(UT_CONFIG_ERR_LOAD_DATA, 8211, "load data error.")
UT_DECL_ERR(UT_CONFIG_ERR_SAVE_DATA, 8212, "save data error.")
UT_DECL_ERR(UT_CONFIG_ERR_TEMP_DATA, 8213, "save data temp error.")
UT_DECL_ERR(UT_CONFIG_ERR_FORMAL_DATA, 8214, "formalize data error.")
UT_DECL_ERR(UT_CONFIG_ERR_REMOVE_DATA, 8215, "remove data error.")
}
}
}
#endif//__UT_ROBOT_B2_CONFIG_ERROR_HPP__

View File

@@ -0,0 +1,24 @@
#ifndef __UT_ROBOT_B2_FRONT_VIDEO_API_HPP__
#define __UT_ROBOT_B2_FRONT_VIDEO_API_HPP__
#include <unitree/common/json/jsonize.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*service name*/
const std::string ROBOT_FRONT_VIDEO_SERVICE_NAME = "front_videohub";
/*api version*/
const std::string ROBOT_FRONT_VIDEO_API_VERSION = "1.0.0.0";
/*api id*/
const int32_t ROBOT_FRONT_VIDEO_API_ID_GETIMAGESAMPLE = 1001;
}
}
}
#endif //__UT_ROBOT_B2_FRONT_VIDEO_API_HPP__

View File

@@ -0,0 +1,34 @@
#ifndef __UT_ROBOT_B2_FRONT_VIDEO_CLIENT_HPP__
#define __UT_ROBOT_B2_FRONT_VIDEO_CLIENT_HPP__
#include <unitree/robot/client/client.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* FrontVideoClient
*/
class FrontVideoClient : public Client
{
public:
explicit FrontVideoClient();
~FrontVideoClient();
void Init();
/*
* @brief GetImageSample
* @api: 1001
*/
int32_t GetImageSample(std::vector<uint8_t>&);
};
}
}
}
#endif//__UT_ROBOT_B2_FRONT_VIDEO_CLIENT_HPP__

View File

@@ -0,0 +1,17 @@
#ifndef __UT_ROBOT_B2_FRONT_VIDEO_ERROR_HPP__
#define __UT_ROBOT_B2_FRONT_VIDEO_ERROR_HPP__
#include <unitree/common/decl.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
UT_DECL_ERR(UT_ROBOT_FRONT_VIDEO_ERR_COMM, 100, "Invalid parameter")
}
}
}
#endif//__UT_ROBOT_B2_FRONT_VIDEO_ERROR_HPP__

View File

@@ -0,0 +1,99 @@
#ifndef __UT_ROBOT_B2_MOTION_SWITCHER_API_HPP__
#define __UT_ROBOT_B2_MOTION_SWITCHER_API_HPP__
#include <unitree/common/json/jsonize.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* service name
*/
const std::string MOTION_SWITCHER_SERVICE_NAME = "motion_switcher";
/*
* api version
*/
const std::string MOTION_SWITCHER_API_VERSION = "1.0.0.1";
/*
* api id
*/
const int32_t MOTION_SWITCHER_API_ID_CHECK_MODE = 1001;
const int32_t MOTION_SWITCHER_API_ID_SELECT_MODE = 1002;
const int32_t MOTION_SWITCHER_API_ID_RELEASE_MODE = 1003;
const int32_t MOTION_SWITCHER_API_ID_SET_SILENT = 1004;
const int32_t MOTION_SWITCHER_API_ID_GET_SILENT = 1005;
/*
* api data type
*/
class JsonizeModeName : public common::Jsonize
{
public:
JsonizeModeName()
{}
~JsonizeModeName()
{}
/*override*/
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
if (json.find("form") != json.end())
{
common::FromJson(json["form"], form);
}
}
/*override*/
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
if (!form.empty())
{
common::ToJson(form, json["form"]);
}
}
public:
std::string name;
std::string form;
};
class JsonizeSilent : public common::Jsonize
{
public:
JsonizeSilent() : silent(false)
{}
~JsonizeSilent()
{}
/*override*/
void fromJson(common::JsonMap& json)
{
common::FromJson(json["silent"], silent);
}
/*override*/
void toJson(common::JsonMap& json) const
{
common::ToJson(silent, json["silent"]);
}
public:
bool silent;
};
}
}
}
#endif//__UT_ROBOT_B2_MOTION_SWITCHER_API_HPP__

View File

@@ -0,0 +1,35 @@
#ifndef __UT_ROBOT_B2_MOTION_SWITCHER_CLIENT_HPP__
#define __UT_ROBOT_B2_MOTION_SWITCHER_CLIENT_HPP__
#include <unitree/robot/client/client.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* @brief MotionSwitcherClient
*/
class MotionSwitcherClient : public Client
{
public:
explicit MotionSwitcherClient();
~MotionSwitcherClient();
void Init();
int32_t CheckMode(std::string& form, std::string& name);
int32_t SelectMode(const std::string& nameOrAlias);
int32_t ReleaseMode();
int32_t SetSilent(bool silent);
int32_t GetSilent(bool& silent);
};
}
}
}
#endif//__UT_ROBOT_B2_MOTION_SWITCHER_CLIENT_HPP__

View File

@@ -0,0 +1,25 @@
#ifndef __UT_ROBOT_B2_MOTION_SWITCHER_ERROR_HPP__
#define __UT_ROBOT_B2_MOTION_SWITCHER_ERROR_HPP__
#include <unitree/common/decl.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
UT_DECL_ERR(UT_SWITCH_ERR_PARAMETR, 7001, "parameter is invalid.")
UT_DECL_ERR(UT_SWITCH_ERR_BUSY, 7002, "switcher is busy.")
UT_DECL_ERR(UT_SWITCH_ERR_EVENT, 7003, "event is invalid.")
UT_DECL_ERR(UT_SWITCH_ERR_NAME, 7004, "name or alias is invalid.")
UT_DECL_ERR(UT_SWITCH_ERR_CMD, 7005, "name or alias is invalid.")
UT_DECL_ERR(UT_SWITCH_ERR_EXEC_CHECK, 7006, "check cmd execute error.")
UT_DECL_ERR(UT_SWITCH_ERR_EXEC_SELECT, 7007, "select cmd execute error.")
UT_DECL_ERR(UT_SWITCH_ERR_EXEC_RELEASE, 7008, "release cmd execute error.")
UT_DECL_ERR(UT_SWITCH_ERR_CUSTOMIZE, 7009, "save customize data error.")
}
}
}
#endif//__UT_ROBOT_B2_MOTION_SWITCHER_ERROR_HPP__

View File

@@ -0,0 +1,206 @@
#ifndef __UT_ROBOT_B2_ROBOT_STATE_API_HPP__
#define __UT_ROBOT_B2_ROBOT_STATE_API_HPP__
#include <unitree/common/json/jsonize.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* service name
*/
const std::string ROBOT_STATE_SERVICE_NAME = "robot_state";
/*
* api version
*/
const std::string ROBOT_STATE_API_VERSION = "1.0.0.2";
/*
* api id
*/
const int32_t ROBOT_STATE_API_ID_SERVICE_SWITCH = 1001;
const int32_t ROBOT_STATE_API_ID_SET_REPORT_FREQ = 1002;
const int32_t ROBOT_STATE_API_ID_SERVICE_LIST = 1003;
const int32_t ROBOT_STATE_API_ID_LOWPOWER_SWITCH = 1004;
const int32_t ROBOT_STATE_API_ID_LOWPOWER_STATUS = 1005;
/*
* request parameter for 1001
*/
class ServiceSwitchParameter : public common::Jsonize
{
public:
ServiceSwitchParameter() : swit(0)
{}
~ServiceSwitchParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
common::FromJson(json["switch"], swit);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
common::ToJson(swit, json["switch"]);
}
public:
std::string name;
int32_t swit;
};
/*
* response data for 1001
*/
class ServiceSwitchData : public common::Jsonize
{
public:
ServiceSwitchData() : status(0)
{}
~ServiceSwitchData()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
common::FromJson(json["status"], status);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
common::ToJson(status, json["status"]);
}
public:
std::string name;
int32_t status;
};
/*
* request parameter for 1002
*/
class SetReportFreqParameter : public common::Jsonize
{
public:
SetReportFreqParameter()
{}
~SetReportFreqParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["interval"], interval);
common::FromJson(json["duration"], duration);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(interval, json["interval"]);
common::ToJson(duration, json["duration"]);
}
public:
int32_t interval;
int32_t duration;
};
/*
* request data for 1003
*/
class ServiceStateData : public common::Jsonize
{
public:
ServiceStateData()
{}
~ServiceStateData()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["name"], name);
common::FromJson(json["status"], status);
common::FromJson(json["protect"], protect);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(name, json["name"]);
common::ToJson(status, json["status"]);
common::ToJson(protect, json["protect"]);
}
public:
std::string name;
int32_t status;
int32_t protect;
};
/*
* request parameter for 1004
*/
class LowPowerSwitchParameter : public common::Jsonize
{
public:
LowPowerSwitchParameter() : swit(0)
{}
~LowPowerSwitchParameter()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["switch"], swit);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(swit, json["switch"]);
}
public:
int32_t swit;
};
/*
* response data for 1004
*/
class LowPowerStatusData : public common::Jsonize
{
public:
LowPowerStatusData() : status(0)
{}
~LowPowerStatusData()
{}
void fromJson(common::JsonMap& json)
{
common::FromJson(json["status"], status);
}
void toJson(common::JsonMap& json) const
{
common::ToJson(status, json["status"]);
}
public:
int32_t status;
};
}
}
}
#endif//__UT_ROBOT_B2_ROBOT_STATE_API_HPP__

View File

@@ -0,0 +1,49 @@
#ifndef __UT_ROBOT_B2_ROBOT_STATE_CLIENT_HPP__
#define __UT_ROBOT_B2_ROBOT_STATE_CLIENT_HPP__
#include <unitree/robot/client/client.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* @brief ServiceState
*/
class ServiceState
{
public:
ServiceState() : status(0), protect(0)
{}
std::string name;
int32_t status;
int32_t protect;
};
/*
* @brief RobotStateClient
*/
class RobotStateClient : public Client
{
public:
explicit RobotStateClient();
~RobotStateClient();
void Init();
int32_t ServiceList(std::vector<ServiceState>& serviceStateList);
int32_t ServiceSwitch(const std::string& name, int32_t swit, int32_t& status);
int32_t SetReportFreq(int32_t interval, int32_t duration);
int32_t LowPowerSwitch(int32_t swit);
int32_t LowPowerStatus(int32_t& status);
};
}
}
}
#endif//__UT_ROBOT_B2_ROBOT_STATE_CLIENT_HPP__

View File

@@ -0,0 +1,20 @@
#ifndef __UT_ROBOT_B2_ROBOT_STATE_CLIENT_ERROR_HPP__
#define __UT_ROBOT_B2_ROBOT_STATE_CLIENT_ERROR_HPP__
#include <unitree/common/decl.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
UT_DECL_ERR(UT_ROBOT_STATE_CLIENT_ERR_SERVICE_SWITCH, 5201, "service switch error.")
UT_DECL_ERR(UT_ROBOT_STATE_CLIENT_ERR_SERVICE_PROTECTED, 5202, "service is protected.")
UT_DECL_ERR(UT_ROBOT_STATE_CLIENT_ERR_LOWPOWER_SWITCH, 5203, "low power switch error.")
UT_DECL_ERR(UT_ROBOT_STATE_CLIENT_ERR_LOWPOWER_STATE, 5204, "low power state error.")
}
}
}
#endif//__UT_ROBOT_B2_ROBOT_STATE_CLIENT_ERROR_HPP__

View File

@@ -0,0 +1,45 @@
#ifndef __UT_ROBOT_B2_SPORT_API_HPP__
#define __UT_ROBOT_B2_SPORT_API_HPP__
#include <unitree/common/json/jsonize.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*service name*/
const std::string ROBOT_SPORT_SERVICE_NAME = "sport";
/*api version*/
const std::string ROBOT_SPORT_API_VERSION = "1.0.0.1";
/*api id*/
const int32_t ROBOT_SPORT_API_ID_DAMP = 1001;
const int32_t ROBOT_SPORT_API_ID_BALANCESTAND = 1002;
const int32_t ROBOT_SPORT_API_ID_STOPMOVE = 1003;
const int32_t ROBOT_SPORT_API_ID_STANDUP = 1004;
const int32_t ROBOT_SPORT_API_ID_STANDDOWN = 1005;
const int32_t ROBOT_SPORT_API_ID_RECOVERYSTAND = 1006;
const int32_t ROBOT_SPORT_API_ID_MOVE = 1008;
const int32_t ROBOT_SPORT_API_ID_SWITCHGAIT = 1011;
const int32_t ROBOT_SPORT_API_ID_BODYHEIGHT = 1013;
const int32_t ROBOT_SPORT_API_ID_SPEEDLEVEL = 1015;
const int32_t ROBOT_SPORT_API_ID_TRAJECTORYFOLLOW = 1018;
const int32_t ROBOT_SPORT_API_ID_CONTINUOUSGAIT = 1019;
const int32_t ROBOT_SPORT_API_ID_MOVETOPOS = 1036;
const int32_t ROBOT_SPORT_API_ID_SWITCHMOVEMODE = 1038;
const int32_t ROBOT_SPORT_API_ID_VISIONWALK = 1101;
const int32_t ROBOT_SPORT_API_ID_HANDSTAND = 1039;
const int32_t ROBOT_SPORT_API_ID_AUTORECOVERY_SET = 1040;
const int32_t ROBOT_SPORT_API_ID_FREEWALK = 1045;
const int32_t ROBOT_SPORT_API_ID_CLASSICWALK = 1049;
const int32_t ROBOT_SPORT_API_ID_FASTWALK = 1050;
const int32_t ROBOT_SPORT_API_ID_FREEEULER = 1051;
}
}
}
#endif //__UT_ROBOT_B2_SPORT_API_HPP__

View File

@@ -0,0 +1,86 @@
#ifndef __UT_ROBOT_B2_SPORT_CLIENT_HPP__
#define __UT_ROBOT_B2_SPORT_CLIENT_HPP__
#include <unitree/robot/client/client.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
/*
* PathPoint
*/
struct stPathPoint
{
float timeFromStart;
float x;
float y;
float yaw;
float vx;
float vy;
float vyaw;
};
typedef struct stPathPoint PathPoint;
/*
* SportClient
*/
class SportClient : public Client
{
public:
explicit SportClient(bool enableLease = false);
~SportClient();
void Init();
int32_t Damp();
int32_t BalanceStand();
int32_t StopMove();
int32_t StandUp();
int32_t StandDown();
int32_t RecoveryStand();
int32_t Move(float vx, float vy, float vyaw);
int32_t SwitchGait(int d);
int32_t BodyHeight(float height);
int32_t SpeedLevel(int level);
int32_t TrajectoryFollow(std::vector<unitree::robot::b2::PathPoint> &path);
int32_t ContinuousGait(bool flag);
int32_t MoveToPos(float x, float y, float yaw);
int32_t SwitchMoveMode(bool flag);
int32_t VisionWalk(bool flag);
int32_t HandStand(bool flag);
int32_t AutoRecoverySet(bool flag);
int32_t FreeWalk();
int32_t ClassicWalk(bool flag);
int32_t FastWalk(bool flag);
int32_t Euler(float roll, float pitch, float yaw);
};
}
}
}
#endif//__UT_ROBOT_B2_SPORT_CLIENT_HPP__

View File

@@ -0,0 +1,19 @@
#ifndef __UT_ROBOT_B2_SPORT_ERROR_HPP__
#define __UT_ROBOT_B2_SPORT_ERROR_HPP__
#include <unitree/common/decl.hpp>
namespace unitree
{
namespace robot
{
namespace b2
{
UT_DECL_ERR(UT_ROBOT_SPORT_ERR_CLIENT_POINT_PATH, 4101, "point path error.")
UT_DECL_ERR(UT_ROBOT_SPORT_ERR_SERVER_OVERTIME, 4201, "server overtime.")
UT_DECL_ERR(UT_ROBOT_SPORT_ERR_SERVER_NOT_INIT, 4205, "server function not init.")
}
}
}
#endif//__UT_ROBOT_B2_SPORT_ERROR_HPP__