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

user camera FOV control in SDF files #400

Merged
merged 7 commits into from
May 19, 2022
Merged

Conversation

AzulRadio
Copy link
Contributor

@AzulRadio AzulRadio commented May 17, 2022

New feature

Part of gazebosim/gz-sim#421

Summary

Users can now change the FOV of the user camera in SDF as follows:

Test it

<sdf version="1.6">
    ...
    <gui fullscreen="0">

      <!-- 3D scene -->
      <plugin filename="MinimalScene" name="3D View">
        ...
        <fov>60</fov>
      </plugin>
      ...
    </gui>

Please enter the FOV in degree and by default ignition uses a FOV of 90

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label May 17, 2022
@codecov
Copy link

codecov bot commented May 17, 2022

Codecov Report

❗ No coverage uploaded for pull request base (ign-gui6@c51789f). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             ign-gui6     #400   +/-   ##
===========================================
  Coverage            ?   30.54%           
===========================================
  Files               ?       41           
  Lines               ?     1748           
  Branches            ?        0           
===========================================
  Hits                ?      534           
  Misses              ?     1214           
  Partials            ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c51789f...752d120. Read the comment docs.

@AzulRadio AzulRadio changed the title Azulradio/fo vin sdf user camera FOV control in SDF files May 17, 2022
Copy link
Contributor

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

Looks good, need some minor changes.

  • Add the new element to the documentation here:
    /// ## Configuration
    ///
    /// * \<engine\> : Optional render engine name, defaults to 'ogre'. If another
    /// engine is already loaded, that will be used, because only
    /// one engine is supported at a time currently.
    /// * \<scene\> : Optional scene name, defaults to 'scene'. The plugin will
    /// create a scene with this name if there isn't one yet. If
    /// there is already one, a new camera is added to it.
    /// * \<ambient_light\> : Optional color for ambient light, defaults to
    /// (0.3, 0.3, 0.3, 1.0)
    /// * \<background_color\> : Optional background color, defaults to
    /// (0.3, 0.3, 0.3, 1.0)
    /// * \<camera_pose\> : Optional starting pose for the camera, defaults to
    /// (0, 0, 5, 0, 0, 0)
    /// * \<camera_clip\> : Optional near/far clipping distance for camera
    /// * \<near\> : Camera's near clipping plane distance, defaults to 0.01
    /// * \<far\> : Camera's far clipping plane distance, defaults to 1000.0
    /// * \<sky\> : If present, sky is enabled.

In the PR description:

  • Change Closes to Part of as there are other parameters we want to add (Github will close the PR if Closes is present)
  • Update the 'Test it' portion to the correct sdf snippet as we discussed in the VC

src/plugins/minimal_scene/MinimalScene.cc Show resolved Hide resolved
src/plugins/minimal_scene/MinimalScene.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@jennuine jennuine 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, thanks for iterating! One minor fix left and please fix the last 2 commits to include your sign-off so DCO will pass

src/plugins/minimal_scene/MinimalScene.hh Outdated Show resolved Hide resolved
AzulRadio added 5 commits May 18, 2022 08:54
Signed-off-by: youhy <haoyuan2019@outlook.com>
Signed-off-by: youhy <haoyuan2019@outlook.com>
Signed-off-by: youhy <haoyuan2019@outlook.com>
Signed-off-by: youhy <haoyuan2019@outlook.com>
Signed-off-by: youhy <haoyuan2019@outlook.com>
@AzulRadio AzulRadio force-pushed the azulradio/FOVinSDF branch from 7862059 to 8dba3b5 Compare May 18, 2022 15:55
Signed-off-by: youhy <haoyuan2019@outlook.com>
@jennuine
Copy link
Contributor

Signed-off-by: youhy <haoyuan2019@outlook.com>
@AzulRadio AzulRadio merged commit 5c09688 into ign-gui6 May 19, 2022
@AzulRadio AzulRadio deleted the azulradio/FOVinSDF branch May 19, 2022 16:17
@chapulina chapulina added the OOBE 📦✨ Out-of-box experience label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress OOBE 📦✨ Out-of-box experience
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants