Skip to content

Commit

Permalink
2 ➡️ 3 (part 2) (#300)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Aug 22, 2020
2 parents db6a467 + d722939 commit 4b11a02
Show file tree
Hide file tree
Showing 22 changed files with 830 additions and 42 deletions.
6 changes: 0 additions & 6 deletions .github/ci-bionic/after_make.sh

This file was deleted.

8 changes: 8 additions & 0 deletions .github/ci-focal/before_cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -l

set -x

# Needed on Focal to get dart6-data for tests
apt -y install software-properties-common
apt-add-repository ppa:dartsim/ppa
apt -y install dart6-data
15 changes: 15 additions & 0 deletions .github/ci/after_make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -l

set -x

# Install (needed for some tests)
make install

# For ign-tools
export IGN_CONFIG_PATH=/usr/local/share/ignition

# For rendering / window tests
Xvfb :1 -screen 0 1280x1024x24 &
export DISPLAY=:1.0
export RENDER_ENGINE_VALUES=ogre2
export MESA_GL_VERSION_OVERRIDE=3.3
4 changes: 4 additions & 0 deletions .github/ci/packages-bionic.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dart6-data
libdart6-collision-ode-dev
libdart6-dev
libdart6-utils-urdf-dev
5 changes: 5 additions & 0 deletions .github/ci/packages-focal.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
libdart-collision-ode-dev
libdart-dev
libdart-external-ikfast-dev
libdart-external-odelcpsolver-dev
libdart-utils-urdf-dev
15 changes: 15 additions & 0 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
libignition-cmake2-dev
libignition-common3-dev
libignition-fuel-tools4-dev
libignition-gui3-dev
libignition-math6-eigen3-dev
libignition-msgs5-dev
libignition-physics2-dev
libignition-plugin-dev
libignition-rendering3-dev
libignition-sensors3-dev
libignition-tools-dev
libignition-transport8-dev
libsdformat9-dev
qml-module-qtqml-models2
xvfb
17 changes: 0 additions & 17 deletions .github/workflows/ci-bionic.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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 }}
# TODO(anyone) Enable Focal CI and fix failing tests
# 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
51 changes: 41 additions & 10 deletions src/ServerPrivate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,25 +387,56 @@ void ServerPrivate::SetupTransport()
{
// Advertise available worlds.
std::string worldsService{"/gazebo/worlds"};
this->node.Advertise(worldsService, &ServerPrivate::WorldsService, this);

ignmsg << "Serving world names on [" << worldsService << "]" << std::endl;
if (this->node.Advertise(worldsService, &ServerPrivate::WorldsService, this))
{
ignmsg << "Serving world names on [" << worldsService << "]" << std::endl;
}
else
{
ignerr << "Something went wrong, failed to advertise [" << worldsService
<< "]" << std::endl;
}

// Resource path management
std::string addPathService{"/gazebo/resource_paths/add"};
this->node.Advertise(addPathService,
&ServerPrivate::AddResourcePathsService, this);
if (this->node.Advertise(addPathService,
&ServerPrivate::AddResourcePathsService, this))
{
ignmsg << "Resource path add service on [" << addPathService << "]."
<< std::endl;
}
else
{
ignerr << "Something went wrong, failed to advertise [" << addPathService
<< "]" << std::endl;
}

std::string getPathService{"/gazebo/resource_paths/get"};
this->node.Advertise(getPathService,
&ServerPrivate::ResourcePathsService, this);
if (this->node.Advertise(getPathService,
&ServerPrivate::ResourcePathsService, this))
{
ignmsg << "Resource path get service on [" << addPathService << "]."
<< std::endl;
}
else
{
ignerr << "Something went wrong, failed to advertise [" << getPathService
<< "]" << std::endl;
}

std::string pathTopic{"/gazebo/resource_paths"};
this->pathPub = this->node.Advertise<msgs::StringMsg_V>(pathTopic);

ignmsg << "Resource path interfaces on [" << addPathService
<< "], [" << getPathService << "], and [" << pathTopic << "]."
<< std::endl;
if (this->pathPub)
{
ignmsg << "Resource paths published on [" << pathTopic << "]."
<< std::endl;
}
else
{
ignerr << "Something went wrong, failed to advertise [" << pathTopic
<< "]" << std::endl;
}
}

