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

Ft easy adding walls issue: #77 #78

Merged
merged 12 commits into from
Apr 26, 2022

Conversation

GijsGroote
Copy link
Collaborator

@GijsGroote GijsGroote commented Apr 13, 2022

I changed my mind about createMultiBody vs. adding urdf files

It comes in handy to change the dimensions of the object to add. This is doable with createMultiBody because it
only can add 'simple' shapes to the environment. Eventually adding obstacles/shapes/walls in both ways is preferred. Because:
createMultiBody makes simple shapes, but the dimensions can easily be changed. good for adding walls
adding urdf files makes more complex obstacles. good for more interesting obstacles

The documentation will be updated

@GijsGroote
Copy link
Collaborator Author

For documentation on how to use functions such as add_walls or add_shapes or any other I would like a more automated approach. Such as the API section of the documentation is generated.

Issue #79 has been created for this.

@maxspahn maxspahn changed the base branch from master to develop April 19, 2022 09:06
@maxspahn
Copy link
Owner

I am looking at it. Can you allow changes by other maintainers?
I think it is easier if I directly make some changes rather than asking you to do it.

Copy link
Owner

@maxspahn maxspahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your enthousiasm.
Why didn't you use the add_obstacle function that was already there?
Than if-clauses can be done entirely in MotionPlanningEnv?
I think that this would be neater.

@@ -108,11 +107,39 @@ def check_box(
return msg_ext


def check_shape_dim(dim: np.ndarray, shape_type: str, dim_len: int, default: np.ndarray) -> np.ndarray:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_shape_dim suggests that it returns a boolean, but it actually returns a filtered shape dimension

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been renamed to filter_shape_dim( )

urdfenvs/urdfCommon/urdf_env.py Show resolved Hide resolved
@GijsGroote
Copy link
Collaborator Author

GijsGroote commented Apr 19, 2022

Why didn't you use the add_obstacle function that was already there?
Add obstacle does require that the obstacle if of class: CollisionObstacle
for which I currently do not see the additional advantages.

Additionally:

obst1Dict = {
"dim": 3,
"type": "sphere",
"geometry": {"position": [2.0, 2.0, 1.0], "radius": 1.0},
}
sphereObst1 = SphereObstacle(name="simpleSphere", contentDict=obst1Dict)

env.add_obstacle(sphereObst1)

is a lot more code then:
env.add_shapes(shape_type="GEOM_SPHERE", dim=[1.0], mass=5, poses_2d=[[2.0, 2.0, 1.0]])

Than if-clauses can be done entirely in MotionPlanningEnv?
The real reason is I do not know motionPlanningEnv and what it would provide. Having all objects in one place is better than 2 different places, so we can look at creating every obstacle in the MotionPlanningEnv and having only a add_obstacle function in the gym_urdf_envs repo.

@maxspahn
Copy link
Owner

Additionally: (...) is a lot more code then: (...)

I agree with keeping it like this for the moment.
I will try to integrate it later into MotionPlanningEnv.

@maxspahn
Copy link
Owner

I modified a couple of things in the documentation and removed the mutable default arguments in urdf_env.py.
Have a look at it, and then I'll merge it.

Copy link
Collaborator Author

@GijsGroote GijsGroote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that I didn't update the docs everywhere. Nice catch

Copy link
Owner

@maxspahn maxspahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

Could you open the issue regarding moving this into MotionPlanningScenes?

@maxspahn maxspahn merged commit c6f9d36 into maxspahn:develop Apr 26, 2022
@GijsGroote
Copy link
Collaborator Author

#92 has been created for this.

@GijsGroote GijsGroote deleted the ft-easy-adding-walls branch September 21, 2022 12:37
siyuanwu99 pushed a commit to siyuanwu99/gym_envs_urdf that referenced this pull request Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants