Skip to content

Commit

Permalink
3 ➡️ 4 (#120)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Aug 7, 2020
2 parents 528ba21 + 87db562 commit 42e20ed
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 38 deletions.
10 changes: 10 additions & 0 deletions .github/ci/after_make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -l

set -x

make install

Xvfb :1 -screen 0 1280x1024x24 &
export DISPLAY=:1.0
export RENDER_ENGINE_VALUES=ogre2
export MESA_GL_VERSION_OVERRIDE=3.3
13 changes: 13 additions & 0 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
freeglut3-dev
libfreeimage-dev
libglew-dev
libignition-cmake2-dev
libignition-common3-dev
libignition-math6-dev
libignition-plugin-dev
libogre-1.9-dev
libogre-2.1-dev
libxi-dev
libxmu-dev
uuid-dev
xvfb
17 changes: 0 additions & 17 deletions .github/workflows/ci-bionic.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Ubuntu CI

on: [push]

jobs:
bionic-ci:
runs-on: ubuntu-latest
name: Ubuntu Bionic CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@master
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
focal-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 11 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

### Ignition Rendering 3.X.X

1. Update test configuration to use ogre2
* [Pull request 83](https://github.com/ignitionrobotics/ign-rendering/pull/83)

1. Ogre2 GPU Ray: Cleanup all resources on destruction
* [BitBucket pull request 258](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/258)

Expand Down Expand Up @@ -113,6 +116,12 @@

### Ignition Rendering 2.X.X (20XX-XX-XX)


### Ignition Rendering 2.4.0 (2020-04-17)

1. Fix flaky VisualAt test
* [BitBucket pull request 248](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/248)

1. Port windows fixes
* [BitBucket pull request 253](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/253)

Expand All @@ -122,6 +131,8 @@
1. Backport transparency setting based on diffuse alpha
* [BitBucket pull request 247](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/247)

### Ignition Rendering 2.3.0 (2020-02-19)

1. Add API to check which engines are loaded
* [BitBucket pull request 233](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/233)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Install dependencies:

Clone source code

# This checks out the `default` branch. You can append `-b ign-rendering#` (replace # with a number) to checkout a specific version
# This checks out the `master` branch. You can append `-b ign-rendering#` (replace # with a number) to checkout a specific version
git clone http://github.com/ignitionrobotics/ign-rendering

#### Version 0 (Legacy version for Ubuntu Xenial 16.04 or above)
Expand Down
45 changes: 36 additions & 9 deletions ogre/src/OgreGrid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ void OgreGrid::Create()

this->dataPtr->manualObject->clear();

double extent = (this->cellLength * static_cast<double>(this->cellCount))/2;
double baseExtent = (this->cellLength *
static_cast<double>(this->cellCount - this->cellCount % 2))/2;

this->dataPtr->manualObject->setCastShadows(false);
this->dataPtr->manualObject->estimateVertexCount(
Expand All @@ -91,20 +92,30 @@ void OgreGrid::Create()
for (unsigned int h = 0; h <= this->verticalCellCount; ++h)
{
double hReal = this->heightOffset +
(this->verticalCellCount / 2.0f - static_cast<double>(h))
(this->verticalCellCount / 2 - static_cast<double>(h))
* this->cellLength;

// If there are odd vertical cells, shift cell planes up
if (this->verticalCellCount % 2)
hReal += this->cellLength;

for (unsigned int i = 0; i <= this->cellCount; i++)
{
double inc = extent - (i * this->cellLength);
double extent = baseExtent;

// If there is an odd cell count, extend a row and column along
// the positive x and y axes
if (this->cellCount % 2)
extent += this->cellLength;

Ogre::Vector3 p1(inc, -extent, hReal);
double inc = extent - (i * this->cellLength);
Ogre::Vector3 p1(inc, -baseExtent, hReal);
Ogre::Vector3 p2(inc, extent , hReal);
Ogre::Vector3 p3(-extent, inc, hReal);
Ogre::Vector3 p3(-baseExtent, inc, hReal);
Ogre::Vector3 p4(extent, inc, hReal);

this->dataPtr->manualObject->position(p1);
this->dataPtr->manualObject->position(p2);

this->dataPtr->manualObject->position(p3);
this->dataPtr->manualObject->position(p4);
}
Expand All @@ -116,14 +127,30 @@ void OgreGrid::Create()
{
for (unsigned int y = 0; y <= this->cellCount; ++y)
{
double xReal = extent - x * this->cellLength;
double yReal = extent - y * this->cellLength;
double xReal = baseExtent - x * this->cellLength;
double yReal = baseExtent - y * this->cellLength;

double zTop = (this->verticalCellCount / 2.0f) * this->cellLength;
double zBottom = -zTop;

// If odd vertical cell count, add cell length offset to adjust
// z min and max
if (this->verticalCellCount % 2)
{
zTop += this->cellLength / 2.0f;
zBottom += this->cellLength / 2.0f;
}

// If odd horizontal cell count, shift vertical lines
// towards positive x, y axes
if (this->cellCount % 2)
{
xReal += this->cellLength;
yReal += this->cellLength;
}

this->dataPtr->manualObject->position(xReal, yReal, zBottom);
this->dataPtr->manualObject->position(xReal, yReal, zBottom);
this->dataPtr->manualObject->position(xReal, yReal, zTop);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ namespace ignition
// Documentation inherited.
public: virtual void Destroy() override;

public: Ogre::Camera *OgreCamera() const;

// Documentation inherited.
public: virtual void SetVisibilityMask(uint32_t _mask) override;

Expand Down
6 changes: 6 additions & 0 deletions ogre2/src/Ogre2Camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ void Ogre2Camera::SetFarClipPlane(const double _far)
this->ogreCamera->setFarClipDistance(_far);
}

//////////////////////////////////////////////////
Ogre::Camera *Ogre2Camera::OgreCamera() const
{
return ogreCamera;
}

//////////////////////////////////////////////////
void Ogre2Camera::SetVisibilityMask(uint32_t _mask)
{
Expand Down
1 change: 1 addition & 0 deletions ogre2/src/Ogre2DepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ void Ogre2DepthCamera::CreateDepthTexture()
// {
// material DepthCamera // Use copy instead of original
// input 0 depthTexture
// input 1 colorTexture
// quad_normals camera_far_corners_view_space
// }
// }
Expand Down
44 changes: 36 additions & 8 deletions ogre2/src/Ogre2Grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,31 @@ void Ogre2Grid::Create()
this->dataPtr->grid->Update();

this->dataPtr->grid->SetOperationType(MarkerType::MT_LINE_LIST);
double extent = (this->cellLength * static_cast<double>(this->cellCount))/2;
double baseExtent = (this->cellLength *
static_cast<double>(this->cellCount - this->cellCount % 2))/2;
for (unsigned int h = 0; h <= this->verticalCellCount; ++h)
{
double hReal = this->heightOffset +
(this->verticalCellCount / 2.0f - static_cast<double>(h))
(this->verticalCellCount / 2 - static_cast<double>(h))
* this->cellLength;

// If there are odd vertical cells, shift cell planes up
if (this->verticalCellCount % 2)
hReal += this->cellLength;

for (unsigned int i = 0; i <= this->cellCount; i++)
{
double inc = extent - (i * this->cellLength);
double extent = baseExtent;

// If there is an odd cell count, extend a row and column along
// the positive x and y axes
if (this->cellCount % 2)
extent += this->cellLength;

math::Vector3d p1{inc, -extent, hReal};
double inc = extent - (i * this->cellLength);
math::Vector3d p1{inc, -baseExtent, hReal};
math::Vector3d p2{inc, extent , hReal};
math::Vector3d p3{-extent, inc, hReal};
math::Vector3d p3{-baseExtent, inc, hReal};
math::Vector3d p4{extent, inc, hReal};

this->dataPtr->grid->AddPoint(p1);
Expand All @@ -101,20 +113,36 @@ void Ogre2Grid::Create()
this->dataPtr->grid->AddPoint(p4);
}
}

if (this->verticalCellCount > 0)
{
for (unsigned int x = 0; x <= this->cellCount; ++x)
{
for (unsigned int y = 0; y <= this->cellCount; ++y)
{
double xReal = extent - x * this->cellLength;
double yReal = extent - y * this->cellLength;
double xReal = baseExtent - x * this->cellLength;
double yReal = baseExtent - y * this->cellLength;

double zTop = (this->verticalCellCount / 2.0f) * this->cellLength;
double zBottom = -zTop;

// If odd vertical cell count, add cell length offset to adjust
// z min and max
if (this->verticalCellCount % 2)
{
zTop += this->cellLength / 2.0f;
zBottom += this->cellLength / 2.0f;
}

// If odd horizontal cell count, shift vertical lines
// towards positive x, y axes
if (this->cellCount % 2)
{
xReal += this->cellLength;
yReal += this->cellLength;
}

this->dataPtr->grid->AddPoint(xReal, yReal, zBottom);
this->dataPtr->grid->AddPoint(xReal, yReal, zTop);
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions test/integration/depth_camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void DepthCameraTest::DepthCameraBoxes(

// Verify Depth
{
// box not detected so all should return max val
// all points should have the same depth value
EXPECT_FLOAT_EQ(expectedRange, scan[mid]);
EXPECT_FLOAT_EQ(expectedRange, scan[left]);
EXPECT_FLOAT_EQ(expectedRange, scan[right]);
Expand All @@ -398,7 +398,7 @@ void DepthCameraTest::DepthCameraBoxes(
for (unsigned int j = 0; j < depthCamera->ImageWidth(); ++j)
{
float x = pointCloudData[step + j*pointCloudChannelCount];
EXPECT_FLOAT_EQ(expectedRange, x);
EXPECT_NEAR(expectedRange, x, DOUBLE_TOL);
}
}

Expand Down Expand Up @@ -434,7 +434,11 @@ void DepthCameraTest::DepthCameraBoxes(
ignition::rendering::unloadEngine(engine->Name());
}

#ifdef __APPLE__
TEST_P(DepthCameraTest, DISABLED_DepthCameraBoxes)
#else
TEST_P(DepthCameraTest, DepthCameraBoxes)
#endif
{
DepthCameraBoxes(GetParam());
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define RENDER_ENGINE_VALUES ::testing::ValuesIn(\
ignition::rendering::TestValues())

static const std::vector<const char *> kRenderEngineTestValues{"ogre", "optix"};
static const std::vector<const char *> kRenderEngineTestValues{"ogre2", "optix"};

#include <vector>
#include <ignition/common/Util.hh>
Expand Down

0 comments on commit 42e20ed

Please sign in to comment.