//////////////////////////////////////////////////
Expand Down
40 changes: 33 additions & 7 deletions src/Server_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,16 @@ TEST_P(ServerFixture, ServerConfigRealPlugin)
// make sure the TestModelSystem was successfully loaded.
transport::Node node;
msgs::StringMsg rep;
bool result;
bool executed = node.Request("/test/service", 5000, rep, result);
bool result{false};
bool executed{false};
int sleep{0};
int maxSleep{30};
while (!executed && sleep < maxSleep)
{
igndbg << "Requesting /test/service" << std::endl;
executed = node.Request("/test/service", 100, rep, result);
sleep++;
}
EXPECT_TRUE(executed);
EXPECT_TRUE(result);
EXPECT_EQ("TestModelSystem", rep.data());
Expand All @@ -211,7 +219,6 @@ TEST_P(ServerFixture, ServerConfigSensorPlugin)
{
// Start server
ServerConfig serverConfig;
serverConfig.SetUpdateRate(10000);
serverConfig.SetSdfFile(std::string(PROJECT_SOURCE_PATH) +
"/test/worlds/air_pressure.sdf");

Expand All @@ -225,21 +232,32 @@ TEST_P(ServerFixture, ServerConfigSensorPlugin)
"sensor", "libTestSensorSystem.so", "ignition::gazebo::TestSensorSystem",
sdf});

igndbg << "Create server" << std::endl;
gazebo::Server server(serverConfig);

// The simulation runner should not be running.
EXPECT_FALSE(*server.Running(0));

// Run the server
igndbg << "Run server" << std::endl;
EXPECT_TRUE(server.Run(false, 0, false));
EXPECT_FALSE(*server.Paused());

// The TestSensorSystem should have created a service. Call the service to
// make sure the TestSensorSystem was successfully loaded.
igndbg << "Request service" << std::endl;
transport::Node node;
msgs::StringMsg rep;
bool result;
bool executed = node.Request("/test/service/sensor", 5000, rep, result);
bool result{false};
bool executed{false};
int sleep{0};
int maxSleep{30};
while (!executed && sleep < maxSleep)
{
igndbg << "Requesting /test/service/sensor" << std::endl;
executed = node.Request("/test/service/sensor", 100, rep, result);
sleep++;
}
EXPECT_TRUE(executed);
EXPECT_TRUE(result);
EXPECT_EQ("TestSensorSystem", rep.data());
Expand Down Expand Up @@ -761,8 +779,16 @@ TEST_P(ServerFixture, GetResourcePaths)

transport::Node node;
msgs::StringMsg_V res;
bool result;
bool executed = node.Request("/gazebo/resource_paths/get", 5000, res, result);
bool result{false};
bool executed{false};
int sleep{0};
int maxSleep{30};
while (!executed && sleep < maxSleep)
{
igndbg << "Requesting /gazebo/resource_paths/get" << std::endl;
executed = node.Request("/gazebo/resource_paths/get", 100, res, result);
sleep++;
}
EXPECT_TRUE(executed);
EXPECT_TRUE(result);
EXPECT_EQ(2, res.data_size());
Expand Down
1 change: 1 addition & 0 deletions src/gui/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ add_subdirectory(align_tool)
add_subdirectory(component_inspector)
add_subdirectory(entity_tree)
add_subdirectory(grid_config)
add_subdirectory(resource_spawner)
add_subdirectory(scene3d)
add_subdirectory(shapes)
add_subdirectory(transform_control)
Expand Down
4 changes: 4 additions & 0 deletions src/gui/plugins/resource_spawner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gz_add_gui_plugin(ResourceSpawner
SOURCES ResourceSpawner.cc
QT_HEADERS ResourceSpawner.hh
)
Binary file added src/gui/plugins/resource_spawner/NoThumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4b11a02

Please sign in to comment.