Skip to content

Commit

Permalink
3 ➡️ 4 (#328)
Browse files Browse the repository at this point in the history
3 ➡️  4
  • Loading branch information
mjcarroll authored May 27, 2021
2 parents fdc3e5a + 85f714a commit 97891ac
Show file tree
Hide file tree
Showing 13 changed files with 581 additions and 5,888 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id: ci
uses: ignition-tooling/action-ignition-ci@bionic
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
codecov-enabled: true
focal-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(ignition-rendering4 VERSION 4.7.0)
# Find ignition-cmake
#============================================================================
# If you get an error at this line, you need to install ignition-cmake
find_package(ignition-cmake2 REQUIRED)
find_package(ignition-cmake2 2.8.0 REQUIRED)

#============================================================================
# Set up the project
Expand Down
24 changes: 24 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,31 @@

### Ignition Rendering 3.X.X (2021-XX-XX)

### Ignition Rendering 3.5.0 (2021-05-25)

1. Include MoveTo Helper class to ign-rendering
* [Pull request 311](https://github.com/ignitionrobotics/ign-rendering/pull/311)

1. Remove tools/code_check and update codecov
* [Pull request 321](https://github.com/ignitionrobotics/ign-rendering/pull/321)

1. Helper function to get a scene (#320)
* [Pull request 320](https://github.com/ignitionrobotics/ign-rendering/pull/320)

1. Fix DepthGaussianNoise test (#271)
* [Pull request 271](https://github.com/ignitionrobotics/ign-rendering/pull/271)

1. Master branch updates (#268)
* [Pull request 268](https://github.com/ignitionrobotics/ign-rendering/pull/268)

1. 👩🌾 Make GitHub actions tests that are flaky due to display more verbose information (#255)
* [Pull request 255](https://github.com/ignitionrobotics/ign-rendering/pull/255)

1. Fixed OBJ textures with the same name (#239)
* [Pull request 239](https://github.com/ignitionrobotics/ign-rendering/pull/239)

1. More verbose messages when failing to load render engine (#236)
* [Pull request 236](https://github.com/ignitionrobotics/ign-rendering/pull/236)

### Ignition Rendering 3.4.0 (2021-02-09)

Expand Down
99 changes: 99 additions & 0 deletions include/ignition/rendering/MoveToHelper.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_MOVETOHELPER_HH_
#define IGNITION_RENDERING_MOVETOHELPER_HH_

#include <memory>

#include <ignition/common/Animation.hh>
#include <ignition/common/KeyFrame.hh>

#include <ignition/math/Box.hh>
#include <ignition/math/Pose3.hh>

#include "ignition/rendering/Camera.hh"

namespace ignition
{
namespace rendering
{
// Inline bracket to help doxygen filtering.
inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
// forward declaration
class MoveToHelperPrivate;

/// \brief Helper class for animating a user camera to move to a target
/// entity
class IGNITION_RENDERING_VISIBLE MoveToHelper
{
public: MoveToHelper();

public: ~MoveToHelper();

/// \brief Move the camera to look at the specified target
/// param[in] _camera Camera to be moved
/// param[in] _target Target to look at
/// param[in] _duration Duration of the move to animation, in seconds.
/// param[in] _onAnimationComplete Callback function when animation is
/// complete
public: void MoveTo(const rendering::CameraPtr &_camera,
const rendering::NodePtr &_target, double _duration,
std::function<void()> _onAnimationComplete);

/// \brief Move the camera to the specified pose.
/// param[in] _camera Camera to be moved
/// param[in] _target Pose to move to
/// param[in] _duration Duration of the move to animation, in seconds.
/// param[in] _onAnimationComplete Callback function when animation is
/// complete
public: void MoveTo(const rendering::CameraPtr &_camera,
const math::Pose3d &_target, double _duration,
std::function<void()> _onAnimationComplete);

/// \brief Move the camera to look at the specified target
/// param[in] _camera Camera to be moved
/// param[in] _direction The pose to assume relative to the
/// entit(y/ies), (0, 0, 0) indicates to return the camera back to the
/// home pose originally loaded in from the sdf.
/// param[in] _duration Duration of the move to animation, in seconds.
/// param[in] _onAnimationComplete Callback function when animation is
/// complete
public: void LookDirection(const rendering::CameraPtr &_camera,
const math::Vector3d &_direction, const math::Vector3d &_lookAt,
double _duration, std::function<void()> _onAnimationComplete);

/// \brief Add time to the animation.
/// \param[in] _time Time to add in seconds
public: void AddTime(double _time);

/// \brief Get whether the move to helper is idle, i.e. no animation
/// is being executed.
/// \return True if idle, false otherwise
public: bool Idle() const;

/// \brief Set the initial camera pose
/// param[in] _pose The init pose of the camera
public: void SetInitCameraPose(const math::Pose3d &_pose);

IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
private: std::unique_ptr<MoveToHelperPrivate> dataPtr;
IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
};
}
}
}
#endif
12 changes: 12 additions & 0 deletions include/ignition/rendering/RenderingIface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "ignition/rendering/config.hh"
#include "ignition/rendering/Export.hh"
#include "ignition/rendering/RenderTypes.hh"

namespace ignition
{
Expand Down Expand Up @@ -131,6 +132,17 @@ namespace ignition
/// \param[in] _paths The list of the plugin paths
IGNITION_RENDERING_VISIBLE
void setPluginPaths(const std::list<std::string> &_paths);

/// \brief Most applications will only have one rendering engine loaded
/// at a time, and only one scene within that. This helper function gets
/// the first scene that can be found in the first loaded rendering engine.
///
/// It's not recommended to call this function when there's more than one
/// engine or scene.
///
/// \return Pointer to a scene that was found, null if no scene is loaded.
IGNITION_RENDERING_VISIBLE
ScenePtr sceneFromFirstRenderEngine();
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions ogre/src/OgreRenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,6 @@ std::string OgreRenderEngine::CreateRenderWindow(const std::string &_handle,
// Hide window if dimensions are less than or equal to one.
params["border"] = "none";

std::ostringstream stream;
stream << "OgreWindow(0)" << "_" << _handle;

// Needed for retina displays
params["contentScalingFactor"] = std::to_string(_ratio);

Expand All @@ -664,9 +661,12 @@ std::string OgreRenderEngine::CreateRenderWindow(const std::string &_handle,
params["currentGLContext"] = "true";
}

std::ostringstream stream;
int attempts = 0;
while (window == nullptr && (attempts++) < 10)
while (window == nullptr && attempts < 10)
{
stream.str("");
stream << "OgreWindow(" << attempts << ")" << "_" << _handle;
try
{
window = this->ogreRoot->createRenderWindow(
Expand All @@ -678,6 +678,7 @@ std::string OgreRenderEngine::CreateRenderWindow(const std::string &_handle,
<< "]. Exception [" << _e.what() << "]" << std::endl;
window = nullptr;
}
attempts++;
}

if (attempts >= 10)
Expand Down
Loading

0 comments on commit 97891ac

Please sign in to comment.