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

Added ability to import objects with webots wbt type. Refactored the … #539

Merged
merged 26 commits into from
Jan 10, 2023

Conversation

TBreeze98
Copy link
Contributor

…superviser file to allow for this feature addition. Signed-off-by: TBreeze98

Description
Feature added: Added ability to import objects through the supervisor node at runtime.

Affected Packages
List of affected packages:

  • webots_ros2_driver
  • webots_ros2_msgs

Copy link
Contributor

@ygoumaz ygoumaz left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I am wondering if there is a use case for this new feature. What are MDT files, I never heard of them?

@omichel omichel requested a review from ygoumaz December 5, 2022 08:23
@TBreeze98 TBreeze98 changed the title Added ability to import objects with webots mdt type. Refactored the … Added ability to import objects with webots wbt type. Refactored the … Dec 5, 2022
@ygoumaz
Copy link
Contributor

ygoumaz commented Dec 6, 2022

Before reviewing this PR, I would need more details about the usefulness of this new feature.

Indeed, it allows to add a way to spawn objects from VRML strings. However, this is very limited because it will only be possible to import objects at the root level and not at the field level as the import_mf_node function normally allows.

The existing alternative today would be to create its own supervisor node which would import the node from the string. Even if this requires a little more knowledge and steps to the users, it is a solution that does the same thing, or even more.

Could you clarify why adding the import via a service is particularly useful? Do you have a particular use case?

@TBreeze98
Copy link
Contributor Author

@ygoumaz No problem. This has lots of use cases available for people needing to spawn in objects at runtime for visual references, such as waypoints or to trace a path out that a robot has taken, or to create objects to use as obstacles when decided by the operator. The way i am using it is to create visual waypoints for a rover navigating around a world to help with debugging and visualising. So as the rover reaches one waypoint, another is calculated to move to and an object is spawned in for visualisation via the service. Please let me know if you need more explanation on the usefulness.

Copy link
Contributor

@ygoumaz ygoumaz left a comment

Choose a reason for hiding this comment

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

I have a few suggestions on the code. I have probably missed some renamings.

@TBreeze98
Copy link
Contributor Author

@ygoumaz Thanks for the suggestions, ive applied them all. Regarding the "added field type check" commit, Im not sure when the crash was introduced, possibly during the merges made by omichael, but it was causing crashes during the node removal on line 148 of ros2_supervisor.py

ygoumaz
ygoumaz previously requested changes Dec 8, 2022
Copy link
Contributor

@ygoumaz ygoumaz left a comment

Choose a reason for hiding this comment

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

A few more remarks after my tests.

@ygoumaz
Copy link
Contributor

ygoumaz commented Dec 13, 2022

I merged latest changes of the master branch, including the correction of the bug in field.py. You can safely remove your modifications from this file.

Also tests failure of rolling/testing are not related to your PR.

@TBreeze98
Copy link
Contributor Author

Resolved all of your suggestions now. Please let me know if theres anything else @ygoumaz

@TBreeze98 TBreeze98 requested a review from ygoumaz January 3, 2023 15:48
@omichel
Copy link
Member

omichel commented Jan 9, 2023

@ygoumaz will be off for a few weeks, so I am following-up on this one. It looks all good to me. I only have a few suggestions to improve the python code.

@TBreeze98 TBreeze98 requested review from omichel and removed request for ygoumaz January 10, 2023 12:28
@TBreeze98
Copy link
Contributor Author

@omichel Those changes all seem good, I have commited them all now.

Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

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

Great. Thank you.

@omichel omichel merged commit 7c978b8 into cyberbotics:master Jan 10, 2023
ad-daniel added a commit that referenced this pull request Feb 3, 2023
@TBreeze98
Copy link
Contributor Author

Hi @ad-daniel @omichel ,
Can I ask why this feature got reverted?

@ad-daniel
Copy link
Contributor

I don't believe it was reverted, I reverted the commits in a test branch for debugging purposes but the changes should still be there in the main branch. I think it's a new feature of github, unless you have encountered any issue with this

@TBreeze98
Copy link
Contributor Author

Ahh yeah, i see thats in a test branch now. I was encountering issues with the supervisor and saw that revert comment and thought it could be that. Found and fixed the issue now though. Thanks for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants