Skip to content
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

Feature rapid neem creation #216

Open
wants to merge 49 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8d0d50d
Adds the initial conceptual idea, which seems to be working
Leusmann Aug 16, 2024
fce61af
Adds first ProcThor environment
Leusmann Aug 16, 2024
2f113ff
Kind of working demo
Leusmann Aug 20, 2024
e523797
Stop ignoring the Giskard answer when spawning the mesh
Leusmann Aug 20, 2024
93e1cad
Merge branch 'feature/rapid-neem-creation' into HEAD
Leusmann Aug 20, 2024
15666ba
Adds file// to the replaced key words
Leusmann Aug 20, 2024
c144628
Adds the functionallty to create NEEMs of the task executed.
Leusmann Aug 29, 2024
2c9ad5b
Adds first Multivers experiment
Leusmann Aug 29, 2024
6d126f7
Quick fix to store the object pose at this moment and not the object …
Leusmann Aug 29, 2024
d81e87f
Quick and dirty fix for object poses of believed object. Shouldn't be…
Leusmann Aug 29, 2024
e1b7abd
Changes camera starting postion
Leusmann Aug 29, 2024
9c91788
Adds the Micheal function and the second version
Leusmann Sep 16, 2024
3139a6b
Changes from script so function and adds a second version where the e…
Leusmann Sep 16, 2024
38e1910
Adds the download helper functions. Maybe need to check the paths etc
Leusmann Sep 16, 2024
568cd18
Quick fix for equality. Apparently pybullet creates ids in such a way…
Leusmann Sep 17, 2024
8e62e9c
Merge remote-tracking branch 'origin/dev' into feature-rapid-neem-cre…
Leusmann Oct 4, 2024
7d1feb7
small change to refelct the changes in the Enum
Leusmann Oct 18, 2024
3d737ae
Merge remote-tracking branch 'origin/dev' into feature-rapid-neem-cre…
Leusmann Oct 18, 2024
62af001
Move from functions to class
Leusmann Oct 29, 2024
ea85ba6
Changed from functions to class and simplyfies the download
Leusmann Oct 29, 2024
e2b43e1
Delete house_2
Leusmann Oct 29, 2024
5ebd4e6
Adds documentation strings etc
Leusmann Nov 7, 2024
3518551
Removed unnecessary imports and switched to pycramros lib instead of …
Leusmann Nov 7, 2024
37e2c4a
Changes requester to procthor interface and store it at the proper place
Leusmann Nov 7, 2024
71a469f
Refelct the changes from moving 'requester' to 'external_interface/pr…
Leusmann Nov 7, 2024
0a6db3a
Deleted old version of function and some other stuff
Leusmann Nov 8, 2024
23134bd
Adds the first iteration of the procthor interface example
Leusmann Nov 8, 2024
1c9190d
Refactor function name
Leusmann Nov 20, 2024
cd3bf47
Removes unnecessary comments and refactors function name
Leusmann Nov 20, 2024
700b7a3
Removes old iteration, which somehow made it this far
Leusmann Nov 20, 2024
6a056a5
Removes old iteration, which somehow made it this far
Leusmann Nov 20, 2024
39537b9
Renames CEO in to demo
Leusmann Nov 20, 2024
87e3a98
First iteration of the experiment Interface
Leusmann Nov 27, 2024
200eb14
Changes prints to log messages
Leusmann Dec 4, 2024
f095935
First draft of the PyCRAMGym class
Leusmann Dec 4, 2024
bf5a530
Delete unnecessary files again
Leusmann Dec 4, 2024
b26e94c
Adds the tests for the procthor interface
Leusmann Dec 5, 2024
fa38542
Merge branch 'dev' of github.com:cram2/pycram into feature-rapid-neem…
Leusmann Dec 5, 2024
123d14c
Change function name and remove prints
Leusmann Dec 5, 2024
35593c8
Changes print to log
Leusmann Dec 9, 2024
242ae86
Updates the example to properly log instead of print and use the newe…
Leusmann Dec 9, 2024
924f9e1
Adds the example code for testig purposes
Leusmann Dec 9, 2024
bf2c1a4
Moves example code to the proper file and import that one
Leusmann Dec 9, 2024
a7f7113
Merge remote-tracking branch 'origin/dev' into feature-rapid-neem-cre…
Leusmann Dec 10, 2024
e2725ee
Switches from Enum to pyCRAP
Leusmann Dec 10, 2024
cb46fc6
Changes imports to be realtive
Leusmann Dec 11, 2024
3cff20c
Changes from ObjectTypes to PyCRAP and adds some documentation
Leusmann Dec 11, 2024
f518323
Adds gymnasium to the requirements
Leusmann Dec 11, 2024
00105e5
Restes the camera back to its default position
Leusmann Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 0 additions & 154 deletions demos/playingfield/sandcastle.py
Leusmann marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import pycram.orm.base
from pycram.external_interfaces.procthor import ProcThorInterface

