init
This commit is contained in:
45
unitree_SDK/include/unitree/robot/b2/sport/sport_api.hpp
Normal file
45
unitree_SDK/include/unitree/robot/b2/sport/sport_api.hpp
Normal 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__
|
86
unitree_SDK/include/unitree/robot/b2/sport/sport_client.hpp
Normal file
86
unitree_SDK/include/unitree/robot/b2/sport/sport_client.hpp
Normal 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__
|
19
unitree_SDK/include/unitree/robot/b2/sport/sport_error.hpp
Normal file
19
unitree_SDK/include/unitree/robot/b2/sport/sport_error.hpp
Normal 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__
|
Reference in New Issue
Block a user