You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.5 KiB

package IndoorNavigationWaypointTracing;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.AgentController;
import jade.wrapper.StaleProxyException;
public class Launch {
//-----------------------------------------user inputs------------------------------------------------------//
//Planning model paths
public static final String domainFilePath = "/home/ys/eclipse-workspace/AutoRobot/PDDLFiles/domain_turtlebot.pddl";
public static final String problemFilePath = "/home/ys/eclipse-workspace/AutoRobot/PDDLFiles/problem_turtlebot.pddl";
//ROS services
public static final String problemGenerationServiceName = "/rosplan_problem_interface/problem_generation_server";
public static final String problemGenerationServiceType = "std_srvs/Empty";
public static final String planServiceName = "/rosplan_planner_interface/planning_server";
public static final String planServiceType = "std_srvs/Empty";
public static final String parseServiceName = "/rosplan_parsing_interface/parse_plan";
public static final String parseServiceType = "std_srvs/Empty";
public static final String dispatchServiceName = "/rosplan_plan_dispatcher/dispatch_plan";
public static final String dispatchServiceType = "rosplan_dispatch_msgs/DispatchService";
//public static final String dispatchServiceType = "std_srvs/Empty";
//ROS topics
public static final String actionDispatchFeedbackTopicName = "/rosplan_plan_dispatcher/action_feedback";
public static final String actionDispatchFeedbackTopicType = "rosplan_dispatch_msgs/ActionFeedback";
//ROS topics
public static final String planTopicName = "/rosplan_planner_interface/planner_output";
public static final String planType = "std_msgs/String";
//DataStore keys
public static final String planDispatchDataKey = "planDispatch";
public static final String planFeedbackDataKey = "planFeedback";
public static final String actionDispatchDataKey = "actionDispatch";
public static String actionFeedbackDataKey = "actionFeedback";
public static void main(String[] args) throws InterruptedException {
//automatically generated
jade.core.Runtime rt = jade.core.Runtime.instance();
Profile pContainer = new ProfileImpl(null, 8888, null);
rt.setCloseVM(true);
Profile pMain = new ProfileImpl(null, 1099, null);
pMain.setParameter(Profile.SERVICES, "jade.core.messaging.TopicManagementService");
System.out.println("Launching a whole in-process platform..." + pMain);
jade.wrapper.AgentContainer mc = rt.createMainContainer(pMain);
jade.wrapper.AgentContainer agentContainer = rt.createAgentContainer(pContainer);
System.out.println("continue");
try {
AgentController PlannerAgentAgent = agentContainer.createNewAgent("PlannerAgent", "IndoorNavigationWaypointTracing.MultiAgentSystem.PlannerAgent", null);
PlannerAgentAgent.start();
} catch (StaleProxyException e) {
e.printStackTrace();
}
Thread.sleep(15000);
try {
AgentController PlanDispatchAgentAgent = agentContainer.createNewAgent("PlanDispatchAgent", "IndoorNavigationWaypointTracing.MultiAgentSystem.PlanDispatchAgent", null);
PlanDispatchAgentAgent.start();
} catch (StaleProxyException e) {
e.printStackTrace();
}
Thread.sleep(15000);
try {
AgentController MoveAgentAgent = agentContainer.createNewAgent("MoveAgent", "IndoorNavigationWaypointTracing.MultiAgentSystem.MoveAgent", null);
MoveAgentAgent.start();
} catch (StaleProxyException e) {
e.printStackTrace();
}
Thread.sleep(15000);
}
}