-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/slope_vehic…
…le_model # Conflicts: # simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp # test_runner/scenario_test_runner/launch/scenario_test_runner.launch.py
- Loading branch information
Showing
37 changed files
with
539 additions
and
156 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
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
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
25 changes: 25 additions & 0 deletions
25
rviz_plugins/real_time_factor_control_rviz_plugin/CMakeLists.txt
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.14) | ||
|
||
project(real_time_factor_control_rviz_plugin) | ||
|
||
find_package(ament_cmake_auto REQUIRED) | ||
find_package(Qt5 REQUIRED Core Widgets) | ||
|
||
ament_auto_find_build_dependencies() | ||
|
||
set(QT_LIBRARIES Qt5::Widgets) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
ament_auto_add_library(${PROJECT_NAME} SHARED src/real_time_factor_slider.cpp) | ||
|
||
target_compile_definitions(${PROJECT_NAME} PUBLIC QT_NO_KEYWORDS) | ||
|
||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
|
||
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES}) | ||
|
||
# Export the plugin to be imported by rviz2 | ||
pluginlib_export_plugin_description_file(rviz_common plugins/plugin_description.xml) | ||
|
||
ament_auto_package() |
28 changes: 28 additions & 0 deletions
28
rviz_plugins/real_time_factor_control_rviz_plugin/package.xml
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,28 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>real_time_factor_control_rviz_plugin</name> | ||
<version>0.1.0</version> | ||
<description>Slider controlling real time factor value.</description> | ||
<maintainer email="[email protected]">Paweł Lech</maintainer> | ||
<license>Apache License 2.0</license> | ||
|
||
<author email="[email protected]">Paweł Lech</author> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<buildtool_depend>ament_cmake_auto</buildtool_depend> | ||
|
||
<depend>libqt5-core</depend> | ||
<depend>libqt5-widgets</depend> | ||
<depend>qtbase5-dev</depend> | ||
<depend>rviz_common</depend> | ||
<depend>std_msgs</depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>autoware_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
<rviz plugin="${prefix}/plugins/plugin_description.xml"/> | ||
</export> | ||
</package> |
7 changes: 7 additions & 0 deletions
7
rviz_plugins/real_time_factor_control_rviz_plugin/plugins/plugin_description.xml
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,7 @@ | ||
<library path="real_time_factor_control_rviz_plugin"> | ||
<class name="real_time_factor_control_rviz_plugin/RealTimeFactorSliderPanel" | ||
type="real_time_factor_control_rviz_plugin::RealTimeFactorSliderPanel" | ||
base_class_type="rviz_common::Panel"> | ||
<description> Slider controlling real time factor value. </description> | ||
</class> | ||
</library> |
64 changes: 64 additions & 0 deletions
64
rviz_plugins/real_time_factor_control_rviz_plugin/src/real_time_factor_slider.cpp
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,64 @@ | ||
// | ||
// Copyright 2020 Tier IV, Inc. All rights reserved. | ||
// | ||
// 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 <pluginlib/class_list_macros.hpp> | ||
#include <qt5/QtWidgets/QHBoxLayout> | ||
#include <real_time_factor_slider.hpp> | ||
#include <rviz_common/display_context.hpp> | ||
|
||
namespace real_time_factor_control_rviz_plugin | ||
{ | ||
RealTimeFactorSliderPanel::RealTimeFactorSliderPanel(QWidget * parent) | ||
: rviz_common::Panel(parent), | ||
value_label_(new QLabel("x 1.00")), | ||
slider_(new QSlider(Qt::Horizontal)) | ||
{ | ||
value_label_->setAlignment(Qt::AlignCenter); | ||
|
||
slider_->setMinimum(1); | ||
slider_->setMaximum(200); | ||
slider_->setTickInterval(1); | ||
slider_->setValue(100); | ||
|
||
auto layout = new QHBoxLayout(this); | ||
layout->addWidget(value_label_); | ||
layout->addWidget(slider_); | ||
|
||
setLayout(layout); | ||
} | ||
|
||
auto RealTimeFactorSliderPanel::onChangedRealTimeFactorValue(int percentage) -> void | ||
{ | ||
std_msgs::msg::Float64 real_time_factor; | ||
real_time_factor.data = percentage / 100.0; | ||
real_time_factor_publisher->publish(real_time_factor); | ||
value_label_->setText(QString("x ") + QString::number(real_time_factor.data, 'f', 2)); | ||
} | ||
|
||
auto RealTimeFactorSliderPanel::onInitialize() -> void | ||
{ | ||
real_time_factor_publisher = getDisplayContext() | ||
->getRosNodeAbstraction() | ||
.lock() | ||
->get_raw_node() | ||
->create_publisher<std_msgs::msg::Float64>("/real_time_factor", 1); | ||
|
||
connect(slider_, SIGNAL(valueChanged(int)), SLOT(onChangedRealTimeFactorValue(int))); | ||
} | ||
} // namespace real_time_factor_control_rviz_plugin | ||
|
||
PLUGINLIB_EXPORT_CLASS( | ||
real_time_factor_control_rviz_plugin::RealTimeFactorSliderPanel, rviz_common::Panel) |
Oops, something went wrong.