-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Louise Poubel <louise@openrobotics.org>
- Loading branch information
Showing
44 changed files
with
2,377 additions
and
818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
name: Bug report | ||
about: Report a bug | ||
labels: bug | ||
--- | ||
|
||
<!-- If you're not sure whether your problem is a bug, please ask a question at | ||
http://answers.gazebosim.org instead.--> | ||
|
||
## Environment | ||
* OS Version: <!-- e.g, Ubuntu 20.04 --> | ||
* Source or binary build? | ||
<!-- If binary, which version? --> | ||
<!-- If source, which branch and what is the latest commit? --> | ||
* If this is a GUI or sensor rendering bug, describe your GPU and rendering system. Otherwise delete this section. <!-- If you do not know some values, leave them out. But please, at least give a try to finding them - they are really helpful when debugging rendering errors. --> | ||
- Rendering plugin: [ogre | ogre2]. <!-- You can find it in the logs of Gazebo it outputs to console when you launch it with `-v 3` or `-v 4` argument. --> | ||
- [ ] Sensor rendering error. <!-- Search for message like "[Msg] Loading plugin [gz-rendering-ogre]" (not starting with "[GUI]"). --> | ||
- [ ] GUI rendering error. <!-- Search for message like "[GUI] [Msg] Loading plugin [gz-rendering-ogre2] --> | ||
- EGL headless mode: | ||
- [ ] Running in EGL headless mode <!-- only available since Fortress, GPU display is specified as /dev/dri/card* instead of :0 --> | ||
- Generally, mention all circumstances that might affect rendering capabilities: <!-- remove lines that do not apply to keep the list short --> | ||
- [ ] running on a dual GPU machine (integrated GPU + discrete GPU) | ||
- [ ] running on a multi-GPU machine (it has multiple discrete GPUs) | ||
- [ ] running on real hardware | ||
- [ ] running in virtual machine | ||
- [ ] running in Docker/Singularity | ||
- [ ] running remotely (e.g. via SSH) | ||
- [ ] running in a cloud | ||
- [ ] using VirtualGL, XVFB, Xdummy, XVNC or other indirect rendering utilities | ||
- [ ] GPU is concurrently used for other tasks | ||
- [ ] desktop acceleration | ||
- [ ] video decoding (i.e. a playing Youtube video) | ||
- [ ] video encoding | ||
- [ ] CUDA/ROCm computations (Tensorflow, Torch, Caffe running) | ||
- [ ] multiple simulators running at the same time | ||
- [ ] other... | ||
- Rendering system info: | ||
- On Linux, provide the outputs of the following commands: | ||
```bash | ||
LANG=C lspci -nn | grep VGA # might require installing pciutils | ||
echo "$DISPLAY" | ||
LANG=C glxinfo -B | grep -i '\(direct rendering\|opengl\|profile\)' # might require installing mesa-utils package | ||
ps aux | grep Xorg | ||
sudo env LANG=C X -version # if you don't have root access, try to tell the version of Xorg e.g. via package manager | ||
``` | ||
- On Windows, run `dxdiag` and report the GPU-related information. | ||
- On Mac OS, open a terminal and type `system_profiler SPDisplaysDataType`. Copy the output here. | ||
<!-- Please note that GUI rendering is not supported on macOS. --> | ||
- [ ] Please, attach the ogre.log or ogre2.log file from `~/.gz/rendering` <!-- Choose the relevant version based on what you checked in the "Rendering plugin" question. --> | ||
|
||
<details> | ||
|
||
``` | ||
# paste log here | ||
``` | ||
</details> | ||
## Description | ||
* Expected behavior: <!-- Tell us what you expected to happen --> | ||
* Actual behavior: <!-- What happened instead --> | ||
## Steps to reproduce | ||
<!-- Provide steps so we can try to reproduce this issue --> | ||
1. | ||
2. | ||
3. | ||
## Output | ||
<!-- Provide screenshots, console logs, backtraces, and/or anything that could | ||
be useful to us resolving this issue --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
name: Feature request | ||
about: Request a new feature | ||
labels: enhancement | ||
--- | ||
|
||
<!-- If you're not sure on the specifics of the feature or would like a broader | ||
discussion, please consider posting a proposal to | ||
http://community.gazebosim.org/ instead.--> | ||
|
||
## Desired behavior | ||
<!-- Describe the current problem and the feature you want implemented.--> | ||
|
||
## Alternatives considered | ||
<!-- Describe alternate solutions or features you've considered.--> | ||
|
||
## Implementation suggestion | ||
<!-- Provide a suggestion on how to implement this feature, which could help us | ||
expedite this implementation.--> | ||
|
||
## Additional context | ||
<!-- Provide any other additional context (e.g., screenshots) about your feature | ||
request.--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) | ||
|
||
project(gz-gui-start-dialog) | ||
|
||
if(POLICY CMP0100) | ||
cmake_policy(SET CMP0100 NEW) | ||
endif() | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
|
||
find_package(gz-gui7 REQUIRED) | ||
set(GZ_GUI_VER ${gz-gui7_VERSION_MAJOR}) | ||
|
||
set(EXEC_NAME "start_dialog") | ||
|
||
QT5_ADD_RESOURCES(resources_RCC ${EXEC_NAME}.qrc) | ||
|
||
add_executable(${EXEC_NAME} | ||
${EXEC_NAME}.cc | ||
${resources_RCC} | ||
) | ||
target_link_libraries(${EXEC_NAME} | ||
gz-gui${GZ_GUI_VER}::gz-gui${GZ_GUI_VER} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Example for how to run a start dialog before the main window. | ||
|
||
## Build | ||
|
||
cd <this directory> | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
|
||
## Run | ||
|
||
cd <this directory>/build | ||
./start_dialog | ||
|
||
First the dialog shows up, and after that's closed, the main window shows up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Copyright (C) 2022 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. | ||
* | ||
*/ | ||
|
||
#include <iostream> | ||
|
||
#include <gz/gui/qt.h> | ||
#include <gz/gui/Application.hh> | ||
#include <gz/gui/Dialog.hh> | ||
#include <gz/gui/MainWindow.hh> | ||
|
||
////////////////////////////////////////////////// | ||
int main(int _argc, char **_argv) | ||
{ | ||
// Increase verboosity so we see all messages | ||
gz::common::Console::SetVerbosity(4); | ||
|
||
// Create app | ||
gz::gui::Application app(_argc, _argv, gz::gui::WindowType::kDialog); | ||
|
||
gzdbg << "Open dialog" << std::endl; | ||
|
||
// Add and display a dialog | ||
auto dialog = new gz::gui::Dialog(); | ||
dialog->QuickWindow(); | ||
|
||
std::string qmlFile(":start_dialog/start_dialog.qml"); | ||
if (!QFile(QString::fromStdString(qmlFile)).exists()) | ||
{ | ||
gzerr << "Can't find [" << qmlFile | ||
<< "]. Are you sure it was added to the .qrc file?" << std::endl; | ||
return -1; | ||
} | ||
|
||
QQmlComponent dialogComponent(gz::gui::App()->Engine(), | ||
QString(QString::fromStdString(qmlFile))); | ||
if (dialogComponent.isError()) | ||
{ | ||
std::stringstream errors; | ||
errors << "Failed to instantiate QML file [" << qmlFile << "]." | ||
<< std::endl; | ||
for (auto error : dialogComponent.errors()) | ||
{ | ||
errors << "* " << error.toString().toStdString() << std::endl; | ||
} | ||
gzerr << errors.str(); | ||
return -1; | ||
} | ||
|
||
auto dialogItem = qobject_cast<QQuickItem *>(dialogComponent.create()); | ||
if (!dialogItem) | ||
{ | ||
gzerr << "Failed to instantiate QML file [" << qmlFile << "]." << std::endl | ||
<< "Are you sure the file is valid QML? " | ||
<< "You can check with the `qmlscene` tool" << std::endl; | ||
return -1; | ||
} | ||
|
||
dialogItem->setParentItem(dialog->RootItem()); | ||
|
||
// Execute start dialog | ||
app.exec(); | ||
|
||
// After dialog is shut, display the main window | ||
gzdbg << "Dialog closed, open main window" << std::endl; | ||
|
||
// Create main window | ||
app.CreateMainWindow(); | ||
|
||
// Run main window | ||
app.exec(); | ||
|
||
gzdbg << "Main window closed" << std::endl; | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (C) 2022 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. | ||
* | ||
*/ | ||
import QtQuick 2.0 | ||
import QtQuick.Controls 2.0 | ||
Rectangle { | ||
color: "green" | ||
anchors.fill: parent | ||
Text { | ||
text: qsTr("Start\ndialog!") | ||
font.pointSize: 30 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!DOCTYPE RCC><RCC version="1.0"> | ||
<qresource prefix="start_dialog/"> | ||
<file>start_dialog.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.