Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tier4_adapi_rviz_plugin): add adapi rviz plugin #3380

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions common/tier4_adapi_rviz_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.14)
project(tier4_adapi_rviz_plugin)

find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(Qt5 REQUIRED Core Widgets)
set(QT_LIBRARIES Qt5::Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DQT_NO_KEYWORDS)

ament_auto_add_library(${PROJECT_NAME} SHARED
src/route_tool.cpp
)

target_link_libraries(${PROJECT_NAME}
${QT_LIBRARIES}
)

pluginlib_export_plugin_description_file(rviz_common plugins/plugin_description.xml)

ament_auto_package(INSTALL_TO_SHARE icons)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions common/tier4_adapi_rviz_plugin/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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>tier4_adapi_rviz_plugin</name>
<version>0.0.0</version>
<description>The autoware adapi rviz plugin package</description>
<maintainer email="isamu.takagi@tier4.jp">Takagi, Isamu</maintainer>
<maintainer email="hiroki.ota@tier4.jp">Hiroki OTA</maintainer>
<maintainer email="kosuke.takeuchi@tier4.jp">Kosuke Takeuchi</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<build_depend>autoware_cmake</build_depend>

<depend>libqt5-core</depend>
<depend>libqt5-gui</depend>
<depend>libqt5-widgets</depend>
<depend>rclcpp</depend>
<depend>rviz_common</depend>
<depend>rviz_default_plugins</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 common/tier4_adapi_rviz_plugin/plugins/plugin_description.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<library path="tier4_adapi_rviz_plugin">

<class type="tier4_adapi_rviz_plugins::RouteTool" base_class_type="rviz_common::Tool">
<description>RouteTool</description>
</class>

</library>
36 changes: 36 additions & 0 deletions common/tier4_adapi_rviz_plugin/src/route_tool.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Copyright 2020 TIER IV, Inc. All rights reserved.
kosuke55 marked this conversation as resolved.
Show resolved Hide resolved
//
// 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 "route_tool.hpp"

namespace tier4_adapi_rviz_plugins
{

RouteTool::RouteTool()
{
shortcut_key_ = 'r';
}

void RouteTool::onInitialize()
{
GoalTool::onInitialize();
setName("Rough Goal");
kosuke55 marked this conversation as resolved.
Show resolved Hide resolved
}

} // namespace tier4_adapi_rviz_plugins

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(tier4_adapi_rviz_plugins::RouteTool, rviz_common::Tool)
36 changes: 36 additions & 0 deletions common/tier4_adapi_rviz_plugin/src/route_tool.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Copyright 2020 TIER IV, Inc. All rights reserved.
kosuke55 marked this conversation as resolved.
Show resolved Hide resolved
//
// 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 ROUTE_TOOL_HPP_
#define ROUTE_TOOL_HPP_

#include <rviz_default_plugins/tools/goal_pose/goal_tool.hpp>

namespace tier4_adapi_rviz_plugins
{

class RouteTool : public rviz_default_plugins::tools::GoalTool
{
Q_OBJECT

public:
RouteTool();
void onInitialize() override;
};

} // namespace tier4_adapi_rviz_plugins

#endif // ROUTE_TOOL_HPP_