Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

[pull] main from autowarefoundation:main #44

Merged
merged 4 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions common/autoware_ad_api_specs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_ad_api_specs)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_package()
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DEFAULT_AD_API__SPECS__INTERFACE__VERSION_HPP_
#define DEFAULT_AD_API__SPECS__INTERFACE__VERSION_HPP_
#ifndef AUTOWARE_AD_API_SPECS__INTERFACE_HPP_
#define AUTOWARE_AD_API_SPECS__INTERFACE_HPP_

#include "autoware_ad_api_msgs/srv/interface_version.hpp"
#include <autoware_ad_api_msgs/srv/interface_version.hpp>

namespace ad_api::interface::version
namespace autoware_ad_api::interface
{

struct T
struct Version
{
using Service = autoware_ad_api_msgs::srv::InterfaceVersion;
static constexpr char name[] = "/api/interface/version";
};

} // namespace ad_api::interface::version
} // namespace autoware_ad_api::interface

#endif // DEFAULT_AD_API__SPECS__INTERFACE__VERSION_HPP_
#endif // AUTOWARE_AD_API_SPECS__INTERFACE_HPP_
20 changes: 20 additions & 0 deletions common/autoware_ad_api_specs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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>autoware_ad_api_specs</name>
<version>0.0.0</version>
<description>The autoware_ad_api_specs package</description>
<maintainer email="isamu.takagi@tier4.jp">Takagi, Isamu</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<build_depend>autoware_cmake</build_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void DetectedObjectsDisplay::processMessage(DetectedObjects::ConstSharedPtr msg)
clear_markers();
int id = 0;
for (const auto & object : msg->objects) {
// TODO(Satoshi Tanaka): fixing from string label to one string
// Get marker for shape
auto shape_marker = get_shape_marker_ptr(
object.shape, object.kinematics.pose_with_covariance.pose.position,
Expand All @@ -53,6 +54,28 @@ void DetectedObjectsDisplay::processMessage(DetectedObjects::ConstSharedPtr msg)
label_marker_ptr->id = id++;
add_marker(label_marker_ptr);
}

// Get marker for velocity text
geometry_msgs::msg::Point vel_vis_position;
vel_vis_position.x = object.kinematics.pose_with_covariance.pose.position.x - 0.5;
vel_vis_position.y = object.kinematics.pose_with_covariance.pose.position.y;
vel_vis_position.z = object.kinematics.pose_with_covariance.pose.position.z - 0.5;
auto velocity_text_marker = get_velocity_text_marker_ptr(
object.kinematics.twist_with_covariance.twist, vel_vis_position, object.classification);
if (velocity_text_marker) {
auto velocity_text_marker_ptr = velocity_text_marker.value();
velocity_text_marker_ptr->header = msg->header;
add_marker(velocity_text_marker_ptr);
}

// Get marker for twist
auto twist_marker = get_twist_marker_ptr(
object.kinematics.pose_with_covariance, object.kinematics.twist_with_covariance);
if (twist_marker) {
auto twist_marker_ptr = twist_marker.value();
twist_marker_ptr->header = msg->header;
add_marker(twist_marker_ptr);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,7 @@ void AvoidanceModule::addShiftPointIfApproved(const AvoidPointArray & shift_poin

uuid_left_ = generateUUID();
uuid_right_ = generateUUID();
candidate_uuid_ = generateUUID();

DEBUG_PRINT("shift_point size: %lu -> %lu", prev_size, path_shifter_.getShiftPointsSize());
} else {
Expand Down
4 changes: 2 additions & 2 deletions planning/freespace_planning_algorithms/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<name>freespace_planning_algorithms</name>
<version>0.1.0</version>
<description>The freespace_planning_algorithms package</description>
<maintainer email="aohsato@gmail.com">Akihito Ohsato</maintainer>
<maintainer email="takamasa.horibe@tier4.jp">Takamasa Horibe</maintainer>
<license>Apache License 2.0</license>

<author email="aohsato@gmail.com">Akihito Ohsato</author>
<author email="akihito.ohsato@tier4.jp">Akihito Ohsato</author>
<author email="h-ishida@jsk.imi.i.u-tokyo.ac.jp">Hirokazu Ishida</author>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
1 change: 1 addition & 0 deletions system/default_ad_api/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<build_depend>autoware_cmake</build_depend>

<depend>autoware_ad_api_msgs</depend>
<depend>autoware_ad_api_specs</depend>
<depend>component_interface_utils</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
Expand Down
14 changes: 6 additions & 8 deletions system/default_ad_api/src/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ namespace default_ad_api

InterfaceNode::InterfaceNode(const rclcpp::NodeOptions & options) : Node("interface", options)
{
using InterfaceVersion = autoware_ad_api_msgs::srv::InterfaceVersion;

const auto on_interface_version = [](SERVICE_ARG_NO_REQ(InterfaceVersion)) {
response->major = 0;
response->minor = 1;
response->patch = 0;
const auto on_interface_version = [](auto, auto res) {
res->major = 0;
res->minor = 1;
res->patch = 0;
};

const auto node = component_interface_utils::NodeAdaptor(this);
node.init_srv(srv_, on_interface_version);
const auto adaptor = component_interface_utils::NodeAdaptor(this);
adaptor.init_srv(srv_, on_interface_version);
}

} // namespace default_ad_api
Expand Down
9 changes: 5 additions & 4 deletions system/default_ad_api/src/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
#ifndef INTERFACE_HPP_
#define INTERFACE_HPP_

#include "default_ad_api/specs/interface/version.hpp"
#include "utils/types.hpp"

#include <autoware_ad_api_specs/interface.hpp>
#include <component_interface_utils/rclcpp.hpp>
#include <rclcpp/rclcpp.hpp>

// This file should be included after messages.
#include "utils/types.hpp"

namespace default_ad_api
{

Expand All @@ -30,7 +31,7 @@ class InterfaceNode : public rclcpp::Node
explicit InterfaceNode(const rclcpp::NodeOptions & options);

private:
Service<ad_api::interface::version::T>::SharedPtr srv_;
Srv<autoware_ad_api::interface::Version> srv_;
};

} // namespace default_ad_api
Expand Down
14 changes: 4 additions & 10 deletions system/default_ad_api/src/utils/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,17 @@

#include <component_interface_utils/rclcpp.hpp>

#define MESSAGE_ARG(Type) const Type::ConstSharedPtr message
#define SERVICE_ARG(Type) \
const Type::Request::SharedPtr request, const Type::Response::SharedPtr response
#define SERVICE_ARG_NO_REQ(Type) \
const Type::Request::SharedPtr, const Type::Response::SharedPtr response

namespace default_ad_api
{

template <class T>
using Publisher = component_interface_utils::Publisher<T>;
using Pub = typename component_interface_utils::Publisher<T>::SharedPtr;
template <class T>
using Subscription = component_interface_utils::Subscription<T>;
using Sub = typename component_interface_utils::Subscription<T>::SharedPtr;
template <class T>
using Client = component_interface_utils::Client<T>;
using Cli = typename component_interface_utils::Client<T>::SharedPtr;
template <class T>
using Service = component_interface_utils::Service<T>;
using Srv = typename component_interface_utils::Service<T>::SharedPtr;

} // namespace default_ad_api

Expand Down