Hi all...
Iam new to AI planning and PDDL. So apologies if my question seems silly.
I have robot which has to travel to destination through some waypoints.
Iam able to create the waypoint and make the robot object traverse though it.
But i want to take it a step further and define the waypoints at particular coordinates.
Ex: consider the the axis's of the field as LAT and LONG ... hence WP1 (waypoint) is at LAT=1 and LONG=0 ,,,or WP2 is at LAT=4 and LONG=5. And then ask the robot just to go to the waypoint.
Iam not sure as to what would be the correct logic to implement this.
How do i achieve this using PDDL?
So far here is what i developed
Domain file:
(define (domain turtlebot)
(:requirements :strips :typing :fluents)
(:types
waypoint
robot
coordinates
)
(:predicates
(robot_at ?v - robot ?wp - waypoint)
(accessible ?v - robot ?wp1 ?wp2 - waypoint)
)
(:functions
(loc_lat ?lat - coordinates)
(loc_long ?long - coordinates)
)
(:action goto_waypoint
:parameters (?v - robot ?from ?to - waypoint)
:precondition (and
(robot_at ?v ?from)
(accessible ?v ?from ?to))
:effect (and
(robot_at ?v ?to)
(not (robot_at ?v ?from))
)
))
Problem file:
(define (problem task)
(:domain turtlebot)
(:objects
wp0 wp1 wp2 wp3 - waypoint
bunny - robot
lat long - coordinates
)
(:init
(loc_of_waypoint wp0 )
(robot_at bunny wp3)
(accessible bunny wp0 wp1)
(accessible bunny wp1 wp2)
(accessible bunny wp2 wp3)
(accessible bunny wp3 wp0)
)
(:goal (and
(robot_at bunny wp2)
)))
Thanks in advance
Hello there,
The functions you have already could use the waypoint type (and you wouldn't need coordinate).
(:functions
(loc_lat ?lat - waypoint)
(loc_long ?long - waypoint)
)
Hope that helps!
Best regards,
Michael