Skip to content

Commit

Permalink
feat: add shape estimation package (autowarefoundation#100)
Browse files Browse the repository at this point in the history
* release v0.4.0

* fix uninitialized variables (autowarefoundation#816)

* remove ROS1 packages temporarily

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Revert "remove ROS1 packages temporarily"

This reverts commit 3a695e62c841e01681880263bb62a810f11ebf74.

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* add COLCON_IGNORE to ros1 packages

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Rename launch files to launch.xml (autowarefoundation#28)

* port shape_estimation to ros2 (autowarefoundation#37)

* port shape_estimation to ros2

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* minor fix from review

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* remove unused files

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* minor fix on include

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* fix cmakelist

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* remove unused codes

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* fix cmake

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* [shape_estimation] fix launch file (autowarefoundation#116)

* [shape_estimation] fix launch file

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* remove unnecessary find_package from CMakeLists.txt

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Adjust copyright notice on 532 out of 699 source files (autowarefoundation#143)

* Use quotes for includes where appropriate (autowarefoundation#144)

* Use quotes for includes where appropriate

* Fix lint tests

* Make tests pass hopefully

* Run uncrustify on the entire Pilot.Auto codebase (autowarefoundation#151)

* Run uncrustify on the entire Pilot.Auto codebase

* Exclude open PRs

* adding linters to shape_estimation (autowarefoundation#174)

* Ros2 v0.8.0 shape estimation (autowarefoundation#257)

* fix typos in perception (autowarefoundation#862)

* Feature/camera lidar perception (autowarefoundation#937)

* add object splitter

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* add object merger

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* change pkg name

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* cosmetic change

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* add comment

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* remove litter

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* bug fix : debug code

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* enable vehicle to unknown track

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* bug fix

* add object position in clustering

* 🚮

* change param

* fix name

* bug fix

* add install

Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>
Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>

* fix bug (autowarefoundation#1161) (autowarefoundation#374)

Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>

* Fix typo in perception module (autowarefoundation#440)

* add use_sim-time option (autowarefoundation#454)

* Remove use_sim_time for set_parameter (autowarefoundation#1260)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Perception components (autowarefoundation#1368)

* [bev_optical_flow]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [object_merger]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [object_range_splitter]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [shape_estimation]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [map_based_prediction]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [naive_path_prediction]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [roi_image_saver]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [lidar_apollo_instance_segmentation]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [object_flow_fusion]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [traffic_light_map_based_detector]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* [dynamic_object_visualization]: component node

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fix typo

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Add markdownlint and prettier (autowarefoundation#1661)

* Add markdownlint and prettier

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Ignore .param.yaml

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* suppress warnings for shape estimation (autowarefoundation#1770)

* add Werror

* fix uninitialized

* Fix -Wunused-parameter (autowarefoundation#1836)

* Fix -Wunused-parameter

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix mistake

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* fix spell

* Fix lint issues

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Ignore flake8 warnings

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp>

* Refactor shape estimation for detection by tracking (autowarefoundation#1861)

* refactor

* modification due to refactoring

* cosmetic change and add virtual

* change to lib

* fix typo

* bug fix

* cosmetic change

* bug fix

* add constexpr

* cosmetic change

* cosmetic change

* cosmetic change

* cosmetic change

* Invoke code formatter at pre-commit (autowarefoundation#1935)

* Run ament_uncrustify at pre-commit

* Reformat existing files
* Fix copyright and cpplint errors

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Co-authored-by: Kenji Miyake <kenji.miyake@tier4.jp>

* add sort-package-xml hook in pre-commit (autowarefoundation#1881)

* add sort xml hook in pre-commit

* change retval to exit_status

* rename

* add prettier plugin-xml

* use early return

* add license note

* add tier4 license

* restore prettier

* change license order

* move local hooks to public repo

* move prettier-xml to pre-commit-hooks-ros

* update version for bug-fix

* apply pre-commit

* add createQuaternionFromYaw (autowarefoundation#2120)

* add createQuaternionFromYaw

* add test

* change return value type of createQuaternionFromRPY from tf2::quat to geomety_msgs::msg::quat

* use geometry_msgs::msg::Quaternion in createQuaternionFromRPY in application

* Detection by tracker (autowarefoundation#1910)

* initial commit

* backup

* apply format

* cosmetic change

* implement divided under segmenterd clusters

* cosmetic change

* bug fix

* bug fix

* bug fix

* modify launch

* add debug and bug fix

* bug fix

* bug fix

* add no found tracked object

* modify parameters and cmake

* bug fix

* remove debug info

* add readme

* modify clustering launch

* run pre-commit

* cosmetic change

* cosmetic change

* cosmetic change

* apply markdownlint

* modify launch

* modify for cpplint

* modify qos

* change int to size_T

* bug fix

* change perception qos

* Update perception/object_recognition/detection/detection_by_tracker/package.xml

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>

* cosmetic change

* cosmetic change

* fix launch

* Update perception/object_recognition/detection/detection_by_tracker/src/utils.cpp

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>

* modify header include order

* change include order

* Update perception/object_recognition/detection/detection_by_tracker/src/detection_by_tracker_core.cpp

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>

* change to std::optional

* cosmetic change

* Update perception/object_recognition/detection/detection_by_tracker/src/detection_by_tracker_core.cpp

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>

* Update perception/object_recognition/detection/detection_by_tracker/src/detection_by_tracker_core.cpp

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>

* bug fix

* modify readme

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>

* Change formatter to clang-format and black (autowarefoundation#2332)

* Revert "Temporarily comment out pre-commit hooks"

This reverts commit 748e9cdb145ce12f8b520bcbd97f5ff899fc28a3.

* Replace ament_lint_common with autoware_lint_common

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Remove ament_cmake_uncrustify and ament_clang_format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply Black

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply clang-format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix build errors

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix for cpplint

* Fix include double quotes to angle brackets

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply clang-format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix build errors

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Add COLCON_IGNORE (autowarefoundation#500)

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Port shape estimation to .auto (autowarefoundation#551)

* Port shape estimation to .auto

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Cosmetic change

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Cosmetic change

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Run pre commit

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fix typo

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Cosmetic change: type -> label

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Add trailer label

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Update document for shape estimation (autowarefoundation#604)

* Update document for shape estimation

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Update perception/object_recognition/detection/shape_estimation/README.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Run pre-commit

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Address review

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* [shape_estimation]change type (autowarefoundation#663)

* change output type of shape_estimation

* remove unused function

* add dynamic_object_converter

* rename

* fix typo

* fix dummy_perception_publisher

* update readme

* fix copyright

* rename package

* add readme

* fix launch name

* remove unused variable

* fix readme

* fix convert function

* change topic name of DynamicObjectsWithFeature

Co-authored-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>
Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>
Co-authored-by: Nikolai Morin <nnmmgit@gmail.com>
Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com>
Co-authored-by: nik-tier4 <71747268+nik-tier4@users.noreply.github.com>
Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>
Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>
Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>
Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp>
Co-authored-by: Takeshi Ishita <ishitah.takeshi@gmail.com>
Co-authored-by: Kenji Miyake <kenji.miyake@tier4.jp>
Co-authored-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com>
Co-authored-by: Takayuki Murooka <takayuki5168@gmail.com>
Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com>
  • Loading branch information
17 people authored Dec 3, 2021
1 parent f391dd7 commit bd4111f
Show file tree
Hide file tree
Showing 40 changed files with 2,101 additions and 0 deletions.
78 changes: 78 additions & 0 deletions perception/shape_estimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
cmake_minimum_required(VERSION 3.5)
project(shape_estimation)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
endif()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

find_package(PCL REQUIRED COMPONENTS common)
find_package(pcl_conversions REQUIRED)

find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)


set(SHAPE_ESTIMATION_DEPENDENCIES
PCL
OpenCV
Eigen3
)

ament_auto_add_library(shape_estimation_lib SHARED
lib/shape_estimator.cpp
lib/model/bounding_box.cpp
lib/model/convex_hull.cpp
lib/model/cylinder.cpp
lib/filter/car_filter.cpp
lib/filter/bus_filter.cpp
lib/filter/truck_filter.cpp
lib/filter/no_filter.cpp
lib/filter/utils.cpp
lib/corrector/car_corrector.cpp
lib/corrector/bus_corrector.cpp
lib/corrector/truck_corrector.cpp
lib/corrector/no_corrector.cpp
lib/corrector/utils.cpp
)

ament_target_dependencies(shape_estimation_lib ${SHAPE_ESTIMATION_DEPENDENCIES})

ament_auto_add_library(shape_estimation_node SHARED
src/node.cpp
)

target_include_directories(shape_estimation_node
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)

ament_target_dependencies(shape_estimation_node ${SHAPE_ESTIMATION_DEPENDENCIES})

target_link_libraries(shape_estimation_node
shape_estimation_lib
)

rclcpp_components_register_node(shape_estimation_node
PLUGIN "ShapeEstimationNode"
EXECUTABLE shape_estimation
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package(INSTALL_TO_SHARE
launch
)
62 changes: 62 additions & 0 deletions perception/shape_estimation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# shape_estimation

## Purpose

This node calculates a refined object shape (bounding box, cylinder, convex hull) in which a pointcloud cluster fits according to a label.

## Inner-workings / Algorithms

### Fitting algorithms

- bounding box

L-shape fitting. See reference below for details.

- cylinder

`cv::minEnclosingCircle`

- convex hull

`cv::convexHull`

## Inputs / Outputs

### Input

| Name | Type | Description |
| ------- | ----------------------------------------------------------- | ------------------------------------- |
| `input` | `autoware_perception_msgs::msg::DetectedObjectsWithFeature` | detected objects with labeled cluster |

### Output

| Name | Type | Description |
| ---------------- | ----------------------------------------------------- | ----------------------------------- |
| `output/objects` | `autoware_auto_perception_msgs::msg::DetectedObjects` | detected objects with refined shape |

## Parameters

| Name | Type | Default Value | Description |
| --------------------------- | ---- | ------------- | --------------------------------------------------- |
| `use_corrector` | bool | true | The flag to apply rule-based filter |
| `use_filter` | bool | true | The flag to apply rule-based corrector |
| `use_vehicle_reference_yaw` | bool | true | The flag to use vehicle reference yaw for corrector |

## Assumptions / Known limits

TBD

## References/External links

L-shape fitting implementation of the paper:

```bibtex
@conference{Zhang-2017-26536,
author = {Xiao Zhang and Wenda Xu and Chiyu Dong and John M. Dolan},
title = {Efficient L-Shape Fitting for Vehicle Detection Using Laser Scanners},
booktitle = {2017 IEEE Intelligent Vehicles Symposium},
year = {2017},
month = {June},
keywords = {autonomous driving, laser scanner, perception, segmentation},
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2018 Autoware Foundation. 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.

#ifndef SHAPE_ESTIMATION__CORRECTOR__BUS_CORRECTOR_HPP_
#define SHAPE_ESTIMATION__CORRECTOR__BUS_CORRECTOR_HPP_

#include "shape_estimation/corrector/corrector_interface.hpp"
#include "utils.hpp"

class BusCorrector : public ShapeEstimationCorrectorInterface
{
private:
utils::CorrectionParameters params_;
bool use_reference_yaw_;

public:
explicit BusCorrector(bool use_reference_yaw = false) : use_reference_yaw_(use_reference_yaw)
{
params_.min_width = 2.0;
params_.max_width = 2.9;
params_.avg_width = (params_.min_width + params_.max_width) * 0.5;
params_.min_length = 5.0;
params_.max_length = 17.0;
params_.avg_length = 7.0;
}

~BusCorrector() = default;

bool correct(
autoware_auto_perception_msgs::msg::Shape & shape_output,
geometry_msgs::msg::Pose & pose_output) override;
};

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

#ifndef SHAPE_ESTIMATION__CORRECTOR__CAR_CORRECTOR_HPP_
#define SHAPE_ESTIMATION__CORRECTOR__CAR_CORRECTOR_HPP_

#include "shape_estimation/corrector/corrector_interface.hpp"
#include "utils.hpp"

class CarCorrector : public ShapeEstimationCorrectorInterface
{
private:
utils::CorrectionParameters params_;
bool use_reference_yaw_;

public:
explicit CarCorrector(bool use_reference_yaw = false) : use_reference_yaw_(use_reference_yaw)
{
params_.min_width = 1.2;
params_.max_width = 2.2;
params_.avg_width = (params_.min_width + params_.max_width) * 0.5;
params_.min_length = 3.0;
params_.max_length = 5.0;
params_.avg_length = (params_.min_length + params_.max_length) * 0.5;
}

~CarCorrector() = default;

bool correct(
autoware_auto_perception_msgs::msg::Shape & shape_output,
geometry_msgs::msg::Pose & pose_output) override;
};

#endif // SHAPE_ESTIMATION__CORRECTOR__CAR_CORRECTOR_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2018 Autoware Foundation. 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.

#ifndef SHAPE_ESTIMATION__CORRECTOR__CORRECTOR_HPP_
#define SHAPE_ESTIMATION__CORRECTOR__CORRECTOR_HPP_

#include "shape_estimation/corrector/bus_corrector.hpp"
#include "shape_estimation/corrector/car_corrector.hpp"
#include "shape_estimation/corrector/corrector_interface.hpp"
#include "shape_estimation/corrector/no_corrector.hpp"
#include "shape_estimation/corrector/truck_corrector.hpp"

#endif // SHAPE_ESTIMATION__CORRECTOR__CORRECTOR_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2018 Autoware Foundation. 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.

#ifndef SHAPE_ESTIMATION__CORRECTOR__CORRECTOR_INTERFACE_HPP_
#define SHAPE_ESTIMATION__CORRECTOR__CORRECTOR_INTERFACE_HPP_

#include <autoware_auto_perception_msgs/msg/shape.hpp>
#include <geometry_msgs/msg/pose.hpp>

#include <string>

class ShapeEstimationCorrectorInterface
{
public:
ShapeEstimationCorrectorInterface() {}

virtual ~ShapeEstimationCorrectorInterface() {}

virtual bool correct(
autoware_auto_perception_msgs::msg::Shape & shape_output,
geometry_msgs::msg::Pose & pose_output) = 0;
};

#endif // SHAPE_ESTIMATION__CORRECTOR__CORRECTOR_INTERFACE_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2018 Autoware Foundation. 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.

#ifndef SHAPE_ESTIMATION__CORRECTOR__NO_CORRECTOR_HPP_
#define SHAPE_ESTIMATION__CORRECTOR__NO_CORRECTOR_HPP_

#include "shape_estimation/corrector/corrector_interface.hpp"
#include "utils.hpp"

class NoCorrector : public ShapeEstimationCorrectorInterface
{
public:
NoCorrector() {}

~NoCorrector() {}

bool correct(
autoware_auto_perception_msgs::msg::Shape & shape_output,
geometry_msgs::msg::Pose & pose_output) override;
};

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

#ifndef SHAPE_ESTIMATION__CORRECTOR__TRUCK_CORRECTOR_HPP_
#define SHAPE_ESTIMATION__CORRECTOR__TRUCK_CORRECTOR_HPP_

#include "shape_estimation/corrector/corrector_interface.hpp"
#include "utils.hpp"

class TruckCorrector : public ShapeEstimationCorrectorInterface
{
private:
utils::CorrectionParameters params_;
bool use_reference_yaw_;

public:
explicit TruckCorrector(bool use_reference_yaw = false) : use_reference_yaw_(use_reference_yaw)
{
params_.min_width = 1.5;
params_.max_width = 2.9;
params_.avg_width = (params_.min_width + params_.max_width) * 0.5;
params_.min_length = 4.0;
params_.max_length = 7.9;
params_.avg_length = (params_.min_length + params_.max_length) * 0.5;
}

~TruckCorrector() = default;

bool correct(
autoware_auto_perception_msgs::msg::Shape & shape_output,
geometry_msgs::msg::Pose & pose_output) override;
};

#endif // SHAPE_ESTIMATION__CORRECTOR__TRUCK_CORRECTOR_HPP_
Loading

0 comments on commit bd4111f

Please sign in to comment.