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)
Gets the nearest station within the specified detection distance.
ScriptRuntimeState getScriptStatus()
Gets the script runtime state.
std::vector< Point2d > getLaserPointCloud()
Queries the current laser point cloud data.
std::vector< Header > getCurrentErrorCodes()
Gets current error codes.
Pose2d getAgvCurrentPose()
Queries the current AGV pose.
std::string errorCodeDecoder(const int &error_code)
Queries an error code.
std::string getAgvLogMessage()
Gets AGV runtime log messages.
bool isObstacleAhead(const double &detect_distance=1.0)
Checks whether there is an obstacle in the AGV travel direction.
AgvDetails getAgvDetails()
Queries current AGV information.
RunningInfo getRunningInfo()
Queries current AGV running information.
int soundLightPrompt()
Locates the AGV by automatically playing audio and flashing special lights.
NavInfo getNavInfo()
Gets current navigation information.
Header getLeaveBoardTargetStation()
Gets the target station for automatic undocking.
int sendAutoChargingCommand(const AutoChargingCommand &auto_charging_command)
Sends an automatic charging command.
int forcedAgvLeaveChargingBoard(const Header &forced_leave_header={ "99999", "99999", 99999, "99999" }, const std::string &leave_board_target_station_id="99999")
Forces the AGV to leave the charging board.
int setLeaveBoardTargetStation(const Header &leave_board_target_station_header)
Sets the target station for automatic undocking.
int checkPowerAndAutoCharge(const Header &check_power_header={ "99999", "99999", 99999, "99999" }, const std::string &nav_board_charge_station_id="99999")
Checks the current battery level and automatically docks for charging when the battery is low.
int forcedAgvToChargingBoard(const Header &forced_charge_header={ "99999", "99999", 99999, "99999" }, const std::string &nav_board_charge_station_id="99999")
Forces the AGV to dock for charging.
int setPngMapAllInfo(const MapAllInfo &map_all_info, const Header &command_header={ "99999", "99999", 1, "99999" })
Sets Base64 map, path, station, and virtual area information.
Base64PngMap previewPngMapFromAgv(const Header &map_header, const int &image_width_px=0, const int &image_height_px=0)
Gets a preview image with optional width and height.
int addMapVirtualArea(const MapVirtualArea &map_virtual_area)
Adds or modifies one virtual area.
int setGridMapAllInfo(const MapAllInfo &map_all_info, const Header &command_header={ "99999", "99999", 1, "99999" })
Sets occupancy grid map, path, station, and virtual area information.
Base64PngMap getBase64PngMapFromAgv(const Header &map_header)
Gets Base64-encoded PNG map information.
OccupancyGridMap getGridMapFromAgv(const Header &map_header)
Gets the specified occupancy grid map information.
int deleteMapAllInfo(const Header &map_header)
Deletes all information of the specified map, including map data, stations, paths,...
int deleteMaps(const std::vector< Header > &map_headers)
Deletes multiple specified maps.
int sendGridMapToAgv(const OccupancyGridMap &map)
Sends occupancy grid map information to the AGV.
std::vector< MapVirtualArea > getAllMapVirtualAreaOfTargetMap(const Header &map_header)
Queries virtual areas on the target map.
Header getCurrentMapHeader()
Queries the header of the current AGV map.
int addMapVirtualAreas(const std::vector< MapVirtualArea > &map_virtual_areas)
Adds or modifies multiple virtual areas.
int sendBase64PngMapToAgv(const Base64PngMap &map)
Sends a Base64-encoded PNG map to the AGV.
MapAllInfo getGridMapAllInfo(const Header &map_header)
Gets occupancy grid map data, paths, stations, and virtual areas for the specified map.
std::vector< Header > getMapList()
Gets the headers of all maps on the AGV.
std::vector< MapVirtualArea > getAllMapVirtualArea()
Queries virtual areas on the current map.
int deleteMapVirtualAreas(const std::vector< Header > &virtual_areas_header)
Deletes multiple specified virtual areas.
int deleteMap(const Header &map_header)
Deletes one specified map.
int saveMap(const Header &map_header)
Saves the map after mapping is complete.
int deleteMapVirtualArea(const Header &virtual_area_header)
Deletes the specified virtual area.
MapAllInfo getPngMapAllInfo(const Header &map_header)
Gets Base64 map data, paths, stations, and virtual areas for the specified map.
int switchMap(const Header &map_header)
Switches to the specified map.
int relocation(const Pose2d &init_pose, const Header &command_header={ "99999", "99999", 1, "99999" })
Relocates the AGV.
int setControlSpeed(const Speed &speed)
Controls AGV motion.
int resumeAgvSpeed()
Resumes AGV speed after a pause.
int setNavGoal(const NavGoalType &target)
Sends a navigation goal to the AGV.
int pauseAgvSpeed()
Pauses AGV speed.
int changeRunningMode(const RunningMode &running_mode, const Header &command_header={ "99999", "99999", 1, "99999" })
Switches the AGV running mode.
int cancelNavigation()
Cancels the navigation task.
int generatePaths(const std::vector< PathStation > &paths_station)
Generates or modifies multiple paths.
std::vector< PathStation > getAllPaths()
Queries all path information on the current map.
PathStation getCurrentPath()
Queries the path currently being tracked by the AGV.
std::vector< PathStation > getAllPathsOfTargetMap(const Header &map_header)
Queries all path information on the specified map.
int generatePath(const PathStation &path_station)
Generates or modifies one path.
int deletePaths(const std::vector< Header > &paths_header)
Deletes multiple paths.
int deletePath(const Header &path_header)
Deletes one path.
int deleteStation(const Header &station_header)
Deletes the specified station and its related paths.
std::vector< StationMark > getAllStationsOfTargetMap(const Header &map_header)
Queries all station information on the specified map.
int addStation(const StationMark &station)
Adds or modifies one station.
std::vector< StationMark > getAllStations()
Queries all station information on the current map.
int addStations(const std::vector< StationMark > &stations)
Adds or modifies multiple stations.
int deleteStations(const std::vector< Header > &stations_header)
Deletes multiple stations and their related paths.
int addCPStationUseChargingBoard(const Header &station_header, const double &dis_station_board=1.5)
Adds a charging station by automatically recognizing the charging board pose.
int updateSoftware(const std::string &upgrade_pack_path)
Upgrades AGV software.
int scriptPaused()
Pauses the script.
AsyncInterfaceResultStatus getAsyncInterfaceResultStatus()
Queries the running status of asynchronous APIs; this does not represent each API's own execution res...
int setScriptStatus(ScriptRuntimeState status)
Sets the script runtime state.
int setPriority(const std::string &name, const std::string &ip="")
Sets control priority.
int setAgvName(const std::string &agv_name)
Sets the AGV name.
int restartAgv()
Restarts the AGV.
int autoAlignRailway(const Header &command_header={ "99999", "99999", 1, "99999" })
Automatically aligns with the rail and boards the rail.
int enableHotspot(const std::string &password)
Enables hotspot mode and automatically switches to hotspot mode.
int connectWifi(const std::string &ssid, const std::string &password)
Connects to the specified WiFi and automatically switches to WiFi mode.
int switchSoftwareVersion(const std::string &software_version)
Switches the AGV software version.
int setSystemClock(const std::string &stamp)
Sets the AGV system time.
int setAgvControllerParametersFile(const std::string &agv_parameters)
Sets the AGV controller parameter file.
std::vector< std::string > getSoftwareVersionList()
Gets the AGV software version list.
int releasePriority()
Releases control priority.
int updateFirmware(const FirmwareUpdateParam &update_firmware)
Updates AGV firmware.
std::vector< std::string > getWifiList()
Gets the currently scanned WiFi list.
FirmwareUpdateProcessInfo getUpdateFirmwareProcess()
Gets firmware update process information.
int uninstallSoftware(const std::string &software_version)
Uninstalls an AGV software version.
std::string getAgvControllerParametersFile()
Gets the AGV controller parameter file.
int refreshAgvControllerParametersFile()
Refreshes parameters on AGV nodes after the AGV controller parameter file is modified.
int resetAgvControllerParametersFile()
Restores the AGV controller parameter file to factory defaults.
int scriptStop()
Stops the script.
int startCalibration(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
Starts calibration.
int cancelCollectCalibrationData(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
Cancels calibration data collection.
CalibrationProcessInfo getCalibrationProcessInfo(const CalibrationType &type)
Gets calibration information.
int scriptResume()
Resumes the script.
int startCollectCalibrationData(const CalibrationType &type, const Header &command_header={ "99999", "99999", 1, "99999" })
Starts collecting calibration data.
std::vector< IpAddressInfo > getIpAddressList()
Gets all local IP addresses.
MapInfo OccupancyGridMap
栅格地图
std::shared_ptr< AgvcInterface > AgvcInterfacePtr
MapInfo Base64PngMap
Base64编码的png地图图片
异步接口运行状态 暂时存在14个异步接口:saveMap, switchMap, changeRunningMode, relocation, sendBase64PngMapToAgv getGrid...
包含当前地图、当前地图上的站点、当前地图上的路径、当前地图上的虚拟区域信息