Talos docs

POST /path

Since 0.6
Plain text

Request

Request body: PathRequest

POST /path request.

FieldTypeRequiredDescription
fromnumber[3]yesStart position in world space.
tonumber[3]yesGoal position in world space.

Response

Response: PathResult

The full result of a path query.

FieldTypePresentDescription
statusPathStatusalwaysHow the query ended.
waypointsnumber[3][]alwaysWaypoints from from to as far as the query got, start and goal included. Empty when the status is start_off_mesh, goal_off_mesh, or failed.
lengthnumberalwaysSummed length of the waypoint run, in metres.
frameintegeralwaysThe frame the query ran on.
linksPathLinkView[]sometimesEvery off-mesh link the waypoints cross, in path order. Omitted when the route walks the whole way.

Response: PathLinkView

One link a path crosses: from waypoints[waypoint] to waypoints[waypoint + 1].

FieldTypePresentDescription
waypointintegeralwaysIndex of the waypoint where the crossing starts.
linkintegeralwaysIndex into GET /navmesh's links.
kindNavLinkKindViewalwaysWhat crossing it takes.
actionstringsometimesWhat to press at the start. Absent: just move.
holdnumbersometimesSeconds to hold action down. Absent when there is no action.
entitystringsometimesThe declaring entity; absent for a generated link.

Response: NavLinkKindView

What crossing a link takes. Mirrors argus_nav::NavLinkKind.

ValueMeaning
jumpJump from the start to the end.
dropWalk off the start and fall to the end.
genericAnything else; action says what to do.

Response: PathStatus

Why a path query ended the way it did. Mirrors argus_nav::PathOutcome.

ValueMeaning
completeThe waypoints reach the goal.
partialThe waypoints run as far as the navmesh allows, but stop short of the goal.
start_off_meshfrom is not on the navmesh.
goal_off_meshto is not on the navmesh.
failedBoth ends are on the mesh but no corridor connects them.

Example

curl -X POST "http://127.0.0.1:7700/path" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.