Skip to content

Commit

Permalink
feat: add autoware auto dependencies (autowarefoundation#185)
Browse files Browse the repository at this point in the history
* Back port .auto control packages (autowarefoundation#571)

* Implement Lateral and Longitudinal Control Muxer

* [autowarefoundation#570] Porting wf_simulator

* [autowarefoundation#1189] Deactivate flaky test in 'trajectory_follower_nodes'

* [autowarefoundation#1189] Fix flacky test in 'trajectory_follower_nodes/latlon_muxer'

* [autowarefoundation#1057] Add osqp_interface package

* [autowarefoundation#1057] Add library code for MPC-based lateral control

* [autowarefoundation#1271] Use std::abs instead of abs

* [autowarefoundation#1057] Implement Lateral Controller for Cargo ODD

* [autowarefoundation#1246] Resolve "Test case names currently use snake_case but should be CamelCase"

* [autowarefoundation#1325] Deactivate flaky smoke test in 'trajectory_follower_nodes'

* [autowarefoundation#1058] Add library code of longitudinal controller

* Fix build error for trajectory follower

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

* Fix build error for trajectory follower nodes

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

* [autowarefoundation#1272] Add AckermannControlCommand support to simple_planning_simulator

* [autowarefoundation#1058] Add Longitudinal Controller node

* [autowarefoundation#1058] Rename velocity_controller -> longitudinal_controller

* [autowarefoundation#1058] Update CMakeLists.txt for the longitudinal_controller_node

* [autowarefoundation#1058] Add smoke test python launch file

* [autowarefoundation#1058] Use LowPassFilter1d from trajectory_follower

* [autowarefoundation#1058] Use autoware_auto_msgs

* [autowarefoundation#1058] Changes for .auto (debug msg tmp fix, common func, tf listener)

* [autowarefoundation#1058] Remove unused parameters

* [autowarefoundation#1058] Fix ros test

* [autowarefoundation#1058] Rm default params from declare_parameters + use autoware types

* [autowarefoundation#1058] Use default param file to setup NodeOptions in the ros test

* [autowarefoundation#1058] Fix docstring

* [autowarefoundation#1058] Replace receiving a Twist with a VehicleKinematicState

* [autowarefoundation#1058] Change class variables format to m_ prefix

* [autowarefoundation#1058] Fix plugin name of LongitudinalController in CMakeLists.txt

* [autowarefoundation#1058] Fix copyright dates

* [autowarefoundation#1058] Reorder includes

* [autowarefoundation#1058] Add some tests (~89% coverage without disabling flaky tests)

* [autowarefoundation#1058] Add more tests (90+% coverage without disabling flaky tests)

* [autowarefoundation#1058] Use Float32MultiArrayDiagnostic message for debug and slope

* [autowarefoundation#1058] Calculate wheel_base value from vehicle parameters

* [autowarefoundation#1058] Cleanup redundant logger setting in tests

* [autowarefoundation#1058] Set ROS_DOMAIN_ID when running tests to prevent CI failures

* [autowarefoundation#1058] Remove TF listener and use published vehicle state instead

* [autowarefoundation#1058] Change smoke tests to use autoware_testing

* [autowarefoundation#1058] Add plotjuggler cfg for both lateral and longitudinal control

* [autowarefoundation#1058] Improve design documents

* [autowarefoundation#1058] Disable flaky test

* [autowarefoundation#1058] Properly transform vehicle state in longitudinal node

* [autowarefoundation#1058] Fix TF buffer of lateral controller

* [autowarefoundation#1058] Tuning of lateral controller for LGSVL

* [autowarefoundation#1058] Fix formating

* [autowarefoundation#1058] Fix /tf_static sub to be transient_local

* [autowarefoundation#1058] Fix yaw recalculation of reverse trajs in the lateral controller

* modify trajectory_follower for galactic build

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

* [autowarefoundation#1379] Update trajectory_follower

* [autowarefoundation#1379] Update simple_planning_simulator

* [autowarefoundation#1379] Update trajectory_follower_nodes

* apply trajectory msg modification in control

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

* move directory

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

* remote control/trajectory_follower level dorectpry

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

* remove .iv trajectory follower

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

* use .auto trajectory_follower

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

* remove .iv simple_planning_simulator & osqp_interface

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

* use .iv simple_planning_simulator & osqp_interface

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

* add tmp_autoware_auto_dependencies

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

* tmporally add autoware_auto_msgs

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

* apply .auto message split

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

* fix build depend

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

* fix packages using osqp

* fix autoware_auto_geometry

* ignore lint of some packages

* ignore ament_lint of some packages

* ignore lint/pre-commit of trajectory_follower_nodes

* disable unit tests of some packages

Co-authored-by: Maxime CLEMENT <maxime.clement@tier4.jp>
Co-authored-by: Joshua Whitley <josh.whitley@autoware.org>
Co-authored-by: Igor Bogoslavskyi <igor.bogoslavskyi@gmail.com>
Co-authored-by: MIURA Yasuyuki <kokosabu@gmail.com>
Co-authored-by: wep21 <border_goldenmarket@yahoo.co.jp>
Co-authored-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* Port parking planner packages from .Auto (autowarefoundation#600)

* Copy code of 'vehicle_constants_manager'

* Fix vehicle_constants_manager for ROS galactic

* Rm .iv costmap_generator freespace_planner freespace_planning_aglorihtms

* Add astar_search (from .Auto)

* Copy freespace_planner from .Auto

* Update freespace_planner for .IV

* Copy costmap_generator from .Auto

* Copy and update had_map_utils from .Auto

* Update costmap_generator

* Copy costmap_generator_nodes

* Update costmap_generator_nodes

* Comment out all tests

* Move vehicle_constant_managers to tmp_autoware_auto_dependencies

* ignore pre-commit for back-ported packages

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

* ignore testing

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

Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* fix: fix pre-commit

* fix: fix markdownlint

* fix: fix cpplint

* feat: remove autoware_auto_dependencies

Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Co-authored-by: Maxime CLEMENT <maxime.clement@tier4.jp>
Co-authored-by: Joshua Whitley <josh.whitley@autoware.org>
Co-authored-by: Igor Bogoslavskyi <igor.bogoslavskyi@gmail.com>
Co-authored-by: MIURA Yasuyuki <kokosabu@gmail.com>
Co-authored-by: wep21 <border_goldenmarket@yahoo.co.jp>
Co-authored-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>
  • Loading branch information
9 people committed Dec 15, 2021
1 parent 921fc4b commit c152f57
Show file tree
Hide file tree
Showing 137 changed files with 22,179 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ repos:
args: [--quiet]
exclude: .cu

exclude: .svg|control/trajectory_follower|control/trajectory_follower_nodes|common/autoware_auto_dependencies|common/autoware_auto_perception_rviz_plugin|common/osqp_interface|simulator/simple_planning_simulator|planning/freespace_planner|planning/astar_search|planning/costmap_generator
exclude: .svg|control/trajectory_follower|control/trajectory_follower_nodes|common/autoware_auto_cmake|common/autoware_auto_common|common/autoware_auto_geometry|common/autoware_auto_tf2|common/autoware_testing|common/fake_test_node|common/had_map_utils|common/motion_common|common/motion_testing|common/time_utils|common/vehicle_constants_manager|common/autoware_auto_perception_rviz_plugin|common/osqp_interface|simulator/simple_planning_simulator|planning/freespace_planner|planning/astar_search|planning/costmap_generator
4 changes: 0 additions & 4 deletions build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ repositories:
type: git
url: https://github.com/tier4/tier4_ament_lint
version: main
common/autoware_auto_dependencies:
type: git
url: https://github.com/tier4/AutowareArchitectureProposal.iv.git
version: only-autoware-auto-dependencies
messages/autoware_auto_msgs:
type: git
url: https://github.com/tier4/autoware_auto_msgs.git
Expand Down
33 changes: 33 additions & 0 deletions common/autoware_auto_cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2018 the Autoware Foundation
#
# 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.
#
# Co-developed by Tier IV, Inc. and Apex.AI, Inc.
cmake_minimum_required(VERSION 3.5)

project(autoware_auto_cmake NONE)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

list(APPEND ${PROJECT_NAME}_CONFIG_EXTRAS
"autoware_auto_cmake-extras.cmake"
)

if(BUILD_TESTING)
ament_lint_cmake(${CMAKE_CURRENT_SOURCE_DIR})
endif()

ament_auto_package(INSTALL_TO_SHARE
cmake
)
16 changes: 16 additions & 0 deletions common/autoware_auto_cmake/autoware_auto_cmake-extras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2018 the Autoware Foundation
# Co-developed by Tier IV, Inc. and Apex.AI, 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.

include("${autoware_auto_cmake_DIR}/autoware_auto_cmake.cmake")
111 changes: 111 additions & 0 deletions common/autoware_auto_cmake/cmake/autoware_auto_cmake.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Copyright 2021 the Autoware Foundation
# Co-developed by Tier IV, Inc. and Apex.AI, 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.

# Set lanuage standard with variables instead of per target so even targets that
# don't use autoware_set_compile_options() have this set when importing
# autoware_auto_cmake via ament_auto_find_build_dependencies()
if(NOT CMAKE_C_STANDARD)
# Default to C11 (rcutils uses C11 thread local storage)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
endif()

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()

# Get user-provided variables
set(DOWNLOAD_ARTIFACTS OFF CACHE BOOL "enable artifact download")

# Clang tidy
if(TIDY_WITH_CLANG)
string(CONCAT CMAKE_CXX_CLANG_TIDY
"clang-tidy;"
"-checks=-*,"
"bugprone-*,"
"cert-*,"
"cppcoreguidelines-*,"
"clang-analyze-*,"
"google-*,"
"hicpp-*,"
"modernize-*,"
"performance-*,"
"readability-*")
endif()

# Try to adhere to strict ISO C++ as much as possible:
# from https://lefticus.gitbooks.io/cpp-best-practices/content/02-Use_the_Tools_Available.html
function(autoware_set_compile_options target)

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
string(TOUPPER ${target} PROJECT_NAME_UPPER)
target_compile_options(${target} PRIVATE "/bigobj")
target_compile_definitions(${target} PRIVATE
${PROJECT_NAME_UPPER}_BUILDING_DLL
-D_CRT_NONSTDC_NO_WARNINGS
-D_CRT_SECURE_NO_WARNINGS
-D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${target} PRIVATE
-Wall
-Werror
-Wextra
#-Wshadow # causes issues with ROS 2 headers
#-Wnon-virtual-dtor # causes issues with ROS 2 headers
-pedantic
-Wcast-align
-Wunused
-Wconversion
-Wsign-conversion
-Wdouble-promotion
-Waddress
#-Wnull-dereference # gcc6
#-Wduplicated-branches # gcc7
#-Wduplicated-cond # gcc6
#-Wrestrict # gcc7
-fvisibility=hidden)
# C++-only options
target_compile_options(${target}
PRIVATE $<$<COMPILE_LANGUAGE:CXX>: -Woverloaded-virtual -Wold-style-cast>)
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(${target}
PUBLIC $<$<COMPILE_LANGUAGE:CXX>: -Wuseless-cast>)
target_compile_options(${target} PRIVATE -Wlogical-op -frecord-gcc-switches)
endif()

endfunction()

# Turn off optimization compiler flags for `target` unless the variable `AUTOWARE_OPTIMIZATION_OF_SLOW_TARGETS` is
# defined and evaluates to `true` in a boolean context.
function(autoware_turn_off_optimization target)

if(AUTOWARE_OPTIMIZATION_OF_SLOW_TARGETS)
# do nothing
else()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${target} PRIVATE -O0)
endif()
endif()

endfunction()
29 changes: 29 additions & 0 deletions common/autoware_auto_cmake/design/autoware_auto_cmake-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
autoware_auto_cmake {#autoware-auto-cmake-design}
===========

This is the design document for the `autoware_auto_cmake` package.


# Purpose

Provide common CMake variables and functions to Autoware packages.

Those include:

- Setting the language standard
- Getting user-provided variables
- Providing functions to:
+ set compiler flags
+ turn off optimizations

# Design

## Usage

Add `autoware_auto_cmake` as a "build_depend" in the dependent packages.

### CMake variables {#cmake-config-variables}

|Name|Type|Descritpion|Default|
|----|----|-----------|-------|
|`DOWNLOAD_ARTIFACTS`|*BOOL*|Allow downloading artifacts at build time.|`OFF`|
29 changes: 29 additions & 0 deletions common/autoware_auto_cmake/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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_auto_cmake</name>
<version>1.0.0</version>
<description>Import the compiler settings defined for Autoware.Auto</description>
<maintainer email="opensource@apex.ai">Apex.AI, Inc.</maintainer>
<license>Apache 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>ament_cmake_lint_cmake</buildtool_depend>

<build_depend>ros_environment</build_depend>

<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
<buildtool_export_depend>ament_cmake_lint_cmake</buildtool_export_depend>
<buildtool_export_depend>ament_cmake_copyright</buildtool_export_depend>
<buildtool_export_depend>ament_cmake_cppcheck</buildtool_export_depend>
<buildtool_export_depend>ament_cmake_cpplint</buildtool_export_depend>
<buildtool_export_depend>ament_cmake_uncrustify</buildtool_export_depend>

<test_depend>ament_cmake_lint_cmake</test_depend>
<!-- <test_depend>ament_lint_auto</test_depend> -->
<!-- <test_depend>ament_lint_common</test_depend> -->

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
75 changes: 75 additions & 0 deletions common/autoware_auto_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2019 the Autoware Foundation
# Co-developed by Tier IV, Inc. and Apex.AI, 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.
#
# Co-developed by Tier IV, Inc. and Apex.AI, Inc.
cmake_minimum_required(VERSION 3.5)

### Export headers
project(autoware_auto_common)

## dependencies
find_package(ament_cmake_auto REQUIRED)
find_package(Eigen3 REQUIRED)
ament_auto_find_build_dependencies()

include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)

# Temporarily disable cpplint and uncrustify
list(APPEND AMENT_LINT_AUTO_EXCLUDE
ament_cmake_cpplint
ament_cmake_uncrustify
)

ament_lint_auto_find_test_dependencies()

file(GLOB_RECURSE FILES_MINUS_SOME
${CMAKE_CURRENT_SOURCE_DIR}/include/*
${CMAKE_CURRENT_SOURCE_DIR}/test/*
)

list(FILTER FILES_MINUS_SOME EXCLUDE REGEX ".*filesystem.hpp")

# Re-enable cpplint
find_package(ament_cmake_cpplint)
ament_cpplint(${FILES_MINUS_SOME})

# Re-enable uncrustify
find_package(ament_cmake_uncrustify)
ament_uncrustify(${FILES_MINUS_SOME})

# Unit tests
set(TEST_COMMON test_common_gtest)
ament_add_gtest(${TEST_COMMON}
test/gtest_main.cpp
test/test_bool_comparisons.cpp
test/test_byte_reader.cpp
test/test_float_comparisons.cpp
test/test_mahalanobis_distance.cpp
test/test_message_field_adapters.cpp
test/test_template_utils.cpp
test/test_angle_utils.cpp
test/test_type_name.cpp
test/test_type_traits.cpp)
autoware_set_compile_options(${TEST_COMMON})
target_compile_options(${TEST_COMMON} PRIVATE -Wno-sign-conversion)
target_include_directories(${TEST_COMMON} PRIVATE include)
ament_target_dependencies(${TEST_COMMON} builtin_interfaces Eigen3)
endif()

# Ament Exporting
ament_auto_package()
66 changes: 66 additions & 0 deletions common/autoware_auto_common/design/comparisons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Comparisons {#helper-comparisons}
===========

The `float_comparisons.hpp` library is a simple set of functions for performing approximate numerical comparisons.
There are separate functions for performing comparisons using absolute bounds and relative bounds. Absolute comparison checks are prefixed with `abs_` and relative checks are prefixed with `rel_`.

The `bool_comparisons.hpp` library additionally contains an XOR operator.

The intent of the library is to improve readability of code and reduce likelihood of typographical errors when using numerical and boolean comparisons.

# Target use cases

The approximate comparisons are intended to be used to check whether two numbers lie within some absolute or relative interval.
The `exclusive_or` function will test whether two values cast to different boolean values.

# Assumptions

* The approximate comparisons all take an `epsilon` parameter.
The value of this parameter must be >= 0.
* The library is only intended to be used with floating point types.
A static assertion will be thrown if the library is used with a non-floating point type.

# Example Usage

```c++
#include "common/bool_comparisons.hpp"
#include "common/float_comparisons.hpp"

#include <iostream>

// using-directive is just for illustration; don't do this in practice
using namespace autoware::common::helper_functions::comparisons;

static constexpr auto epsilon = 0.2;
static constexpr auto relative_epsilon = 0.01;

std::cout << exclusive_or(true, false) << "\n";
// Prints: true

std::cout << rel_eq(1.0, 1.1, relative_epsilon)) << "\n";
// Prints: false

std::cout << approx_eq(10000.0, 10010.0, epsilon, relative_epsilon)) << "\n";
// Prints: true

std::cout << abs_eq(4.0, 4.2, epsilon) << "\n";
// Prints: true

std::cout << abs_ne(4.0, 4.2, epsilon) << "\n";
// Prints: false

std::cout << abs_eq_zero(0.2, epsilon) << "\n";
// Prints: false

std::cout << abs_lt(4.0, 4.25, epsilon) << "\n";
// Prints: true

std::cout << abs_lte(1.0, 1.2, epsilon) << "\n";
// Prints: true

std::cout << abs_gt(1.25, 1.0, epsilon) << "\n";
// Prints: true

std::cout << abs_gte(0.75, 1.0, epsilon) << "\n";
// Prints: false
```
Loading

0 comments on commit c152f57

Please sign in to comment.