-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/multi robot planner rebase #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. I made a couple of specific notes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not add any of the Sample_from_Jake directory to the repo
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def explicit_edges_from_layer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse any of these functions from the single-robot case? I think the edge construction should be exactly the same, and maybe a couple of other functions?
|
|
||
| # Filter goal string to only include available objects | ||
| available_object_names = [o.symbol for o in object_symbols] | ||
| print(f"DEBUG: Available objects: {available_object_names}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to add debug prints, you should use logger.debug, because once we are running from inside a ROS node it will hide all of the print outputs.
| print("length of all_objects: ", len(all_objects)) | ||
| print("length of all_places: ", len(all_places)) | ||
| # Apply optional limits to keep the problem manageable | ||
| max_places = int(os.environ.get("MR_MAX_PLACES", "20")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you have a smaller scene graph to test on we can probably remove these, but if you still want limits like this then we should have them passed in as arguments and not read directly from the environment.
| init_facts += [fmt_fact(f) for f in object_at_facts] | ||
| init_facts += [fmt_fact(f) for f in suspicious_facts] | ||
|
|
||
| problem_str = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at PddlProblem in pddl_grounding.py -- We have a class where you can set domain, objects, initial_facts, goal, and turn optimizing on or off, and it will dump to the correct PDDL problem string
|
Oh, also you should set up |
|
@JY-HIM4U I just pushed the |
6deb31b to
2cc2e72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of small cleanup requests.
| return f"(and {' '.join(safe_goals)})" | ||
|
|
||
|
|
||
| # def generate_multirobot_inspection_pddl( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to either delete this chunk of commented code, or uncomment it and document what it's for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted
| normalize_symbols(symbols) | ||
|
|
||
| symbols_of_interest = symbols | ||
| # print("robot_states: ", robot_states) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's either uncomment or delete these prints / logger messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted
|
|
||
| @overload | ||
| @dispatch | ||
| def compile_plan(adaptor, plan_frame: str, plan: PddlPlan): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure we don't need any of the compile_plan implementations here. Did you need to add these or were they leftover from copying the original file? As far as I know, we can remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted!
|
|
||
|
|
||
| def full_planning_pipeline(plan_request: PlanRequest, map_context: Any, feedback=None): | ||
| import dsg_pddl.dsg_pddl_grounding_Multirobot_Better # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to get by without these now, at least when running in ROS. Could you check if you can still generate the plan in ROS without these two lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[python-1] File "/home/jaeyoun-choi/colcon_ws/build/omniplanner/src/omniplanner/omniplanner.py", line 270, in full_planning_pipeline
[python-1] grounded_problem = ground_problem(
[python-1] ^^^^^^^^^^^^^^^
[python-1] File "/usr/local/lib/python3.12/dist-packages/plum/function.py", line 383, in __call__
[python-1] return _convert(method(*args, **kw_args), return_type)
[python-1] ^^^^^^^^^^^^^^^^^^^^^^^^
[python-1] File "/home/jaeyoun-choi/colcon_ws/build/omniplanner/src/dsg_pddl/dsg_pddl_grounding.py", line 516, in ground_problem
[python-1] raise NotImplementedError(
[python-1] NotImplementedError: I don't know how to ground a domain of type region-object-rearrangement-domain-multirobot-fd!
[python-1] The following exception was never retrieved: cannot use Destroyable because destruction was requested
[ERROR] [python-1]: process has died [pid 1566420, exit code 1, cmd '/home/jaeyoun-choi/environments/dcist/spark_env/bin/python /home/jaeyoun-choi/colcon_ws/install/omniplanner_ros/lib/omniplanner_ros/omniplanner_node --ros-args -r __node:=omniplanner_node -r __ns:=/hilbert --params-file /tmp/launch_params_tgi5owmo --params-file /tmp/launch_params_1bza027h -r ~/node_status:=ros_system_monitor/node_diagnostic_collector -r ~/dsg_in:=hydra/backend/dsg -r ~/llm_response:=rviz2_node/llm_response'].
Above error happens without above import lines. I moved those lines to the top of the code, but it isn't work with other error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I'll take a look at that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get a chance to actually run this on my side today, but could you try moving these two import lines to multirobot_ros.py ? I think that should lead to the right imports, although I didn't have time to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little bit of cleanup left, see the comments. There's also a small bug I found. This line that does some postprocessing to generate the geometric path for the robot to follow after a PDDL plan is found doesn't work properly in the multirobot case (https://github.com/MIT-SPARK/Omniplanner/blob/main/omniplanner/src/dsg_pddl/dsg_pddl_planning.py#L88). Applying the following patch fixes it for testing, although it would break single-robot planning.
diff --git a/omniplanner/src/dsg_pddl/dsg_pddl_planning.py b/omniplanner/src/dsg_pddl/dsg_pddl_planning.py
index fdc8a66..3760a9b 100644
--- a/omniplanner/src/dsg_pddl/dsg_pddl_planning.py
+++ b/omniplanner/src/dsg_pddl/dsg_pddl_planning.py
@@ -87,8 +87,8 @@ def make_plan(grounded_problem: GroundedPddlProblem, map_context: Any) -> PddlPl
match p[0]:
case "goto-poi":
path = layer_planner.get_external_path(
- grounded_problem.symbols[p[1]].position,
grounded_problem.symbols[p[2]].position,
+ grounded_problem.symbols[p[3]].position,
)
parameterized_plan.append(path)
last_pose = path[-1]
I haven't had a chance to think through a solution, although it would most likely require either adding some information to the GroundedPddlProblem that we get as input so that we can decide to process as a single or multi robot plan, or maybe we don't build this "parameterized plan" here at all and instead we do it during compile_plan where we are already reasoning about the single- and multi- robot versions of these actions.
| return pt | ||
|
|
||
|
|
||
| # @overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of this commented code. (Also I think we don't need ensure_3d here anymore either.
|
|
||
|
|
||
| def full_planning_pipeline(plan_request: PlanRequest, map_context: Any, feedback=None): | ||
| import dsg_pddl.dsg_pddl_grounding_Multirobot_Better # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get a chance to actually run this on my side today, but could you try moving these two import lines to multirobot_ros.py ? I think that should lead to the right imports, although I didn't have time to double check.
|
I think I fixed the single-robot vs. multi-robot indexing. I also deleted the commented out code. So could you
And then I think we can merge |
|
Ok I think I fixed the imports, seems to work with the new location. |
|
Thanks for your feedback! I changed the import location and it works! Also changing file name to 'dsg_pddl_grounding_multirobot.py' is great. I changed the file name and pushed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Restore unnecessary modification Changing folder Name chore: ignore local scenegraph JSON data Modify multi-robot pddl domain so that visited- predicates doesn't need to be defined with specific robots. Define MultiRobotPddlDomain for ground_problem for multi-robot. Now,omniplanner.py is also restored to the original version except the import dsg_pddl.dsg_pddl_planning formatted Add MultiRobotPddlDomain to pddl_grounding.py, Remove unnecessary functions and case for goto-object-domain in dsg_pddl_grounding_Multirobot_Better.py, Fix format using pre-commit implement compile_plan for multirobot planning ROS for multirobotplan jaeyoun local Changing ROS for Multi-robot planner Cleanup by following Aaron's feedback I think that planning should work for single-robot and multi-robot domains Multi-robot domains currently must have a name that contains the string Fix import location Change name to dsg_pddl_grounding_multirobot.py Change name to dsg_pddl_grounding_multirobot at multirobot_ros.py Remove unused code Modify generate_place_containment.py for place-in-region issue Modify generate_place_containment.py for place-in-region issue Debugging for multi-robot action
1188e38 to
75b4d2d
Compare
@JY-HIM4U I updated your branch to be up-to-date with a more recent version of Omniplanner. I tried to run
pddl_example_multirobot_FD_ominiplanner.pylocally but it failed trying to import'MultiRobotPddlDomain' from 'dsg_pddl.pddl_grounding'. I don't see MultiRobotPddlDomain in pddl_grounding.py, but maybe I'm missing something?