123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- #ifndef MC_CLIENT_INTERFACE_H
- #define MC_CLIENT_INTERFACE_H
- #include <iostream>
- #include <memory>
- #include <string>
- #include <vector>
- #include "common.h"
- // extern "C" {
- using namespace robot_control;
- bool rcClientInterfaceInit(std::string target_ip);
- std::string rcClientInterfaceGetMcVersion(const int& index);
- std::string rcClientInterfaceGetRobotName(const int& index);
- bool rcClientInterfaceGetMcMoveStatus(int index, common::MC_QUATERNIONS *state_attribute);
- // imu 数据上报
- bool rcClientInterfaceGetImuData(common::MC_MOTION_IMU_DATA *imu_data);
- bool rcClientInterfaceGetImuStreamData(std::vector<common::MC_MOTION_IMU_DATA> *imu_data_list);
- // 坐下(默认)/起立
- bool rcClientInterfaceLieDownOrStandUp(robot_control::common::NAV_OR_JOY_MODE from,bool liedown_standup);
- // 使能
- bool rcClientInterfaceDriverEnable(robot_control::common::NAV_OR_JOY_MODE from, bool driver_enable);
- // 前进方向(前后左右)
- bool rcClientInterfaceDirectionMovement(robot_control::common::NAV_OR_JOY_MODE from,
- common::ROBOT_TWIST rc_direct, int64_t time_millis);
- // 步态
- bool rcClientInterfaceSetGait(robot_control::common::NAV_OR_JOY_MODE from, common::ROBOT_GAIT gain);
- // 高度调节条
- bool rcClientInterfaceBodyHighAdjust(robot_control::common::NAV_OR_JOY_MODE from, int scale);
- // 速度调节条
- bool rcClientInterfaceSpeedAdjust(robot_control::common::NAV_OR_JOY_MODE from, int scale);
- // 场景设定
- bool rcClientInterfaceSetScene(robot_control::common::NAV_OR_JOY_MODE from, common::SCENE_TYPE scene);
- // 机器人一键自恢复
- bool rcClientInterfaceSelfRecovery(robot_control::common::NAV_OR_JOY_MODE from);
- // 力矩传感器清零
- bool rcClientInterfaceZeroTorqueSensor(robot_control::common::NAV_OR_JOY_MODE from);
- // 机器人常规状态信息
- bool rcClientInterfaceGetCommonStatus(common::ROBOT_COMMON_STATUS *com_state);
- // 机器人本体状态信息
- bool rcClientInterfaceGetJointsStatus(common::ROBOT_JOINTS_STATUS *state);
- // 机器人日志信息
- bool rcClientInterfaceLogUpdate(std::vector<std::string> &log_list);
- bool rcClientInterfaceSetJoyKeyValues(common::JOY_KEY_TYPE joy_key_attribute);
- // 遥控或手柄控制模式
- bool rcClientInterfaceDriverEstop(robot_control::common::NAV_OR_JOY_MODE from);
- // 遥控或手柄控制模式
- bool rcClientInterfaceResumeEstop(robot_control::common::NAV_OR_JOY_MODE from);
- // 软件急停
- bool rcClientInterfaceDriverSoftEstop(robot_control::common::NAV_OR_JOY_MODE from);
- // 恢复软件急停
- bool rcClientInterfacercResumeSoftEstop(robot_control::common::NAV_OR_JOY_MODE from);
- // 自动充电
- bool rcClientInterfaceSetAutoCharge(
- robot_control::common::NAV_OR_JOY_MODE from,
- common::AUTO_CHARGE_STATE charge_state);
- // 设置导航控制或者遥控控制
- bool rcClientInterfaceSetNavOrJoyControl(
- common::NAV_OR_JOY_MODE nav_joy);
- // 设置机器人位姿
- bool rcClientInterfaceSetPoseEstimate(
- robot_control::common::NAV_OR_JOY_MODE from,
- common::ROBOT_POSE_ESTIMATE estimate);
- // 机器人充电识别二维码
- bool rcClientInterfaceIdentifyQRCode(robot_control::common::NAV_OR_JOY_MODE from);
- bool rcClientInterfaceEnterOrExitCharge(
- robot_control::common::NAV_OR_JOY_MODE from,
- bool driver_enable);
- bool rcClientInterfaceAutoRechargeCmd(
- robot_control::common::NAV_OR_JOY_MODE from,
- common::JETSON_CHARGE_COMMAND charge_command);
- bool rcClientInterfaceGetChargeState(common::JETSON_CHARGE_STATE *charge_state);
- bool rcClientInterfaceLightStripControl(
- robot_control::common::NAV_OR_JOY_MODE from,
- std::string port, EN_MICRO_EMOJI_CONTROL_CMD cmd,
- int deviceAddr, int data);
- bool rcClientInterfaceSerialControl(
- robot_control::common::NAV_OR_JOY_MODE from,
- std::string port, std::string raw_data);
- bool rcClientInterfaceSetGuardian(
- common::NAV_OR_JOY_MODE from,
- float velocity_decay_ratio,
- std::string trigger_source);
- bool rcClientInterfaceSetGuardianSwitch(
- robot_control::common::NAV_OR_JOY_MODE from,
- bool enable);
- bool rcClientInterfaceSetVisualFootholdSwitch(
- robot_control::common::NAV_OR_JOY_MODE from,
- bool enable);
- bool rcClientInterfaceSetVisualFootholdCommand(
- common::JETSON_VISUAL_FOOTHOLD_COMMAND map);
- bool rcClientInterfaceGetVisualFootholdState(
- common::JETSON_VISUAL_FOOTHOLD_STATE *foothold_state);
- bool rcClientInterfaceGetDepthImage(
- common::DEPTH_IMAGE *depth_image);
- bool rcClientInterfaceGetRgbImage(
- common::RGB_IMAGE *rgb_image);
- bool rcClientInterfaceGetMotionControllerTimestamp(unsigned long *timestamp);
- bool rcClientInterfaceSetNavigationPositioningState(
- common::NAV_OR_JOY_MODE from,
- bool enable);
- bool rcClientInterfaceSetNavigationInitialPos(
- common::NAV_OR_JOY_MODE from,
- bool enable);
- bool rcClientInterfaceSetTerrainSegDetectionResults(
- common::NAV_OR_JOY_MODE from,
- common::TERRAIN_SEG_DETECTION_RESULTS terrain);
- bool rcClientInterfaceSetTargetBodyOrientation(
- common::NAV_OR_JOY_MODE from,
- float roll, float pitch, float yaw);
- bool rcClientInterfaceSetEQAState(
- common::NAV_OR_JOY_MODE from,
- common::EQA_STATE eqa_state);
- bool rcClientInterfaceSetStairsHeigh(
- common::NAV_OR_JOY_MODE from,
- common::STAIRS_HEIGH_STATE stairs_heigh_value);
- bool rcClientInterfaceSetUWBFunctionSwitch(
- common::NAV_OR_JOY_MODE from,
- bool enable);
- bool rcClientInterfaceSetWeightLoadAdaptive(
- common::NAV_OR_JOY_MODE from,
- bool enable);
- ////////////////////////////
- bool rcClientInterfaceGetLatestError(std::string* error_code);
- bool rcClientInterfaceGetHistoryError(int* error_count, std::vector<std::string>& error_codes);
- bool rcClientInterfaceGetNavigationPositioningState(bool* state);
- bool rcClientInterfaceGetNavigationInitialPos(bool* init);
- bool rcClientInterfaceGetEQAState(robot_control::common::EQA_STATE *eqa_state);
- bool rcClientInterfaceDemoControl(
- common::NAV_OR_JOY_MODE from,
- int mode,
- bool enable);
- bool rcClientInterfaceSetJointsMode(int mode);
- bool rcClientInterfaceSetJointsPVQ(common::ROBOT_TARGET_VALUE value);
- bool rcClientInterfaceGetJointsPVQ(common::ROBOT_TARGET_VALUE *value);
- bool rcClientInterfaceDriverParameterSetting(
- robot_control::common::NAV_OR_JOY_MODE from,
- int motor_index, int which_core_of_driver,
- DRIVER_PARAM_SETTING_CMD cmd);
- bool rcClientInterfaceSetFormOfMovement(int mode);
- bool rcClientInterfaceSelectSomeJoints(unsigned int mask);
- bool rcClientInterfaceSelectSingleJoint(int axis_index, bool be_selected);
- bool rcClientInterfaceClearDriverError(unsigned int mask);
- bool rcClientInterfaceSetMaxTorqueLimit(int axis_index, double max_torque);
- bool rcClientInterfaceReCalibrateAllDriverAndSave(bool is_rough);
- bool rcClientInterfaceSetJointTestParameter (common::JointTestData joint_test_data);
- bool rcClientInterfaceSineMoveJointTestSwitch (bool be_enable);
- bool rcClientInterfaceQuitJointTest ();
- bool rcClientInterfaceClearErrorHistory(common::NAV_OR_JOY_MODE from);
- bool rcClientInterfaceClearLatestHistory(common::NAV_OR_JOY_MODE from);
- // }
- #endif // MC_CLIENT_INTERFACE_H
|