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

Improve webotsJS #6280

Merged
merged 70 commits into from
Aug 14, 2023
Merged

Improve webotsJS #6280

merged 70 commits into from
Aug 14, 2023

Conversation

BenjaminDeleze
Copy link

@BenjaminDeleze BenjaminDeleze commented Jun 30, 2023

Description

  • Add tracks to the surveyor
    • create new controller
  • Fix errors related with tracks in webotsJS
  • Remove vrmlField and replace the field we want to export to the web (without modification or correction) by w3dField
    • change wrl and webots parsing
    • harmonize .wrl style
    • change exports functions
      • WorldInfo
      • Gyro
      • DistanceSensor
      • TouchSensor
      • TextureCoordinate
      • Color
      • Camera
      • Accelerometer
      • Slot
      • Radar
      • Transform
      • RangeFinder
      • PointSet
      • Capsule
      • Speaker
      • Viewpoint
      • IndexedFaceSet
      • Solid
      • Pose
      • Group
      • Lidar
      • InertialUnit
      • DirectionalLight
      • Compass
      • Normal
      • Propeller
      • Microphone
      • ImageTexture
      • Fog
      • Mesh
      • Track
      • Background
      • LED
      • Material
      • Box
      • PointLight
      • Cylinder
      • GPS
      • Pen
      • Cone
      • SpotLight
      • TextureTransform
      • Receiver
      • Coordinate
      • CadShape
      • TrackWheel
      • PBRAppearance
      • Shape
      • Altimeter
      • PositionSensor
      • Connector
      • HingeJoint
      • Plane
      • Appearance
      • ElevationGrid
      • VacuumGripper
      • Fluid
      • Robot
      • Sphere
      • IndexedLineSet
      • SliderJoint
      • Emitter
      • Hinge2Joint
      • BallJoint
      • LightSensor
      • Display
      • Billboard
      • Charger
      • Recognition
      • Focus
      • ImmersionProperties
      • JointParameters
      • Skin
      • SolidReference
      • BallJointParameters
      • Brake
      • LensFlare
      • Hinge2JointParameters
      • LinearMotor
      • Radio
      • Damping
      • Physics
      • RotationalMotor
      • HingeJointParameters
      • Muscle
      • Lens
      • Zoom
      • ContactProperties
  • Replace .x3d format with .w3d
    • webots side
    • webotsJS side
    • webots.cloud
    • documentation
  • Remove the function to generate meta.json

We decided to replace x3d because the x3d used by webots is so extended that it is not really x3d anymore (see #3615 ) by our own format: w3d. In practice only the name and file extension will change, the content will remain the same.

Concerning the vrmlField, we do not support vrml import/export anymore. Moreover, currently, only the vrmlField are exported to webotsJS. It induces a lot of custom export to get some fields that we need in webotsJS but that are currently not vrmlField.

You cant test it on https://proto.webots.cloud (scene, animation and proto)

@BenjaminDeleze BenjaminDeleze added the feature Implementation of a major feature label Jun 30, 2023
@BenjaminDeleze BenjaminDeleze added this to the R2024a milestone Jun 30, 2023
@BenjaminDeleze BenjaminDeleze self-assigned this Jun 30, 2023
Copy link
Member

@stefaniapedrazzi stefaniapedrazzi left a comment

Choose a reason for hiding this comment

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

I tested and I could find only one issue with the visualization of the TrackWheel and the Track.animatedGeometries:
the initial position of the TrackWheel and Track.animatedGeometries doesn't match the one in Webots at load, but at least for the TrackWheel nodes the position is adjusted after the first simulation step.

Steps to reproduce:

  1. Run track.wbt
  2. Reduce the Track.geometriesCount to 10 (in order to better visualize the position)
  3. Save the simulation at time step != 0
  4. Restart Webots in pause mode and with streaming option
  5. Connect from the streaming viewer -> the orientation of the track wheels and the position/orientation of the animatedGeometries in WebotsJS differs from the one in Webots
  6. Run one simulation step
    -> the TrackWheel geometry jumps to the correct position, but the animated geometries still differ in Webots and WebotsJS

@BenjaminDeleze
Copy link
Author

BenjaminDeleze commented Jul 17, 2023

I tested and I could find only one issue with the visualization of the TrackWheel and the Track.animatedGeometries: the initial position of the TrackWheel and Track.animatedGeometries doesn't match the one in Webots at load, but at least for the TrackWheel nodes the position is adjusted after the first simulation step.

Steps to reproduce:

  1. Run track.wbt
  2. Reduce the Track.geometriesCount to 10 (in order to better visualize the position)
  3. Save the simulation at time step != 0
  4. Restart Webots in pause mode and with streaming option
  5. Connect from the streaming viewer -> the orientation of the track wheels and the position/orientation of the animatedGeometries in WebotsJS differs from the one in Webots
  6. Run one simulation step
    -> the TrackWheel geometry jumps to the correct position, but the animated geometries still differ in Webots and WebotsJS

I fixed it for TrackWheels, it was because the rotation field is an hiddenField so it was not initially exported to w3d so I had to manually do it.

For the animated geometries, I think it is normal and we can let it like that because we send to webotsJS only the following information:

  • The animatedGeometry
  • The geometriesCount

And webotsJS build all the track animated geometries from that.
So it has no idea of where are the animated geometires on Webots side.

omichel
omichel previously approved these changes Jul 20, 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.

Thank you.

@BenjaminDeleze
Copy link
Author

I just changed the X3D to X3d in function name

@BenjaminDeleze BenjaminDeleze requested a review from omichel August 14, 2023 11:41
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.

Thank you.

@BenjaminDeleze BenjaminDeleze removed the request for review from stefaniapedrazzi August 14, 2023 11:52
@BenjaminDeleze BenjaminDeleze merged commit e51fc18 into develop Aug 14, 2023
@BenjaminDeleze BenjaminDeleze deleted the enhancement-surveyor-track branch August 14, 2023 11:52
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.

3 participants