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)
715 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
739 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
787 int connectWifi(
const std::string &ssid,
const std::string &password);
836 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
1038 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
1040 const std::string &nav_board_charge_station_id =
"99999");
1055 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
1068 [[deprecated(
"Since 0.7.0: use getNavInfo() instead.")]]
1090 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
1092 const std::string &nav_board_charge_station_id =
"99999");
1113 [[deprecated(
"Since 0.7.0: use sendAutoChargingCommand(const AutoChargingCommand&) instead.")]]
1115 const std::string &leave_board_target_station_id =
"99999");
1243 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
1261 const Header &command_header = {
"99999",
"99999", 1,
"99999" });
1496#define AgvcInterface_DECLARES \
1497 _FUNC(AgvcInterface, 1, setSystemClock, stamp) \
1498 _FUNC(AgvcInterface, 0, getAgvDetails) \
1499 _FUNC(AgvcInterface, 0, getRunningInfo) \
1500 _FUNC(AgvcInterface, 0, getAgvCurrentPose) \
1501 _FUNC(AgvcInterface, 0, getAsyncInterfaceResultStatus) \
1502 _FUNC(AgvcInterface, 0, getLaserPointCloud) \
1503 _FUNC(AgvcInterface, 0, getAllStations) \
1504 _FUNC(AgvcInterface, 1, getAllStationsOfTargetMap, map_header) \
1505 _FUNC(AgvcInterface, 1, addStation, station) \
1506 _FUNC(AgvcInterface, 1, addStations, stations) \
1507 _FUNC(AgvcInterface, 2, addCPStationUseChargingBoard, station_header, dis_station_post) \
1508 _FUNC(AgvcInterface, 1, deleteStation, station_header) \
1509 _FUNC(AgvcInterface, 1, deleteStations, stations_header) \
1510 _FUNC(AgvcInterface, 0, getAllPaths) \
1511 _FUNC(AgvcInterface, 1, getAllPathsOfTargetMap, map_header) \
1512 _FUNC(AgvcInterface, 0, getCurrentPath) \
1513 _FUNC(AgvcInterface, 1, generatePath, path_station) \
1514 _FUNC(AgvcInterface, 1, generatePaths, paths_station) \
1515 _FUNC(AgvcInterface, 1, deletePath, path_header) \
1516 _FUNC(AgvcInterface, 1, deletePaths, paths_header) \
1517 _FUNC(AgvcInterface, 0, getMapList) \
1518 _FUNC(AgvcInterface, 0, getCurrentMapHeader) \
1519 _FUNC(AgvcInterface, 1, getGridMapFromAgv, map_header) \
1520 _FUNC(AgvcInterface, 1, getBase64PngMapFromAgv, map_header) \
1521 _FUNC(AgvcInterface, 3, previewPngMapFromAgv, map_header, image_width_px, image_height_px) \
1522 _FUNC(AgvcInterface, 1, sendGridMapToAgv, map) \
1523 _FUNC(AgvcInterface, 1, sendBase64PngMapToAgv, map) \
1524 _FUNC(AgvcInterface, 1, saveMap, map_header) \
1525 _FUNC(AgvcInterface, 1, switchMap, map_header) \
1526 _FUNC(AgvcInterface, 1, deleteMap, map_header) \
1527 _FUNC(AgvcInterface, 1, deleteMaps, map_headers) \
1528 _FUNC(AgvcInterface, 0, getAllMapVirtualArea) \
1529 _FUNC(AgvcInterface, 1, getAllMapVirtualAreaOfTargetMap, map_header) \
1530 _FUNC(AgvcInterface, 1, addMapVirtualArea, map_virtual_area) \
1531 _FUNC(AgvcInterface, 1, addMapVirtualAreas, map_virtual_areas) \
1532 _FUNC(AgvcInterface, 1, deleteMapVirtualArea, virtual_area_header) \
1533 _FUNC(AgvcInterface, 1, deleteMapVirtualAreas, virtual_areas_header) \
1534 _FUNC(AgvcInterface, 1, getGridMapAllInfo, map_header) \
1535 _FUNC(AgvcInterface, 1, getPngMapAllInfo, map_header) \
1536 _FUNC(AgvcInterface, 2, setGridMapAllInfo, map_all_info, command_header) \
1537 _FUNC(AgvcInterface, 2, setPngMapAllInfo, map_all_info, command_header) \
1538 _FUNC(AgvcInterface, 1, deleteMapAllInfo, map_header) \
1539 _FUNC(AgvcInterface, 0, getWifiList) \
1540 _FUNC(AgvcInterface, 2, connectWifi, ssid, password) \
1541 _FUNC(AgvcInterface, 1, enableHotspot, password) \
1542 _FUNC(AgvcInterface, 0, getIpAddressList) \
1543 _FUNC(AgvcInterface, 2, changeRunningMode, running_mode, command_header) \
1544 _FUNC(AgvcInterface, 1, setControlSpeed, speed) \
1545 _FUNC(AgvcInterface, 1, setNavGoal, target) \
1546 _FUNC(AgvcInterface, 0, getNavInfo) \
1547 _FUNC(AgvcInterface, 0, pauseAgvSpeed) \
1548 _FUNC(AgvcInterface, 0, resumeAgvSpeed) \
1549 _FUNC(AgvcInterface, 0, cancelNavigation) \
1550 _FUNC(AgvcInterface, 2, relocation, init_pose, command_header) \
1551 _FUNC(AgvcInterface, 0, getAgvControllerParametersFile) \
1552 _FUNC(AgvcInterface, 1, setAgvControllerParametersFile, agv_parameters) \
1553 _FUNC(AgvcInterface, 0, refreshAgvControllerParametersFile) \
1554 _FUNC(AgvcInterface, 0, resetAgvControllerParametersFile) \
1555 _FUNC(AgvcInterface, 2, checkPowerAndAutoCharge, check_power_header, nav_board_charge_station_id) \
1556 _FUNC(AgvcInterface, 1, setLeaveBoardTargetStation, leave_board_target_station_header) \
1557 _FUNC(AgvcInterface, 0, getLeaveBoardTargetStation) \
1558 _FUNC(AgvcInterface, 2, forcedAgvToChargingBoard, forced_charge_header, nav_board_charge_station_id) \
1559 _FUNC(AgvcInterface, 2, forcedAgvLeaveChargingBoard, forced_leave_header, leave_board_target_station_id) \
1560 _FUNC(AgvcInterface, 1, sendAutoChargingCommand, auto_charging_command) \
1561 _FUNC(AgvcInterface, 0, getAgvLogMessage) \
1562 _FUNC(AgvcInterface, 1, updateSoftware, upgrade_pack_path) \
1563 _FUNC(AgvcInterface, 0, getSoftwareVersionList) \
1564 _FUNC(AgvcInterface, 1, switchSoftwareVersion, software_version) \
1565 _FUNC(AgvcInterface, 1, uninstallSoftware, software_version) \
1566 _FUNC(AgvcInterface, 1, updateFirmware, update_firmware) \
1567 _FUNC(AgvcInterface, 0, getUpdateFirmwareProcess) \
1568 _FUNC(AgvcInterface, 2, startCollectCalibrationData, type, command_header) \
1569 _FUNC(AgvcInterface, 2, cancelCollectCalibrationData, type, command_header) \
1570 _FUNC(AgvcInterface, 2, startCalibration, type, command_header) \
1571 _FUNC(AgvcInterface, 1, getCalibrationProcessInfo, type) \
1572 _FUNC(AgvcInterface, 0, restartAgv) \
1573 _FUNC(AgvcInterface, 1, setAgvName, agv_name) \
1574 _FUNC(AgvcInterface, 2, setPriority, name, ip) \
1575 _FUNC(AgvcInterface, 0, releasePriority) \
1576 _FUNC(AgvcInterface, 0, scriptPaused) \
1577 _FUNC(AgvcInterface, 0, scriptResume) \
1578 _FUNC(AgvcInterface, 0, scriptStop) \
1579 _FUNC(AgvcInterface, 0, getScriptStatus) \
1580 _FUNC(AgvcInterface, 1, setScriptStatus, status) \
1581 _FUNC(AgvcInterface, 1, errorCodeDecoder, error_code) \
1582 _FUNC(AgvcInterface, 0, getCurrentErrorCodes) \
1583 _FUNC(AgvcInterface, 0, soundLightPrompt) \
1584 _FUNC(AgvcInterface, 1, isObstacleAhead, detect_distance) \
1585 _FUNC(AgvcInterface, 1, getNearestStation, detect_distance) \
1586 _FUNC(AgvcInterface, 1, autoAlignRailway, command_header)
StationMark getNearestStation(const double &detect_distance=1.0)
获取指定检测距离范围内的最近站点信息。 检测距离,默认为1.0m。 最近站点信息,id为NONE代表检测距离内无站点。
ScriptRuntimeState getScriptStatus()
获取脚本运行状态。 脚本运行状态。
std::vector< Point2d > getLaserPointCloud()
std::vector< Header > getCurrentErrorCodes()
获取当前的错误码。 错误码集合。
Pose2d getAgvCurrentPose()
std::string errorCodeDecoder(const int &error_code)
错误码查询。 错误码。 错误码含义;为空表示错误码未知。
std::string getAgvLogMessage()
获取AGV运行中的日志信息。 AGV运行中的日志信息。
bool isObstacleAhead(const double &detect_distance=1.0)
AGV行进方向是否有障碍物。 检测距离,默认为1.0m。 true:行进方向存在障碍物;false:行进方向无障碍物。
AgvDetails getAgvDetails()
RunningInfo getRunningInfo()
int soundLightPrompt()
寻找AGV,自动播放语音并特殊灯光闪烁。 10100000:寻找指令下发成功;else:下发指令失败。
Header getLeaveBoardTargetStation()
获取自动下桩时的目标站点。 自动下桩时的目标站点Header信息。
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)
设置自动下桩时的目标站点。 自动下桩的站点header信息。 10100000:设置自动下桩站点成功;else:设置自动下桩站点失败。
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" })
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)
添加或修改一个虚拟区域。 待添加或修改的虚拟区域信息。 10100000:添加或修改虚拟区域成功;else:添加或修改虚拟区域失败。
int setGridMapAllInfo(const MapAllInfo &map_all_info, const Header &command_header={ "99999", "99999", 1, "99999" })
Base64PngMap getBase64PngMapFromAgv(const Header &map_header)
OccupancyGridMap getGridMapFromAgv(const Header &map_header)
获取指定栅格地图信息。 指定地图的信息头(本次异步命令id,名称,时间,地图id)。 map_id为"current_map"时,可特指为当前地图。 指定栅格地图信息。
int deleteMapAllInfo(const Header &map_header)
删除指定地图的全部信息,包括地图数据、站点、路径、虚拟区信息。 指定地图信息头(命令id,地图名称,时间,地图id)。 10100000:删除成功;else:删除失败。
int deleteMaps(const std::vector< Header > &map_headers)
删除多张指定地图。 多个指定地图的信息头(命令id,名称,时间,地图id)。 10100000:删除地图成功;else:删除地图失败。
int sendGridMapToAgv(const OccupancyGridMap &map)
std::vector< MapVirtualArea > getAllMapVirtualAreaOfTargetMap(const Header &map_header)
查询目标地图的虚拟区域。 指定地图header(命令id,名称,时间,地图id)。 指定地图的所有虚拟区域。
Header getCurrentMapHeader()
查询当前AGV地图的信息头。 当前地图的信息头(命令id,名称,时间,地图id)。
int addMapVirtualAreas(const std::vector< MapVirtualArea > &map_virtual_areas)
添加或修改多个虚拟区域。 待添加或修改的虚拟区域信息。 10100000:添加或修改虚拟区域成功;else:添加或修改虚拟区域失败。
int sendBase64PngMapToAgv(const Base64PngMap &map)
MapAllInfo getGridMapAllInfo(const Header &map_header)
std::vector< Header > getMapList()
获取AGV所有地图的信息头。 所有地图的信息头(命令id,名称,时间,地图id)。
std::vector< MapVirtualArea > getAllMapVirtualArea()
查询当前地图的虚拟区域。 当前地图的虚拟区域信息。
int deleteMapVirtualAreas(const std::vector< Header > &virtual_areas_header)
删除多个指定虚拟区域。 指定虚拟区域信息头(命令id,虚拟区域名称,时间,所在地图id)。 10100000:删除虚拟区域成功;else:删除虚拟区域失败。
int deleteMap(const Header &map_header)
删除一张指定地图。 指定地图的信息头(命令id,名称,时间,地图id)。 10100000:删除地图成功;else:删除地图失败。
int saveMap(const Header &map_header)
int deleteMapVirtualArea(const Header &virtual_area_header)
删除指定虚拟区域。 指定虚拟区域信息头(命令id,虚拟区域名称,时间,所在地图id)。 10100000:删除虚拟区域成功;else:删除虚拟区域失败。
MapAllInfo getPngMapAllInfo(const Header &map_header)
int switchMap(const Header &map_header)
int relocation(const Pose2d &init_pose, const Header &command_header={ "99999", "99999", 1, "99999" })
int setControlSpeed(const Speed &speed)
int setNavGoal(const NavGoalType &target)
int changeRunningMode(const RunningMode &running_mode, const Header &command_header={ "99999", "99999", 1, "99999" })
int generatePaths(const std::vector< PathStation > &paths_station)
生成或修改多条路径。 待生成或修改的路径信息。 10100000:修改或生成路径成功;else:修改或生成路径失败。
std::vector< PathStation > getAllPaths()
查询当前地图的所有路径信息。 当前地图的所有路径信息。
PathStation getCurrentPath()
查询AGV当前正在跟踪的路径信息。 当前正在跟踪的路径信息。
std::vector< PathStation > getAllPathsOfTargetMap(const Header &map_header)
查询指定地图的所有路径信息。 指定地图header(命令id,名称,时间,地图id)。 指定地图的所有路径信息。
int generatePath(const PathStation &path_station)
生成或修改一条路径。 待生成或修改的路径信息。 10100000:修改或生成路径成功;else:修改或生成路径失败。
int deletePaths(const std::vector< Header > &paths_header)
删除多条路径。 待删除路径信息(路径id,名称,时间,地图id)。 10100000:删除路径成功;else:删除路径失败。
int deletePath(const Header &path_header)
删除一条路径。 待删除路径信息(路径id,名称,时间,地图id)。 10100000:删除路径成功;else:删除路径失败。
int deleteStation(const Header &station_header)
删除指定站点,会删除与该站点相关的路径。 待删除站点信息(站点id,名称,时间,地图id)。 10100000:删除站点成功;else:删除站点失败。
std::vector< StationMark > getAllStationsOfTargetMap(const Header &map_header)
查询指定地图的所有站点信息。 指定地图header(命令id,名称,时间,地图id)。 指定地图的所有站点信息。
int addStation(const StationMark &station)
添加或修改一个站点。 待添加或修改的站点信息。 10100000:添加或修改站点成功;else:添加或修改站点失败。
std::vector< StationMark > getAllStations()
查询当前地图的所有站点信息。 当前地图的所有站点信息。
int addStations(const std::vector< StationMark > &stations)
添加或修改多个站点。 待添加或修改的站点信息。 10100000:添加或修改站点成功;else:添加或修改站点失败。
int deleteStations(const std::vector< Header > &stations_header)
删除多个站点,会删除与站点相关的路径。 待删除站点信息(站点id,名称,时间,地图id)。 10100000:删除站点成功;else:删除站点失败。
int addCPStationUseChargingBoard(const Header &station_header, const double &dis_station_board=1.5)
通过自动识别充电桩位姿来添加充电站点。 待添加或修改的充电站点信息(站点id,名称,时间,地图id)。 充电站点与充电桩之间的距离(充电站点位于AGV中心),单位:m,范围[1....
int updateSoftware(const std::string &upgrade_pack_path)
AGV软件升级。 升级包路径,例如"/root/agvc_release-0.1.1+398d1f7-Linux_x86_64.tar.gz"。 10100000:目标版本升级成功;10100201:正...
int scriptPaused()
暂停脚本。 10100000:脚本暂停成功;else:脚本暂停失败。
AsyncInterfaceResultStatus getAsyncInterfaceResultStatus()
查询异步接口的运行情况,不代表异步接口本身的运行结果。 异步接口:saveMap, switchMap, changeRunningMode, relocation,...
int setScriptStatus(ScriptRuntimeState status)
设置脚本运行状态。 10100000:设置脚本运行状态成功;else:设置脚本运行状态失败。
int setPriority(const std::string &name, const std::string &ip="")
设置控制权。 1.
int setAgvName(const std::string &agv_name)
设置AGV的名称。 设置的AGV名称。 10100000:设置名称成功;else:设置名称失败。
int restartAgv()
重启AGV。 10100000:重启指令执行成功;else:重启指令执行失败。
int autoAlignRailway(const Header &command_header={ "99999", "99999", 1, "99999" })
int enableHotspot(const std::string &password)
开启热点,自动切换到热点模式。 必须在有线连接时调用,且执行时间较长。 热点密码;如果为空使用"administrator"为默认密码,SSID默认为SN码。 10100000:启用热点成功;else:...
int connectWifi(const std::string &ssid, const std::string &password)
连接到指定WiFi,自动切换到WiFi模式。 必须在有线连接时调用,且执行时间较长。 WiFi名称。 WiFi密码。 10100000:连接WiFi成功;else:连接WiFi失败。
int switchSoftwareVersion(const std::string &software_version)
切换AGV软件版本。 软件版本,例如"0.3.2+3b807d1-Linux_x86_64"。 10100000:软件版本切换成功;else:软件版本切换失败。
int setSystemClock(const std::string &stamp)
设置AGV系统时间。 时间戳,格式为YYYY-MM-DDTHH:mm:ss.ssZ,例如“2017-04-15T11:40:03.12Z”。
int setAgvControllerParametersFile(const std::string &agv_parameters)
std::vector< std::string > getSoftwareVersionList()
获取AGV软件版本列表。 软件版本列表集合 {0.3.2+3b807d1-Linux_x86_64,0.6.3-patch.3+b8c6aa4-Linux_x86_64}...
int releasePriority()
释放控制权。 10100000:释放控制权成功;else:释放控制权失败。
int updateFirmware(const FirmwareUpdateParam &update_firmware)
AGV固件更新。 配置要更新固件的模块、固件存储路径。 10100000:下发固件更新信息成功;else:固件正在更新中。
std::vector< std::string > getWifiList()
FirmwareUpdateProcessInfo getUpdateFirmwareProcess()
获取固件更新过程信息。 固件更新步骤信息(步骤信息为failed代表更新失败),更新进度(进度信息为1.0代表更新成功)。
int uninstallSoftware(const std::string &software_version)
卸载AGV软件版本。 软件版本,例如"0.3.2+3b807d1-Linux_x86_64"。 10100000:软件版本卸载成功;else:软件版本卸载失败。
std::string getAgvControllerParametersFile()
获取AGV控制器的参数文件。 当前AGV控制器中的参数信息。
int refreshAgvControllerParametersFile()
int resetAgvControllerParametersFile()
int scriptStop()
停止脚本。 10100000:脚本停止成功;else:脚本停止失败。
int startCalibration(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
开始标定。 标定类型。 id字段代表下发本次命令的id;其他字段无特殊含义。 10100000:接口调用成功;10120202:无控制权;else:接口调用失败。
int cancelCollectCalibrationData(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
取消采集数据。 标定类型。 id字段代表下发本次命令的id;其他字段无特殊含义。 10100000:接口调用成功;10120202:无控制权;else:接口调用失败。
CalibrationProcessInfo getCalibrationProcessInfo(const CalibrationType &type)
获取标定信息。 标定类型。 标定信息。
int scriptResume()
恢复脚本。 10100000:脚本恢复成功;else:脚本恢复失败。
int startCollectCalibrationData(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
开始采集数据。 LASER_ODOM标定采集数据量要求大于1000组,具体数据量可以在配置文件中修改。 标定类型。 id字段代表下发本次命令的id;其他字段无特殊含义。 10100000:接口调用成功;...
std::vector< IpAddressInfo > getIpAddressList()
获取本机所有IP地址。 本机所有IP地址。
MapInfo OccupancyGridMap
栅格地图
std::shared_ptr< AgvcInterface > AgvcInterfacePtr
MapInfo Base64PngMap
Base64编码的png地图图片
异步接口运行状态 暂时存在14个异步接口:saveMap, switchMap, changeRunningMode, relocation, sendBase64PngMapToAgv getGrid...
包含当前地图、当前地图上的站点、当前地图上的路径、当前地图上的虚拟区域信息