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

chore: sync upstream #47

Merged
merged 56 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e679068
fix(behavior_velocity): avoid insert same point on trajectory utils (…
taikitanaka3 May 9, 2022
b3a0363
refactor(behavior_velocity_planner): simplify CMakeLists.txt (#855)
kenji-miyake May 9, 2022
de8deed
fix(system_monitor): fix build error on tegra platform (#869)
Sharrrrk May 9, 2022
391ebac
feat(ad_service_state_monitor): limit odometry buffer size (#514)
takayuki5168 May 9, 2022
03bacea
docs: fix 404 error caused by typo in url (#871)
Shin-kyoto May 9, 2022
8b48054
fix(image_projection_based_fusion): set imagebuffersize (#820)
storrrrrrrrm May 9, 2022
c88ae05
chore(avoidance_module): fix spell check (#732)
zulfaqar-azmi-t4 May 9, 2022
13d3b6d
feat: isolate gtests in all packages (#693)
maxime-clem May 9, 2022
d52721f
docs(virtual traffic light): add documentation (#245)
taikitanaka3 May 9, 2022
7eb4b6c
feat(surround_obstacle_checker): separate surround_obstacle_checker f…
satoshi-ota May 9, 2022
178a65c
feat: remove deprecated package in prediction launch (#875)
yukkysaito May 10, 2022
429a06c
fix(surround_obstacle_checker): fix ego footprint polygon (#877)
satoshi-ota May 10, 2022
c092de0
fix: update nvinfer api (#863)
wep21 May 10, 2022
8c0cc86
fix(avoidance_module): ignore object instead of creating zero shift (…
zulfaqar-azmi-t4 May 10, 2022
667fb38
fix(motion_velocity_smoother): curve deceleration not working with a …
TakaHoribe May 10, 2022
f8a136c
test(autoware_testing): fix smoke_test (#479)
KeisukeShima May 10, 2022
7bdd7a8
feat(rviz_plugins): add velocity limit to autoware state panel (#879)
taikitanaka3 May 11, 2022
c00e120
fix(dummy_perception_publisher): publish multiple layers of pointclou…
HiroIshida May 11, 2022
344111e
feat(vehicle_info_util): add max_steer_angle (#740)
takayuki5168 May 11, 2022
176d33f
ci(deploy-docs): remove mdx_unimoji (#883)
shmpwk May 11, 2022
bb96ae7
chore: sync files (#884)
awf-autoware-bot[bot] May 11, 2022
7307ce7
fix(lidar_centerpoint): fix google drive url to avoid 404 (#889)
h-ohta May 12, 2022
90f8d8c
chore: fix typos (#886)
badai-nguyen May 12, 2022
06fe0e7
feat(state_rviz_plugin): add GateMode and PathChangeApproval Button (…
h-ohta May 13, 2022
3bcb248
feat(map_tf_generator): accelerate the 'viewer' coordinate calculatio…
IshitaTakeshi May 13, 2022
e89e06d
docs(obstacle_stop_planner): update documentation (#880)
satoshi-ota May 13, 2022
12b7af1
docs(tier4_traffic_light_rviz_plugin): update documentation (#905)
satoshi-ota May 16, 2022
4d65335
fix(accel_brake_map_calibrator): rviz panel type (#895)
soblin May 16, 2022
c32361f
fix(behavior velocity planner): skipping emplace back stop reason if …
TakumiKozaka-T4 May 17, 2022
49d1764
feat(behavior_path_planner): weakened noise filtering of drivable are…
takayuki5168 May 17, 2022
56f8386
refactor(vehicle-cmd-gate): using namespace for msgs (#913)
TakaHoribe May 18, 2022
1cb3f3c
feat(pose_initializer): introduce an array copy function (#900)
IshitaTakeshi May 18, 2022
0707207
feat: add lidar point filter when debug (#865)
storrrrrrrrm May 18, 2022
946628c
feat(component_interface_utils): add interface classes (#899)
isamu-takagi May 18, 2022
f301c1e
refactor(vehicle_cmd_gate): change namespace in launch file (#927)
brkay54 May 19, 2022
f5fbce3
feat: visualize lane boundaries (#923)
h-ohta May 19, 2022
a72a2f2
fix(system_monitor): fix truncation warning in strncpy (#872)
ito-san May 19, 2022
ac400df
fix(behavior_velocity_planner.stopline): extend following and previou…
h-ohta May 19, 2022
5195805
docs(surround obstacle checker): update documentation (#878)
satoshi-ota May 19, 2022
351fa12
feat(tier4_autoware_utils): add vehicle state checker (#896)
satoshi-ota May 19, 2022
584d557
fix(motion_velocity_smoother): fix overwriteStopPoint using backward …
kosuke55 May 19, 2022
e24a475
feat(obstacle_avoidance_planner): explicitly insert zero velocity (#906)
takayuki5168 May 19, 2022
1578333
feat(behavior_velocity): find occlusion more efficiently (#829)
taikitanaka3 May 20, 2022
b64e0d0
fix(system_monitor): add some smart information to diagnostics (#708)
kk-inoue-esol May 20, 2022
1abf325
feat(obstacle_avoidance_planner): dealt with close lane change (#921)
takayuki5168 May 20, 2022
5afabee
feat(obstacle_avoidance_planner): some fix for narrow driving (#916)
takayuki5168 May 20, 2022
3949ef1
chore(obstacle_avoidance_planner): removed obsolete obstacle_avoidanc…
takayuki5168 May 20, 2022
76b00b5
chore(behavior_velocity_planner.stopline): add debug marker for stopl…
h-ohta May 20, 2022
c7766f5
feat(map_loader): visualize center line by points (#931)
h-ohta May 20, 2022
1696c2b
feat: add RTC interface (#765)
rej55 May 20, 2022
93d95dd
chore: sync files (#911)
awf-autoware-bot[bot] May 21, 2022
6b73a23
fix: replace boost::mutex::scoped_lock to std::scoped_lock (#907)
RyuYamamoto May 23, 2022
2a85716
feat(tensorrt_yolo): add multi gpu support to tensorrt_yolo node (#885)
kaancolak May 23, 2022
b089c41
feat(tier4_planning_launch): create parameter yaml for behavior_veloc…
h-ohta May 23, 2022
f2577c6
fix(map_loader): use std::filesystem to load pcd files in pointcloud_…
RyuYamamoto May 23, 2022
db25a76
Merge branch 'tier4/main' into sync-upstream
YoheiMishina May 24, 2022
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
1 change: 1 addition & 0 deletions .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
workflow_dispatch:
inputs:
beta-branch-or-tag-name:
description: The name of the beta branch or tag to release
type: string
required: true

Expand Down
6 changes: 6 additions & 0 deletions common/component_interface_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ This is a utility package that provides the following features:
component_interface_utils::Service<SampleService>::SharedPtr srv_;
srv_ = component_interface_utils::create_service<SampleService>(node, ...);
```

## Design

This package provides the wrappers for the interface classes of rclcpp.
The wrappers limit the usage of the original class to enforce the processing recommended by the component interface.
Do not inherit the class of rclcpp, and forward or wrap the member function that is allowed to be used.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,62 @@
#define COMPONENT_INTERFACE_UTILS__RCLCPP_HPP_

#include <component_interface_utils/rclcpp/create_interface.hpp>
#include <component_interface_utils/rclcpp/service_client.hpp>
#include <component_interface_utils/rclcpp/service_server.hpp>
#include <component_interface_utils/rclcpp/topic_publisher.hpp>
#include <component_interface_utils/rclcpp/topic_subscription.hpp>

#include <utility>

namespace component_interface_utils
{

class NodeAdaptor
{
private:
using CallbackGroup = rclcpp::CallbackGroup::SharedPtr;

public:
/// Constructor.
explicit NodeAdaptor(rclcpp::Node * node) : node_(node) {}

/// Create a client wrapper for logging.
template <class SharedPtrT>
void init_cli(SharedPtrT & cli, CallbackGroup group = nullptr) const
{
using SpecT = typename SharedPtrT::element_type::SpecType;
cli = create_client_impl<SpecT>(node_, group);
}

/// Create a service wrapper for logging.
template <class SharedPtrT, class CallbackT>
void init_srv(SharedPtrT & srv, CallbackT && callback, CallbackGroup group = nullptr) const
{
using SpecT = typename SharedPtrT::element_type::SpecType;
srv = create_service_impl<SpecT>(node_, std::forward<CallbackT>(callback), group);
}

/// Create a publisher using traits like services.
template <class SharedPtrT>
void init_pub(SharedPtrT & pub) const
{
using SpecT = typename SharedPtrT::element_type::SpecType;
pub = create_publisher_impl<SpecT>(node_);
}

/// Create a subscription using traits like services.
template <class SharedPtrT, class CallbackT>
void init_sub(SharedPtrT & sub, CallbackT && callback) const
{
using SpecT = typename SharedPtrT::element_type::SpecType;
sub = create_subscription_impl<SpecT>(node_, std::forward<CallbackT>(callback));
}

private:
// Use a node pointer because shared_from_this cannot be used in constructor.
rclcpp::Node * node_;
};

} // namespace component_interface_utils

#endif // COMPONENT_INTERFACE_UTILS__RCLCPP_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,35 @@
#ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__CREATE_INTERFACE_HPP_
#define COMPONENT_INTERFACE_UTILS__RCLCPP__CREATE_INTERFACE_HPP_

#include <component_interface_utils/rclcpp/service_client.hpp>
#include <component_interface_utils/rclcpp/service_server.hpp>
#include <component_interface_utils/rclcpp/topic_publisher.hpp>
#include <component_interface_utils/rclcpp/topic_subscription.hpp>
#include <component_interface_utils/specs.hpp>
#include <rclcpp/rclcpp.hpp>

#include <utility>

namespace component_interface_utils
{

/// Create a client wrapper for logging. This is a private implementation.
template <class SpecT, class NodeT>
typename Client<SpecT>::SharedPtr create_client_impl(
NodeT * node, rclcpp::CallbackGroup::SharedPtr group = nullptr)
{
// This function is a wrapper for the following.
// https://github.com/ros2/rclcpp/blob/48068130edbb43cdd61076dc1851672ff1a80408/rclcpp/include/rclcpp/node.hpp#L253-L265
auto client = node->template create_client<typename SpecT::Service>(
SpecT::name, rmw_qos_profile_services_default, group);
return Client<SpecT>::make_shared(client, node->get_logger());
}

/// Create a service wrapper for logging. This is a private implementation.
template <class SpecT, class NodeT, class CallbackT>
typename Service<SpecT>::SharedPtr create_service_impl(
NodeT * node, CallbackT && callback, rclcpp::CallbackGroup::SharedPtr group = nullptr)
{
// Use a node pointer because shared_from_this cannot be used in constructor.
// This function is a wrapper for the following.
// https://github.com/ros2/rclcpp/blob/48068130edbb43cdd61076dc1851672ff1a80408/rclcpp/include/rclcpp/node.hpp#L267-L281
auto wrapped = Service<SpecT>::wrap(callback, node->get_logger());
Expand All @@ -37,23 +52,27 @@ typename Service<SpecT>::SharedPtr create_service_impl(
return Service<SpecT>::make_shared(service);
}

/// Create a service wrapper for logging. This is for lambda or bound function.
template <class SpecT, class NodeT, class CallbackT>
typename Service<SpecT>::SharedPtr create_service(
NodeT * node, CallbackT && callback, rclcpp::CallbackGroup::SharedPtr group = nullptr)
/// Create a publisher using traits like services. This is a private implementation.
template <class SpecT, class NodeT>
typename Publisher<SpecT>::SharedPtr create_publisher_impl(NodeT * node)
{
return create_service_impl<SpecT>(node, std::forward<CallbackT>(callback), group);
// This function is a wrapper for the following.
// https://github.com/ros2/rclcpp/blob/48068130edbb43cdd61076dc1851672ff1a80408/rclcpp/include/rclcpp/node.hpp#L167-L205
auto publisher =
node->template create_publisher<typename SpecT::Message>(SpecT::name, get_qos<SpecT>());
return Publisher<SpecT>::make_shared(publisher);
}

/// Create a service wrapper for logging. This is for member function of node.
template <class SpecT, class NodeT>
typename Service<SpecT>::SharedPtr create_service(
NodeT * node, typename Service<SpecT>::template CallbackType<NodeT> callback,
rclcpp::CallbackGroup::SharedPtr group = nullptr)
/// Create a subscription using traits like services. This is a private implementation.
template <class SpecT, class NodeT, class CallbackT>
typename Subscription<SpecT>::SharedPtr create_subscription_impl(
NodeT * node, CallbackT && callback)
{
using std::placeholders::_1;
using std::placeholders::_2;
return create_service_impl<SpecT>(node, std::bind(callback, node, _1, _2), group);
// This function is a wrapper for the following.
// https://github.com/ros2/rclcpp/blob/48068130edbb43cdd61076dc1851672ff1a80408/rclcpp/include/rclcpp/node.hpp#L207-L238
auto subscription = node->template create_subscription<typename SpecT::Message>(
SpecT::name, get_qos<SpecT>(), std::forward<CallbackT>(callback));
return Subscription<SpecT>::make_shared(subscription);
}

} // namespace component_interface_utils
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright 2022 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.

#ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_CLIENT_HPP_
#define COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_CLIENT_HPP_

#include <rclcpp/client.hpp>
#include <rclcpp/logger.hpp>
#include <rclcpp/logging.hpp>

#include <utility>

namespace component_interface_utils
{

/// The wrapper class of rclcpp::Client for logging.
template <class SpecT>
class Client
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(Client)
using SpecType = SpecT;
using WrapType = rclcpp::Client<typename SpecT::Service>;

/// Constructor.
explicit Client(typename WrapType::SharedPtr client, const rclcpp::Logger & logger)
: logger_(logger)
{
client_ = client; // to keep the reference count
}

/// Send request.
typename WrapType::SharedFuture async_send_request(typename WrapType::SharedRequest request)
{
const auto callback = [this](typename WrapType::SharedFuture future) {};
return this->async_send_request(request, callback);
}

/// Send request.
template <class CallbackT>
typename WrapType::SharedFuture async_send_request(
typename WrapType::SharedRequest request, CallbackT && callback)
{
#ifdef ROS_DISTRO_GALACTIC
using rosidl_generator_traits::to_yaml;
#endif

const auto wrapped = [this, callback](typename WrapType::SharedFuture future) {
RCLCPP_INFO_STREAM(logger_, "client exit: " << SpecT::name << "\n" << to_yaml(*future.get()));
callback(future);
};

RCLCPP_INFO_STREAM(logger_, "client call: " << SpecT::name << "\n" << to_yaml(*request));
return client_->async_send_request(request, wrapped);
}

private:
RCLCPP_DISABLE_COPY(Client)
typename WrapType::SharedPtr client_;
rclcpp::Logger logger_;
};

} // namespace component_interface_utils

#endif // COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_CLIENT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_SERVER_HPP_
#define COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_SERVER_HPP_

#include <rclcpp/rclcpp.hpp>
#include <rclcpp/logging.hpp>
#include <rclcpp/service.hpp>

namespace component_interface_utils
{
Expand All @@ -26,13 +27,11 @@ class Service
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(Service)

template <class NodeT>
using CallbackType = void (NodeT::*)(
typename SpecT::Service::Request::SharedPtr, typename SpecT::Service::Response::SharedPtr);
using SpecType = SpecT;
using WrapType = rclcpp::Service<typename SpecT::Service>;

/// Constructor.
explicit Service(typename rclcpp::Service<typename SpecT::Service>::SharedPtr service)
explicit Service(typename WrapType::SharedPtr service)
{
service_ = service; // to keep the reference count
}
Expand All @@ -56,7 +55,7 @@ class Service

private:
RCLCPP_DISABLE_COPY(Service)
typename rclcpp::Service<typename SpecT::Service>::SharedPtr service_;
typename WrapType::SharedPtr service_;
};

} // namespace component_interface_utils
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2022 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.

#ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_PUBLISHER_HPP_
#define COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_PUBLISHER_HPP_

#include <rclcpp/publisher.hpp>

namespace component_interface_utils
{

/// The wrapper class of rclcpp::Publisher. This is for future use and no functionality now.
template <class SpecT>
class Publisher
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(Publisher)
using SpecType = SpecT;
using WrapType = rclcpp::Publisher<typename SpecT::Message>;

/// Constructor.
explicit Publisher(typename WrapType::SharedPtr publisher)
{
publisher_ = publisher; // to keep the reference count
}

/// Publish a message.
void publish(const typename SpecT::Message & msg) { publisher_->publish(msg); }

private:
RCLCPP_DISABLE_COPY(Publisher)
typename WrapType::SharedPtr publisher_;
};

} // namespace component_interface_utils

#endif // COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_PUBLISHER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2022 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.

#ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_SUBSCRIPTION_HPP_
#define COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_SUBSCRIPTION_HPP_

#include <rclcpp/subscription.hpp>

namespace component_interface_utils
{

/// The wrapper class of rclcpp::Subscription. This is for future use and no functionality now.
template <class SpecT>
class Subscription
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(Subscription)
using SpecType = SpecT;
using WrapType = rclcpp::Subscription<typename SpecT::Message>;

/// Constructor.
explicit Subscription(typename WrapType::SharedPtr subscription)
{
subscription_ = subscription; // to keep the reference count
}

private:
RCLCPP_DISABLE_COPY(Subscription)
typename WrapType::SharedPtr subscription_;
};

} // namespace component_interface_utils

#endif // COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_SUBSCRIPTION_HPP_
Loading