-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arc 63 Add trajectory follower wrapper (#2379)
* add trajectory follower wrapper to launch file * add trajectory follower wrapper pkg * add pkg to sonarqube * fix sonarqube * address comments and add unit test * update unit test * address comments2 * address comments3 * update logic and unit test * fix unit test * address comments * address comments * expose callbacks to enable unit testing * address comments2 * update unit test * add and update unit tests * address pr comments * address PR comments and added documentation * launch fixes
- Loading branch information
1 parent
7c1475f
commit 89474e9
Showing
13 changed files
with
847 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
# Copyright (C) 2024 LEIDOS. | ||
# | ||
# 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. | ||
|
||
cmake_minimum_required(VERSION 3.5) | ||
project(trajectory_follower_wrapper) | ||
|
||
# Declare carma package and check ROS version | ||
find_package(carma_cmake_common REQUIRED) | ||
carma_check_ros_version(2) | ||
carma_package() | ||
|
||
## Find dependencies using ament auto | ||
find_package(ament_cmake_auto REQUIRED) | ||
ament_auto_find_build_dependencies() | ||
|
||
# Name build targets | ||
set(node_exec trajectory_follower_wrapper_node_exec) | ||
set(node_lib trajectory_follower_wrapper_node) | ||
|
||
# Includes | ||
include_directories( | ||
include | ||
) | ||
|
||
# Build | ||
ament_auto_add_library(${node_lib} SHARED | ||
src/trajectory_follower_wrapper_node.cpp | ||
) | ||
|
||
ament_auto_add_executable(${node_exec} | ||
src/main.cpp | ||
) | ||
|
||
# Register component | ||
rclcpp_components_register_nodes(${node_lib} "trajectory_follower_wrapper::TrajectoryFollowerWrapperNode") | ||
|
||
# All locally created targets will need to be manually linked | ||
# ament auto will handle linking of external dependencies | ||
target_link_libraries(${node_exec} | ||
${node_lib} | ||
) | ||
|
||
# Testing | ||
if(BUILD_TESTING) | ||
|
||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() # This populates the ${${PROJECT_NAME}_FOUND_TEST_DEPENDS} variable | ||
|
||
ament_add_gtest(test_trajectory_follower_wrapper test/test_trajectory_follower_wrapper.cpp) | ||
|
||
ament_target_dependencies(test_trajectory_follower_wrapper ${${PROJECT_NAME}_FOUND_TEST_DEPENDS}) | ||
|
||
target_link_libraries(test_trajectory_follower_wrapper ${node_lib}) | ||
|
||
endif() | ||
|
||
# Install | ||
ament_auto_package( | ||
INSTALL_TO_SHARE config launch | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# trajectory_follower_wrapper | ||
|
||
Design Document: https://usdot-carma.atlassian.net/wiki/spaces/CRMPLT/pages/2899312668/Detailed+Design+-+Trajectory+Follower+Wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# acceptable time difference from autoware's control command to still use the command in sec | ||
incoming_cmd_time_threshold: 1.0 |
44 changes: 44 additions & 0 deletions
44
...llower_wrapper/include/trajectory_follower_wrapper/trajectory_follower_wrapper_config.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
|
||
/* | ||
* Copyright (C) 2024 LEIDOS. | ||
* | ||
* 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 <iostream> | ||
|
||
namespace trajectory_follower_wrapper | ||
{ | ||
|
||
/** | ||
* \brief Stuct containing the algorithm configuration values for trajectory_follower_wrapper | ||
*/ | ||
struct TrajectoryFollowerWrapperConfig | ||
{ | ||
double vehicle_response_lag = 0.2; // approximation of the delay (sec) between sent vehicle commands and the vehicle beginning a meaningful acceleration to that command" | ||
double incoming_cmd_time_threshold = 1.0; // acceptable time difference from autoware's contrl command to still use the command in sec | ||
|
||
|
||
// Stream operator for this config | ||
friend std::ostream &operator<<(std::ostream &output, const TrajectoryFollowerWrapperConfig &c) | ||
{ | ||
output << "trajectory_follower_wrapper::TrajectoryFollowerWrapperConfig { " << std::endl | ||
<< "vehicle_response_lag: " << c.vehicle_response_lag << std::endl | ||
<< "incoming_cmd_time_threshold: " << c.incoming_cmd_time_threshold << std::endl | ||
<< "}" << std::endl; | ||
return output; | ||
} | ||
}; | ||
|
||
} // trajectory_follower_wrapper |
Oops, something went wrong.