1#ifndef AGVC_INTERFACE_H
2#define AGVC_INTERFACE_H
7#define INTERFACE_VERSION_MAJOR 0
8#define INTERFACE_VERSION_MINOR 4
9#define INTERFACE_VERSION_PATCH 0
10#define INTERFACE_VERSION (INTERFACE_VERSION_MAJOR * 1000000 + INTERFACE_VERSION_MINOR * 1000 + INTERFACE_VERSION_PATCH)
425 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
440 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
470 int connectWifi(
const std::string &ssid,
const std::string &password);
502 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
630 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
632 const std::string &nav_board_charge_station_id =
"99999");
642 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
651 [[deprecated(
"Since 0.7.0: use getNavInfo() instead.")]]
666 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
668 const std::string &nav_board_charge_station_id =
"99999");
683 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
685 const std::string &leave_board_target_station_id =
"99999");
769 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
781 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
830 int setPriority(
const std::string &name,
const std::string &ip =
"");
943#define AgvcInterface_DECLARES \
944 _FUNC(AgvcInterface, 1, setSystemClock, stamp) \
945 _FUNC(AgvcInterface, 0, getAgvDetails) \
946 _FUNC(AgvcInterface, 0, getRunningInfo) \
947 _FUNC(AgvcInterface, 0, getAgvCurrentPose) \
948 _FUNC(AgvcInterface, 0, getAsyncInterfaceResultStatus) \
949 _FUNC(AgvcInterface, 0, getLaserPointCloud) \
950 _FUNC(AgvcInterface, 0, getAllStations) \
951 _FUNC(AgvcInterface, 1, getAllStationsOfTargetMap, map_header) \
952 _FUNC(AgvcInterface, 1, addStation, station) \
953 _FUNC(AgvcInterface, 1, addStations, stations) \
954 _FUNC(AgvcInterface, 2, addCPStationUseChargingBoard, station_header, dis_station_post) \
955 _FUNC(AgvcInterface, 1, deleteStation, station_header) \
956 _FUNC(AgvcInterface, 1, deleteStations, stations_header) \
957 _FUNC(AgvcInterface, 0, getAllPaths) \
958 _FUNC(AgvcInterface, 1, getAllPathsOfTargetMap, map_header) \
959 _FUNC(AgvcInterface, 0, getCurrentPath) \
960 _FUNC(AgvcInterface, 1, generatePath, path_station) \
961 _FUNC(AgvcInterface, 1, generatePaths, paths_station) \
962 _FUNC(AgvcInterface, 1, deletePath, path_header) \
963 _FUNC(AgvcInterface, 1, deletePaths, paths_header) \
964 _FUNC(AgvcInterface, 0, getMapList) \
965 _FUNC(AgvcInterface, 0, getCurrentMapHeader) \
966 _FUNC(AgvcInterface, 1, getGridMapFromAgv, map_header) \
967 _FUNC(AgvcInterface, 1, getBase64PngMapFromAgv, map_header) \
968 _FUNC(AgvcInterface, 3, previewPngMapFromAgv, map_header, image_width_px, image_height_px) \
969 _FUNC(AgvcInterface, 1, sendGridMapToAgv, map) \
970 _FUNC(AgvcInterface, 1, sendBase64PngMapToAgv, map) \
971 _FUNC(AgvcInterface, 1, saveMap, map_header) \
972 _FUNC(AgvcInterface, 1, switchMap, map_header) \
973 _FUNC(AgvcInterface, 1, deleteMap, map_header) \
974 _FUNC(AgvcInterface, 1, deleteMaps, map_headers) \
975 _FUNC(AgvcInterface, 0, getAllMapVirtualArea) \
976 _FUNC(AgvcInterface, 1, getAllMapVirtualAreaOfTargetMap, map_header) \
977 _FUNC(AgvcInterface, 1, addMapVirtualArea, map_virtual_area) \
978 _FUNC(AgvcInterface, 1, addMapVirtualAreas, map_virtual_areas) \
979 _FUNC(AgvcInterface, 1, deleteMapVirtualArea, virtual_area_header) \
980 _FUNC(AgvcInterface, 1, deleteMapVirtualAreas, virtual_areas_header) \
981 _FUNC(AgvcInterface, 1, getGridMapAllInfo, map_header) \
982 _FUNC(AgvcInterface, 1, getPngMapAllInfo, map_header) \
983 _FUNC(AgvcInterface, 2, setGridMapAllInfo, map_all_info, command_header) \
984 _FUNC(AgvcInterface, 2, setPngMapAllInfo, map_all_info, command_header) \
985 _FUNC(AgvcInterface, 1, deleteMapAllInfo, map_header) \
986 _FUNC(AgvcInterface, 0, getWifiList) \
987 _FUNC(AgvcInterface, 2, connectWifi, ssid, password) \
988 _FUNC(AgvcInterface, 1, enableHotspot, password) \
989 _FUNC(AgvcInterface, 0, getIpAddressList) \
990 _FUNC(AgvcInterface, 2, changeRunningMode, running_mode, command_header) \
991 _FUNC(AgvcInterface, 1, setControlSpeed, speed) \
992 _FUNC(AgvcInterface, 1, setNavGoal, target) \
993 _FUNC(AgvcInterface, 0, getNavInfo) \
994 _FUNC(AgvcInterface, 0, pauseAgvSpeed) \
995 _FUNC(AgvcInterface, 0, resumeAgvSpeed) \
996 _FUNC(AgvcInterface, 0, cancelNavigation) \
997 _FUNC(AgvcInterface, 2, relocation, init_pose, command_header) \
998 _FUNC(AgvcInterface, 0, getAgvControllerParametersFile) \
999 _FUNC(AgvcInterface, 1, setAgvControllerParametersFile, agv_parameters) \
1000 _FUNC(AgvcInterface, 0, refreshAgvControllerParametersFile) \
1001 _FUNC(AgvcInterface, 0, resetAgvControllerParametersFile) \
1002 _FUNC(AgvcInterface, 2, checkPowerAndAutoCharge, check_power_header, nav_board_charge_station_id) \
1003 _FUNC(AgvcInterface, 1, setLeaveBoardTargetStation, leave_board_target_station_header) \
1004 _FUNC(AgvcInterface, 0, getLeaveBoardTargetStation) \
1005 _FUNC(AgvcInterface, 2, forcedAgvToChargingBoard, forced_charge_header, nav_board_charge_station_id) \
1006 _FUNC(AgvcInterface, 2, forcedAgvLeaveChargingBoard, forced_leave_header, leave_board_target_station_id) \
1007 _FUNC(AgvcInterface, 1, sendAutoChargingCommand, auto_charging_command) \
1008 _FUNC(AgvcInterface, 0, getAgvLogMessage) \
1009 _FUNC(AgvcInterface, 1, updateSoftware, upgrade_pack_path) \
1010 _FUNC(AgvcInterface, 0, getSoftwareVersionList) \
1011 _FUNC(AgvcInterface, 1, switchSoftwareVersion, software_version) \
1012 _FUNC(AgvcInterface, 1, uninstallSoftware, software_version) \
1013 _FUNC(AgvcInterface, 1, updateFirmware, update_firmware) \
1014 _FUNC(AgvcInterface, 0, getUpdateFirmwareProcess) \
1015 _FUNC(AgvcInterface, 2, startCollectCalibrationData, type, command_header) \
1016 _FUNC(AgvcInterface, 2, cancelCollectCalibrationData, type, command_header) \
1017 _FUNC(AgvcInterface, 2, startCalibration, type, command_header) \
1018 _FUNC(AgvcInterface, 1, getCalibrationProcessInfo, type) \
1019 _FUNC(AgvcInterface, 0, restartAgv) \
1020 _FUNC(AgvcInterface, 1, setAgvName, agv_name) \
1021 _FUNC(AgvcInterface, 2, setPriority, name, ip) \
1022 _FUNC(AgvcInterface, 0, releasePriority) \
1023 _FUNC(AgvcInterface, 0, scriptPaused) \
1024 _FUNC(AgvcInterface, 0, scriptResume) \
1025 _FUNC(AgvcInterface, 0, scriptStop) \
1026 _FUNC(AgvcInterface, 0, getScriptStatus) \
1027 _FUNC(AgvcInterface, 1, setScriptStatus, status) \
1028 _FUNC(AgvcInterface, 1, errorCodeDecoder, error_code) \
1029 _FUNC(AgvcInterface, 0, getCurrentErrorCodes) \
1030 _FUNC(AgvcInterface, 0, soundLightPrompt) \
1031 _FUNC(AgvcInterface, 1, isObstacleAhead, detect_distance) \
1032 _FUNC(AgvcInterface, 1, getNearestStation, detect_distance) \
1033 _FUNC(AgvcInterface, 1, autoAlignRailway, command_header)
StationMark getNearestStation(const double &detect_distance=1.0)
获取指定检测距离范围内的最近站点信息
ScriptRuntimeState getScriptStatus()
获取脚本运行状态
std::vector< Point2d > getLaserPointCloud()
查询当前激光点云数据
std::vector< Header > getCurrentErrorCodes()
获取当前的错误码
Pose2d getAgvCurrentPose()
查询agv当前位姿
std::string errorCodeDecoder(const int &error_code)
错误码查询
std::string getAgvLogMessage()
获取agv运行中的日志信息
bool isObstacleAhead(const double &detect_distance=1.0)
agv行进方向是否有障碍物
AgvDetails getAgvDetails()
查询当前agv信息
RunningInfo getRunningInfo()
查询当前agv运行信息
int soundLightPrompt()
寻找agv,自动播放语音并特殊灯光闪烁
NavInfo getNavInfo()
获取当前导航信息
Header getLeaveBoardTargetStation()
获取自动下桩时的目标站点
int sendAutoChargingCommand(const AutoChargingCommand &auto_charging_command)
下发自动充电命令
int forcedAgvLeaveChargingBoard(const Header &forced_leave_header={ "99999", "99999", 99999, "99999" }, const std::string &leave_board_target_station_id="99999")
强制下桩
int setLeaveBoardTargetStation(const Header &leave_board_target_station_header)
设置自动下桩时的目标站点
int checkPowerAndAutoCharge(const Header &check_power_header={ "99999", "99999", 99999, "99999" }, const std::string &nav_board_charge_station_id="99999")
检测当前电量,电量低将自动上桩充电
int forcedAgvToChargingBoard(const Header &forced_charge_header={ "99999", "99999", 99999, "99999" }, const std::string &nav_board_charge_station_id="99999")
强制上桩充电
int setPngMapAllInfo(const MapAllInfo &map_all_info, const Header &command_header={ "99999", "99999", 1, "99999" })
设置Base64格式地图、路径、站点、虚拟区信息
Base64PngMap previewPngMapFromAgv(const Header &map_header, const int &image_width_px=0, const int &image_height_px=0)
获取预览图,可指定预览图的长和宽
int addMapVirtualArea(const MapVirtualArea &map_virtual_area)
添加/修改一个虚拟区域
int setGridMapAllInfo(const MapAllInfo &map_all_info, const Header &command_header={ "99999", "99999", 1, "99999" })
设置栅格地图、路径、站点、虚拟区信息
Base64PngMap getBase64PngMapFromAgv(const Header &map_header)
获取Base64编码的png地图信息
OccupancyGridMap getGridMapFromAgv(const Header &map_header)
获取指定栅格地图信息
int deleteMapAllInfo(const Header &map_header)
删除指定地图的全部信息(地图数据、站点、路径、虚拟区信息)
int deleteMaps(const std::vector< Header > &map_headers)
删除多张指定地图
int sendGridMapToAgv(const OccupancyGridMap &map)
将栅格地图信息发送给agv
std::vector< MapVirtualArea > getAllMapVirtualAreaOfTargetMap(const Header &map_header)
查询目标地图的虚拟区域
Header getCurrentMapHeader()
查询当前agv地图的信息头
int addMapVirtualAreas(const std::vector< MapVirtualArea > &map_virtual_areas)
添加/修改多个虚拟区域
int sendBase64PngMapToAgv(const Base64PngMap &map)
将Base64编码的Png地图发送给agv
MapAllInfo getGridMapAllInfo(const Header &map_header)
获取指定地图的栅格地图数据、路径、站点、虚拟区信息
std::vector< Header > getMapList()
获取agv所有地图的信息头
std::vector< MapVirtualArea > getAllMapVirtualArea()
查询当前地图的虚拟区域
int deleteMapVirtualAreas(const std::vector< Header > &virtual_areas_header)
删除多个指定虚拟区域
int deleteMap(const Header &map_header)
删除一张指定地图
int saveMap(const Header &map_header)
建图完成后,调用该接口保存地图
int deleteMapVirtualArea(const Header &virtual_area_header)
删除指定虚拟区域
MapAllInfo getPngMapAllInfo(const Header &map_header)
获取指定地图的Base64地图数据、路径、站点、虚拟区信息
int switchMap(const Header &map_header)
切换指定地图
int relocation(const Pose2d &init_pose, const Header &command_header={ "99999", "99999", 1, "99999" })
agv重定位
int setControlSpeed(const Speed &speed)
控制agv运动
int resumeAgvSpeed()
暂停后,恢复agv速度
int setNavGoal(const NavGoalType &target)
向agv发送导航任务
int pauseAgvSpeed()
暂停agv速度
int changeRunningMode(const RunningMode &running_mode, const Header &command_header={ "99999", "99999", 1, "99999" })
: 切换agv模式
int cancelNavigation()
取消导航任务
int generatePaths(const std::vector< PathStation > &paths_station)
生成/修改多条路径
std::vector< PathStation > getAllPaths()
查询当前地图的所有路径信息
PathStation getCurrentPath()
查询agv当前正在跟踪的路径信息
std::vector< PathStation > getAllPathsOfTargetMap(const Header &map_header)
查询指定地图的所有路径信息
int generatePath(const PathStation &path_station)
生成/修改一条路径
int deletePaths(const std::vector< Header > &paths_header)
删除多条路径
int deletePath(const Header &path_header)
删除一条路径
int deleteStation(const Header &station_header)
删除指定站点(会删除与该站点相关的路径)
std::vector< StationMark > getAllStationsOfTargetMap(const Header &map_header)
查询指定地图的所有站点信息
int addStation(const StationMark &station)
添加/修改一个站点
std::vector< StationMark > getAllStations()
查询当前地图的所有站点信息
int addStations(const std::vector< StationMark > &stations)
添加/修改多个站点
int deleteStations(const std::vector< Header > &stations_header)
删除多个站点(会删除与站点相关的路径)
int addCPStationUseChargingBoard(const Header &station_header, const double &dis_station_board=1.5)
通过自动识别充电桩位姿来添加充电站点
int updateSoftware(const std::string &upgrade_pack_path)
agv软件升级
AsyncInterfaceResultStatus getAsyncInterfaceResultStatus()
查询异步接口的运行情况,不代表异步接口本身的运行结果
int setScriptStatus(ScriptRuntimeState status)
设置脚本运行状态
int setPriority(const std::string &name, const std::string &ip="")
控制权设置
int setAgvName(const std::string &agv_name)
设置agv的名称
int autoAlignRailway(const Header &command_header={ "99999", "99999", 1, "99999" })
自动对接轨道并上轨
int enableHotspot(const std::string &password)
开启热点(自动切换到热点模式)
int connectWifi(const std::string &ssid, const std::string &password)
连接到指定WiFi(自动切换到WiFi模式)
int switchSoftwareVersion(const std::string &software_version)
切换agv软件版本
int setSystemClock(const std::string &stamp)
设置agv系统时间
int setAgvControllerParametersFile(const std::string &agv_parameters)
设置agv控制器的参数文件
std::vector< std::string > getSoftwareVersionList()
获取agv软件版本列表
int releasePriority()
释放控制权
int updateFirmware(const FirmwareUpdateParam &update_firmware)
agv固件更新
std::vector< std::string > getWifiList()
获取当前扫描到的WiFi列表
FirmwareUpdateProcessInfo getUpdateFirmwareProcess()
获取固件更新过程信息
int uninstallSoftware(const std::string &software_version)
卸载agv软件版本
std::string getAgvControllerParametersFile()
获取agv控制器的参数文件
int refreshAgvControllerParametersFile()
修改agv控制器的参数文件后,让agv各节点刷新参数
int resetAgvControllerParametersFile()
将agv控制器的参数文件恢复出厂设置
int startCalibration(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
开始标定
int cancelCollectCalibrationData(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
取消采集数据
CalibrationProcessInfo getCalibrationProcessInfo(const CalibrationType &type)
获取标定信息
int startCollectCalibrationData(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
开始采集数据
std::vector< IpAddressInfo > getIpAddressList()
获取本机所有IP地址
MapInfo OccupancyGridMap
栅格地图
std::shared_ptr< AgvcInterface > AgvcInterfacePtr
MapInfo Base64PngMap
Base64编码的png地图图片
异步接口运行状态 暂时存在14个异步接口:saveMap, switchMap, changeRunningMode, relocation, sendBase64PngMapToAgv getGrid...
包含当前地图、当前地图上的站点、当前地图上的路径、当前地图上的虚拟区域信息