# Many Plans in many environments with many robots
# Don't know where to store NEEM so I start with the memory db
engine = sqlalchemy.create_engine("sqlite+pysqlite:///:memory:", echo=False)
session_maker = sqlalchemy.orm.sessionmaker(bind=engine)
session = session_maker()
Expand All @@ -34,7 +32,7 @@

# Get Environments
number_of_known_environment = len(
procThorInterface.get_all_environments_stored_below_folder(procThorInterface.source_folder))
procThorInterface.get_all_environments_stored_below_dictionary(procThorInterface.source_folder))
print("Number of known Environments:{}".format(number_of_known_environment))
print("Number of needed Testenvironments:{}".format(number_of_test_environment))

Expand All @@ -46,7 +44,7 @@ def runWorld():
counter = 0
works = 0
fails = 0
known_environments = procThorInterface.get_all_environments_stored_below_folder(procThorInterface.source_folder)
known_environments = procThorInterface.get_all_environments_stored_below_dictionary(procThorInterface.source_folder)
world = BulletWorld(WorldMode.GUI)
apartment = None
milk_pos = Pose([1, -1.78, 0.55], [1, 0, 0, 0])
Expand Down
15 changes: 8 additions & 7 deletions examples/interface_examples/procthor.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ number_of_test_environment=5
First let us check how many different environments are already known.

```python
number_of_known_environment=len(procThorInterface.get_all_environments_stored_below_folder(procThorInterface.source_folder))
number_of_known_environment = len(
procThorInterface.get_all_environments_stored_below_dictionary(procThorInterface.source_folder))
print("Number of known Environments:{}".format(number_of_known_environment))
print("Number of needed Testenvironments:{}".format(number_of_test_environment))
```
Expand All @@ -63,23 +64,24 @@ if number_of_known_environment < number_of_test_environment:

Now that the preparations are met we can start to run our plan for each robot (even though it is only one) and each
environment we know:

```python
v = 0
works = 0
fails = 0
known_environments = procThorInterface.get_all_environments_stored_below_folder(procThorInterface.source_folder)
world=BulletWorld(WorldMode.GUI)
apartment=None
known_environments = procThorInterface.get_all_environments_stored_below_dictionary(procThorInterface.source_folder)
world = BulletWorld(WorldMode.GUI)
apartment = None
milk_pos = Pose([1, -1.78, 0.55], [1, 0, 0, 0])
milk = Object("milk", ObjectType.MILK, "milk.stl", pose=Pose([1, -1.78, 0.55], [1, 0, 0, 0]),
color=Color(1, 0, 0, 1))
for robot in robots:
robot_obj=Object("pr2", ObjectType.ROBOT, robot, pose=Pose([1, 2, 0]))
robot_obj = Object("pr2", ObjectType.ROBOT, robot, pose=Pose([1, 2, 0]))
for environment in known_environments:
v += 1
print("Trying plan: {} with robot: {} in: {}".format("param_plan", robot, environment["name"]))
try:
apartment = Object(environment["name"], ObjectType.ENVIRONMENT,environment["storage_place"])
apartment = Object(environment["name"], ObjectType.ENVIRONMENT, environment["storage_place"])
generic_plan(world)
works += 1
print("Successfully!\n Overall successful tries: {}".format(works))
Expand Down Expand Up @@ -112,7 +114,6 @@ for robot in robots:
if World.current_world is None:
world.remove_object(robot_obj)


print("Resume:\nOverall successful tries: {}\nOverall failed tries: {}".format(works, fails))
World.current_world.exit()
```
Expand Down
4 changes: 2 additions & 2 deletions src/pycram/external_interfaces/procthor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, base_url="http://procthor.informatik.uni-bremen.de:5000",
self.base_url = base_url
self.source_folder = source_folder
self.stored_environments = []
self.stored_environments.extend(self.get_all_environments_stored_below_folder(self.source_folder))
self.stored_environments.extend(self.get_all_environments_stored_below_dictionary(self.source_folder))

def _download_file(self, base_url: str, full_url: str, folder: str) -> str:
"""
Expand Down Expand Up @@ -97,7 +97,7 @@ def download_all_files_from_URL(self, base_url: str, folder: str) -> None:

# Returns a list of all the urdf files in a given folder structure if non is given uses the base_source_folder
# only look for urdf, but can be easly adapted
def get_all_environments_stored_below_folder(self, source_folder: str) -> list:
def get_all_environments_stored_below_dictionary(self, source_folder: str) -> list:
Leusmann marked this conversation as resolved.
Show resolved Hide resolved
"""
Returns a list of dictionaries that contains the name and the storage_place of all urdf files below a given
folder. Only looks for urdf.
Expand Down
Loading