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

Finalize the implementation of base pose feature #96

Conversation

diegoferigo
Copy link
Collaborator

@diegoferigo diegoferigo commented Nov 5, 2019

This PR finalizes the support of specifying and setting the base pose of models that are inserted during runtime. There are few different cases to consider.

Models specified in the SDF can be:

  • Fixed base, by fixing the base to the world with a fixed joint (documentation)
  • Floating base

If a fixed-base model is inserted during runtime in Ignition Gazebo, its pose cannot be changed [1] without dirty workarounds (e.g. removing in the ECM the world to base joint and, in the following physics step, change the pose). To keep things simple, I propose we support only:

  1. Inserting a fixed-base model and do not allow changing its pose.
  2. Inserting a floating-base model. Users can change the base pose as they wish.
  3. Transforming a floating-base robot to a fixed base robot. Due to 1) this operation cannot be undone unless removing and inserting again the model in the world.

Closes #80


[1] If I recall, the reason of this behaviour is that DART creates a weld joint between world and base. The resulting model chain is not considered a FreeGroup and therefore changing its pose using the WorldPoseCmd component would not work.

@diegoferigo
Copy link
Collaborator Author

Note that all what concern setting the base velocity is not yet implemented. We might need this feature soon, I will finalize it in another PR.

CMakeLists.txt Outdated
set(GYMPP_BUILD_SHARED_LIBRARY TRUE BOOL
CACHE BOOL "Compile libraries as shared libraries")
set(GYMPP_BUILD_SHARED_LIBRARY TRUE
CACHE BOOL "Compile libraries as shared libraries" FORCE)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the point of having a user-facing option if you always force it to a value?

Copy link
Collaborator Author

@diegoferigo diegoferigo Nov 5, 2019

Choose a reason for hiding this comment

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

Mmh the FORCE option should not be there, good catch. I remember why I used it in the other conditional branch, and using it also here as you said is not useful. I think I should come up with a better logic that sets static compilation in PyPI build mode without overriding the cache value. This could be useful to switch back to e.g. Release and not losing the preferred build type.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I should come up with a better logic that sets static compilation in PyPI build mode without overriding the cache value. This could be useful to switch back to e.g. Release and not losing the preferred build type.

In the case of the CMAKE_BUILD_TYPE equal to PyPI , you could just set directly BUILD_SHARED_LIBS ignoring GYMPP_BUILD_SHARED_LIBRARY . Note that this could create problems if gym-ignition is included in a CMake project that defines BUILD_SHARED_LIBS as an option, but I think that this workflow combine with CMAKE_BUILD_TYPE equal to PyPI is not a configuration that it make sense to support.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that this workflow combine with CMAKE_BUILD_TYPE equal to PyPI is not a configuration that it make sense to support.

In general, users should not even know that the PyPI build type exists. It is there only to simplify the CD pipeline.

Copy link
Contributor

@traversaro traversaro left a comment

Choose a reason for hiding this comment

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

Ok, modulo the CMake comment.

@diegoferigo diegoferigo force-pushed the feature/insert-model-fixed-pose branch from f9305db to a6a3432 Compare November 7, 2019 11:06
@diegoferigo diegoferigo merged commit 24ffb84 into robotology-legacy:devel Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants