-
Notifications
You must be signed in to change notification settings - Fork 676
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(rerouting-static-obstacle): rerouting static obstacle using a selected point by the user #4524
Changes from all commits
ea20186
a432f80
7c29ef2
7acd51d
e531834
a81dbaf
3092be6
4d3fac5
997b056
dc3a6bd
8958519
b0382b1
984a0f4
5f16546
f512dfb
521b75c
c181feb
53a1f3e
e072fa1
84f2607
ab38caa
ec92fc4
69f7c33
aca5be2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,10 @@ project(tier4_planning_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) | ||
find_package(Eigen3 REQUIRED) | ||
|
||
include_directories( | ||
|
@@ -28,6 +26,9 @@ ament_auto_add_library(tier4_planning_rviz_plugin SHARED | |
src/mission_checkpoint/mission_checkpoint.cpp | ||
src/tools/jsk_overlay_utils.cpp | ||
src/tools/max_velocity.cpp | ||
# reroute static obstacle | ||
include/reroute_static_obstacle/reroute_static_obstacle_plugin.hpp | ||
src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp | ||
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A new section for the "reroute static obstacle" feature has been added. Please ensure that the paths to the header and source files are correct. + # reroute static obstacle
+ include/reroute_static_obstacle/reroute_static_obstacle_plugin.hpp
+ src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp |
||
) | ||
|
||
target_link_libraries(tier4_planning_rviz_plugin | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// Copyright 2023 TIER IV, Inc. | ||
// | ||
// 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. | ||
/* | ||
* Software License Agreement (BSD License) | ||
* | ||
* Copyright (c) 2012, Willow Garage, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* * Neither the name of Willow Garage, Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef REROUTE_STATIC_OBSTACLE__REROUTE_STATIC_OBSTACLE_PLUGIN_HPP_ | ||
#define REROUTE_STATIC_OBSTACLE__REROUTE_STATIC_OBSTACLE_PLUGIN_HPP_ | ||
|
||
#include "rclcpp/qos.hpp" | ||
#include "rviz_common/interaction/view_picker_iface.hpp" | ||
#include "rviz_common/load_resource.hpp" | ||
#include "rviz_common/msg_conversions.hpp" | ||
#include "rviz_common/properties/bool_property.hpp" | ||
#include "rviz_common/properties/qos_profile_property.hpp" | ||
#include "rviz_common/properties/string_property.hpp" | ||
#include "rviz_common/render_panel.hpp" | ||
#include "rviz_common/view_controller.hpp" | ||
#include "rviz_common/viewport_mouse_event.hpp" | ||
#include "rviz_default_plugins/tools/point/point_tool.hpp" | ||
|
||
#include <rviz_common/display_context.hpp> | ||
|
||
#include <OgreVector.h> | ||
#include <OgreVector3.h> | ||
|
||
#include <algorithm> | ||
#include <memory> | ||
#include <optional> | ||
#include <sstream> | ||
#include <vector> | ||
|
||
namespace rviz_plugins | ||
{ | ||
|
||
class RerouteStaticObstaclePointPublish : public rviz_default_plugins::tools::PointTool | ||
{ | ||
public: | ||
RerouteStaticObstaclePointPublish(); | ||
void onInitialize() override; | ||
|
||
void activate() override; | ||
void deactivate() override; | ||
|
||
int processMouseEvent(rviz_common::ViewportMouseEvent & event) override; | ||
|
||
public Q_SLOTS: | ||
void updateTopic(); | ||
void updateAutoDeactivate(); | ||
|
||
protected: | ||
void publishPosition(const Ogre::Vector3 & position) const; | ||
void setStatusForPosition(const Ogre::Vector3 & position); | ||
|
||
rclcpp::QoS qos_profile_; | ||
|
||
private: | ||
std::optional<Ogre::Vector3> get_point_from_mouse(rviz_common::ViewportMouseEvent & event); | ||
}; | ||
} // namespace rviz_plugins | ||
#endif // REROUTE_STATIC_OBSTACLE__REROUTE_STATIC_OBSTACLE_PLUGIN_HPP_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
// Copyright 2023 TIER IV, Inc. | ||
// | ||
// 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. | ||
/* | ||
* Copyright (c) 2013, Willow Garage, Inc. | ||
* Copyright (c) 2018, Bosch Software Innovations GmbH. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of the Willow Garage, Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
#include <reroute_static_obstacle/reroute_static_obstacle_plugin.hpp> | ||
#include <rviz_common/render_panel.hpp> | ||
#include <rviz_rendering/render_window.hpp> | ||
|
||
#include <geometry_msgs/msg/point_stamped.hpp> | ||
|
||
#include <OgreCamera.h> | ||
#include <OgreRay.h> | ||
#include <OgreViewport.h> | ||
|
||
namespace rviz_plugins | ||
{ | ||
|
||
RerouteStaticObstaclePointPublish::RerouteStaticObstaclePointPublish() : qos_profile_(5) | ||
Check warning on line 56 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L56
|
||
{ | ||
topic_property_ = new rviz_common::properties::StringProperty( | ||
Check warning on line 58 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L58
|
||
"Topic", "/simulation/planning/reroute_static_obstacle_point_publisher/point", | ||
"The topic on which to publish points.", getPropertyContainer(), SLOT(updateTopic()), this); | ||
Check warning on line 60 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L60
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this plugin can be used on the actual device as well as simulation. If so, it would be better to change the namespace. for exmale, we have topic name whose name space is |
||
|
||
auto_deactivate_property_ = new rviz_common::properties::BoolProperty( | ||
"Single click", true, "Switch away from this tool after one click.", getPropertyContainer(), | ||
SLOT(updateAutoDeactivate()), this); | ||
Check warning on line 64 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L62-L64
|
||
|
||
qos_profile_property_ = | ||
new rviz_common::properties::QosProfileProperty(topic_property_, qos_profile_); | ||
} | ||
Check warning on line 68 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L66-L68
|
||
|
||
void RerouteStaticObstaclePointPublish::onInitialize() | ||
Check warning on line 70 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L70
|
||
{ | ||
qos_profile_property_->initialize([this](rclcpp::QoS profile) { this->qos_profile_ = profile; }); | ||
updateTopic(); | ||
} | ||
Check warning on line 74 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L72-L74
|
||
|
||
void RerouteStaticObstaclePointPublish::activate() | ||
Check warning on line 76 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L76
|
||
{ | ||
} | ||
Check warning on line 78 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L78
|
||
|
||
void RerouteStaticObstaclePointPublish::deactivate() | ||
Check warning on line 80 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L80
|
||
{ | ||
} | ||
Check warning on line 82 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L82
|
||
|
||
void RerouteStaticObstaclePointPublish::updateTopic() | ||
Check warning on line 84 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L84
|
||
{ | ||
rclcpp::Node::SharedPtr raw_node = context_->getRosNodeAbstraction().lock()->get_raw_node(); | ||
publisher_ = raw_node->template create_publisher<geometry_msgs::msg::PointStamped>( | ||
topic_property_->getStdString(), qos_profile_); | ||
clock_ = raw_node->get_clock(); | ||
} | ||
Check warning on line 90 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L86-L90
|
||
|
||
void RerouteStaticObstaclePointPublish::updateAutoDeactivate() | ||
Check warning on line 92 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L92
|
||
{ | ||
} | ||
Check warning on line 94 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L94
|
||
|
||
int RerouteStaticObstaclePointPublish::processMouseEvent(rviz_common::ViewportMouseEvent & event) | ||
Check warning on line 96 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L96
|
||
{ | ||
int flags = 0; | ||
if (event.leftUp()) { | ||
const auto point = get_point_from_mouse(event); | ||
if (point) { | ||
setStatusForPosition(point.value()); | ||
publishPosition(point.value()); | ||
if (auto_deactivate_property_->getBool()) { | ||
Check warning on line 104 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L99-L104
|
||
flags |= Finished; | ||
} | ||
} | ||
} | ||
|
||
return flags; | ||
Check warning on line 110 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L110
|
||
} | ||
|
||
void RerouteStaticObstaclePointPublish::setStatusForPosition(const Ogre::Vector3 & position) | ||
Check warning on line 113 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L113
|
||
{ | ||
std::ostringstream s; | ||
s << "<b>Left-Click:</b> Select this point."; | ||
Check warning on line 116 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L115-L116
|
||
s.precision(3); | ||
s << " [" << position.x << "," << position.y << "," << position.z << "]"; | ||
setStatus(s.str().c_str()); | ||
} | ||
Check warning on line 120 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L118-L120
|
||
|
||
void RerouteStaticObstaclePointPublish::publishPosition(const Ogre::Vector3 & position) const | ||
Check warning on line 122 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L122
|
||
{ | ||
auto point = rviz_common::pointOgreToMsg(position); | ||
geometry_msgs::msg::PointStamped point_stamped; | ||
point_stamped.point = point; | ||
point_stamped.header.frame_id = context_->getFixedFrame().toStdString(); | ||
point_stamped.header.stamp = clock_->now(); | ||
publisher_->publish(point_stamped); | ||
} | ||
Check warning on line 130 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L126-L130
|
||
|
||
std::optional<Ogre::Vector3> RerouteStaticObstaclePointPublish::get_point_from_mouse( | ||
Check warning on line 132 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L132
|
||
rviz_common::ViewportMouseEvent & event) | ||
{ | ||
using rviz_rendering::RenderWindowOgreAdapter; | ||
const auto viewport = RenderWindowOgreAdapter::getOgreViewport(event.panel->getRenderWindow()); | ||
const auto w = viewport->getActualWidth(); | ||
const auto h = viewport->getActualHeight(); | ||
const auto x = static_cast<Ogre::Real>(event.x) / static_cast<Ogre::Real>(w); | ||
const auto y = static_cast<Ogre::Real>(event.y) / static_cast<Ogre::Real>(h); | ||
Check warning on line 140 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L136-L140
|
||
|
||
const auto plane = Ogre::Plane(Ogre::Vector3::UNIT_Z, 0.0); | ||
const auto ray = viewport->getCamera()->getCameraToViewportRay(x, y); | ||
const auto intersect = ray.intersects(plane); | ||
return intersect.first ? std::optional(ray.getPoint(intersect.second)) : std::nullopt; | ||
Check warning on line 145 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L143-L145
|
||
} | ||
|
||
} // namespace rviz_plugins | ||
|
||
#include <pluginlib/class_list_macros.hpp> // NOLINT | ||
PLUGINLIB_EXPORT_CLASS(rviz_plugins::RerouteStaticObstaclePointPublish, rviz_common::Tool) | ||
Check warning on line 151 in common/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp Codecov / codecov/patchcommon/tier4_planning_rviz_plugin/src/reroute_static_obstacle/reroute_static_obstacle_plugin.cpp#L151
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ rclcpp_components_register_node(goal_pose_visualizer_component | |
EXECUTABLE goal_pose_visualizer | ||
) | ||
|
||
ament_auto_add_library(rerouting_static_obstacle_component SHARED | ||
src/rerouting_static_obstacle/rerouting_static_obstacle.cpp | ||
) | ||
|
||
rclcpp_components_register_node(rerouting_static_obstacle_component | ||
PLUGIN "mission_planner::ReroutingStaticObstacle" | ||
EXECUTABLE rerouting_static_obstacle | ||
) | ||
Comment on lines
+16
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The +ament_auto_add_library(rerouting_static_obstacle_component SHARED
+ src/rerouting_static_obstacle/rerouting_static_obstacle.cpp
+)
+
+rclcpp_components_register_node(rerouting_static_obstacle_component
+ PLUGIN "mission_planner::ReroutingStaticObstacle"
+ EXECUTABLE rerouting_static_obstacle
+) |
||
|
||
ament_auto_add_library(${PROJECT_NAME}_component SHARED | ||
src/mission_planner/arrival_checker.cpp | ||
src/mission_planner/service_utils.cpp | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,30 @@ This interface for the MRM that pulls over the road shoulder. It has to be stopp | |
This is a goal change to pull over, avoid parked vehicles, and so on by a planning component. If the modified goal is outside the calculated route, a reroute is required. This goal modification is executed by checking the local environment and path safety as the vehicle actually approaches the destination. And this modification is allowed for both normal_route and mrm_route. | ||
The new route generated here is sent to the AD API so that it can also be referenced by the application. Note, however, that the specifications here are subject to change in the future. | ||
|
||
#### Rerouting Static Obstacle | ||
|
||
`Rerouting Static Obstacle` is a node under `Mission Planner` that aims to change the planned route of the current already set route by finding an alternative route to the shortest planned one. | ||
The `Rerouting Static Obstacle` use-cases can be rerouting for a vehicle that is blocking the road, road construction that blocks some lanes, or any other similar scenarios of dynamic map information. | ||
|
||
The way that `Rerouting Static Obstacle` node is working currently is that, when the human driver/operator notices a blockage during the planned route of the mission, s/he points in the map (using a dedicated plugin in rviz) where the blockage is. Then `Rerouting Static Obstacle` searches for alternative routes and if successfully found it calls `change_route` API. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I apologize very much for the very late review.
This rerouting node needs to be updated as well. |
||
|
||
The following diagram shows how `Rerouting Static Obstacle` node works in high level : | ||
|
||
<p align="center"> | ||
<img src=./media/rerouting-static-obstacle_flowchart.svg /> | ||
</p> | ||
|
||
Reference implementation for `Rerouting Static Obstacle` node is under `src/rerouting_static_obstacle` | ||
|
||
##### How to enable rerouting static obstacle plugin ? | ||
|
||
1. In rviz using the add plugin sign, then under `tier4_planning_rviz_plugin`, add the `RerouteStaticObstaclePointPublish` plugin | ||
2. Make the plugin visible for ease of use | ||
3. Select a point through the route of the vehicle (where you see a blockage for example) | ||
4. If an alternative route can be found, the vehicle will to change route and will not go through the selected point. | ||
|
||
> Make sure that you select the point for rerouting with enough distance ahead the vehicle, otherwise the rerouting will be considered unsafe. For more information, please check the Rerouting Limitations section below and `mission_planner.param.yaml` config file. | ||
|
||
#### Rerouting Limitations | ||
|
||
- The safety judgment of rerouting is not guaranteed to the level of trajectory or control. Therefore, the distance to the reroute change must be large for the safety. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<launch> | ||
<arg name="odometry_topic_name" default="/localization/kinematic_state"/> | ||
<arg name="route_topic_name" default="/planning/mission_planning/route"/> | ||
<arg name="map_topic_name" default="/map/vector_map"/> | ||
<arg name="reroute_point_topic_name" default="/simulation/planning/reroute_static_obstacle_point_publisher/point"/> | ||
|
||
<node pkg="mission_planner" exec="rerouting_static_obstacle" name="rerouting_static_obstacle" output="screen"> | ||
<remap from="input/odometry" to="$(var odometry_topic_name)"/> | ||
<remap from="input/route" to="$(var route_topic_name)"/> | ||
<remap from="input/vector_map" to="$(var map_topic_name)"/> | ||
<remap from="input/reroute_point" to="$(var reroute_point_topic_name)"/> | ||
</node> | ||
</launch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeRabbit
The
add_definitions(-DQT_NO_KEYWORDS)
line is missing in the new hunk. Please add it back to theCMakeLists.txt
file.+add_definitions(-DQT_NO_KEYWORDS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of this line is intended and needed as this definition leads to the usage of
QSLOTS
instead ofslots
and the file<rviz_rendering/render_window.hpp>
is using slots. With using this definition, the new plugin is not compiling.