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 web proto #5283

Merged
merged 148 commits into from
Feb 7, 2023
Merged

Feature web proto #5283

merged 148 commits into from
Feb 7, 2023

Conversation

BenjaminDeleze
Copy link

@BenjaminDeleze BenjaminDeleze commented Sep 30, 2022

The goals of this PR are:

  • make webotsJS able of parsing .proto into .x3d
  • generate the sliders and position of motor and joints
  • display the optional rendering for devices (camera frustum, ...)
  • replace the sphere that is currently use in the documentation viewer to show the position of devices by an axis system.
  • allow the user to modify online the proto by playing with its parameters:
    • support parameters modifications
    • support node parameters modifications (only with other protos)
    • be able to download the new version of the proto
    • support proto regeneration
  • develop windows to:
    • modify the parameters.
    • see the motors/joints/position as in the current documentation
    • integrate the text of the documentation
  • Compute the bounding sphere to find a suitable position for the viewpoint
  • find way of displaying special proto (background, viewpoint, appearances)

Use cases

1. A user needs a new size of SoccerBall.proto

A competition organizer want to develop a soccer competition. It founds the SoccerBall.proto in Webots, however the size is a bit too small to work well with the robots he plans to use as players.

He has four solutions to fix his problem:

  1. Recreate a new proto from scratch.
  2. Edit the .proto in a text editor.
  3. Use the proto wizard.
  4. Use the proto editor of `webots.cloud.

Solution 1 requires some knowledge about how to write proto and this user does not have time to learn them.
Solution 2 is a bit simpler but also require a minimum of knowledge and the interface is not very user-friendly.
Solution 3 is good, but solution 4 is better because the user can see the effect of its modifications in real-time in the viewer of webots.cloud.

For solution 4 to work, it needs:

  • A window to change the radius
    • display radius and an input field.
    • WebotsJS must support radius update.
    • Changing the radius must change the visual result.
  • A download button to download the proto with the modified radius.
  • Have a nice user interface:
    • The proto parameter must be open and well positioned when the user first open the proto
    • The download button shoud be displayed
    • The reset button must be implemented to restore the state of the field radius

Nth-use case. A competitor wants to built its robot for a competition from predefined parts:

A user is participating in a competition of drones (like the https://2022.imavs.org/index.php/competition/nanocopter-ai-challenge/).
The competition organizer has build several proto for different drone bodies, sensors, propellers and so on.
In addition to those necessary parts, the organizer also add some parameters to insert PointLights, SpotLights, Led and PBRAppearance for the users to be able to visually customize their drone.
The user can use webots.cloud/proto to build its proto from the parts provided by the competition organizer.

The user should be able to:

  • Look at the position of all devices, see the frustum of the cameras, ray(s) of distance sensors, ...
  • See all the degrees of freedom (joints with and without motors) and play with them.
  • Modify all the parameters to build its own drone.
  • Have a nice UI especially concerning:
    • Adding or removing SFNode/MFNode
  • The initial viewpoint should be automatically well positioned (based on the bounding sphere?)
  • Download the resulting proto.

The webots.cloud/proto solution is the simplest one for the following reason:

  • The organizer can put all its part on webots.cloud/proto.
  • The user can quickly try to assemble its drone.
  • The user can then download its proto and he needs no knowledge about protos to build a complex drone and be able to participate in the competition.

The proto the user will assemble will be quite complex:

  • It is a derived proto (derived from one of the available drone body)
  • Will use the slot system
  • Has some nested protos (typically the sensors, motors, helix, that will fill the slots)
  • Will have a least the following nodes: bounding object, propeller, motor and some sensors like camera, lidar, radar, distance sensors,...
  • Will maybe have some aesthetic customization: lights and appearances.
  • Have a lot of different parameter including SFNode and MFNode, some regenerating and non-regenerating parameters.

@BenjaminDeleze BenjaminDeleze added the feature Implementation of a major feature label Sep 30, 2022
@BenjaminDeleze BenjaminDeleze added this to the R2023a milestone Sep 30, 2022
@BenjaminDeleze BenjaminDeleze self-assigned this Sep 30, 2022
ad-daniel and others added 5 commits January 30, 2023 14:48
* remove unreferenced

* More
* Progress

* Progress

* Progress

* Minimal functionality

* Fix encoder

* Fix simple updates

* Fix SFNode insertion

* Fix sfnode reset

* Restore regeneration

* Functional derived PROTO

* Restore restrictions

* Potential basetype structure

* Fix IS poses

* Revert "Potential basetype structure"

This reverts commit 7f05090.

* Fix grass

* Derived tests

* Rework parameter links

* Progress

* Reintroduce baseType instance

* Fix regeneration

* Rework how derived nodes are stored and fix issues with change propagation

* Implement DEF-USE

* Fix SFRotation

* Fix some issues with MFNode

* Fix issues with SFNode

* Fix more issues

* Progress in delinking instances

* Progress in delinking instances

* Fix id flagging

* Rework webotsjs notification of node changes

* Rework regeneration

* Rework MFNode insertion/removal

* Fix MF insertion & finalization issues

* Rework Parameter class

* Cleanup

* Fix MF removing too many nodes

* Fix unfinalization of sfnodes

* Cleanup

* Progress on default initializer

* functional proof of concept for default complex fields

* Debug asyncronicity

* Fix node generation in PROTO with special fields

* Fix sfnode reset

* replace default value with tokenizer in all proto models

* Status

* Fix grass

* Debug templating issue

* Fix templating

* Fix tokenizer consumption

* Debug

* Fix derived node parameters not propagating

* Cleanup Node

* Cleanup vrml

* Cleanup Parameters

* Cleanup ProtoManager

* Remove isUse

* Fix mfnode reset

* Cleanup

* Fix MFNode restrictions

* Rename parameter linksg

* improve rewind

* Merge methods

* Cleanup

* Cleanup

* Fix slot issues

* Finalize

* Fix MFFields

* Fix basenode

* Improve

* Minor

* Fix moose

* Fix slots

* Debug

* Fix Tesla

* Progress proto rework

* improve wheel proto

* Cleanup

* Fix texture url update

* Fix texture update

* Fix Tesla PROTO

* Fix

* Fix tesla lights

* Cleanup

* Finalize

* Fix

* Fix

* Fix disappering joints

* Fix joints tab on tesla

* actually commit BO fix

* Fix exporter

* Fix Nao hand slot
@BenjaminDeleze BenjaminDeleze marked this pull request as ready for review February 6, 2023 09:58
@omichel omichel added test suite Start the test suite and removed test suite Start the test suite labels Feb 6, 2023
omichel
omichel previously approved these changes Feb 6, 2023
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.

It looks very good to me.
I believe we can merge it as is.
The next step would be to change the way the LED are managed as discussed.

@BenjaminDeleze
Copy link
Author

I updated the urls

@BenjaminDeleze BenjaminDeleze merged commit 3e85ce4 into develop Feb 7, 2023
@BenjaminDeleze BenjaminDeleze deleted the feature-web-proto branch February 7, 2023 10:12
@BenjaminDeleze BenjaminDeleze restored the feature-web-proto branch February 7, 2023 10:39
@BenjaminDeleze BenjaminDeleze deleted the feature-web-proto branch February 7, 2023 10:39
@BenjaminDeleze BenjaminDeleze restored the feature-web-proto branch February 7, 2023 12:51
@BenjaminDeleze BenjaminDeleze deleted the feature-web-proto branch February 7, 2023 12:52
@BenjaminDeleze BenjaminDeleze restored the feature-web-proto branch February 7, 2023 12:52
@BenjaminDeleze BenjaminDeleze deleted the feature-web-proto branch February 7, 2023 12:53
@BenjaminDeleze BenjaminDeleze restored the feature-web-proto branch February 7, 2023 14:13
@BenjaminDeleze BenjaminDeleze deleted the feature-web-proto branch March 13, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Implementation of a major feature test sources Start the sources test on all platforms test suite Start the test suite
Development

Successfully merging this pull request may close these issues.

4 participants