-
Notifications
You must be signed in to change notification settings - Fork 696
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
feat(mapless_architecture): add mapless_architecture #7709
Closed
simon-eisenmann-driveblocks
wants to merge
25
commits into
autowarefoundation:main
from
simon-eisenmann-driveblocks:main
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c268146
Add nodes
simon-eisenmann-driveblocks 0b6c306
Restructure folder
simon-eisenmann-driveblocks 8b9c504
Change documentation
simon-eisenmann-driveblocks 5e6ca68
Add local mission planner
simon-eisenmann-driveblocks c25cac8
Remove driveblocks dependencies
simon-eisenmann-driveblocks a12fcd7
Rename packages
simon-eisenmann-driveblocks b589b53
Add namespace
simon-eisenmann-driveblocks f94bdc9
Run pre-commit
simon-eisenmann-driveblocks 71f7469
Update launch files
simon-eisenmann-driveblocks 5033efb
Change readme
simon-eisenmann-driveblocks b431760
Specify language
simon-eisenmann-driveblocks 4af9b99
Fix pre-commit issues
simon-eisenmann-driveblocks 4a8b586
Work on documentation
simon-eisenmann-driveblocks b048568
Fix bug
simon-eisenmann-driveblocks 60bff85
Remove driveblocks dependencies
simon-eisenmann-driveblocks c1958e0
Remove node, change readme
simon-eisenmann-driveblocks 55b4e77
Remove local_road_provider
simon-eisenmann-driveblocks 3bb548f
Remove db_msgs
simon-eisenmann-driveblocks 9f9b92e
Move some functions to the library
simon-eisenmann-driveblocks 30048f6
Merge commit
simon-eisenmann-driveblocks 6219caa
Merge commit
simon-eisenmann-driveblocks 1d562b3
5: Local odom adaptions
simon-eisenmann-driveblocks 9e137df
2: Work on requested changes
simon-eisenmann-driveblocks 77749eb
3: Change the license
simon-eisenmann-driveblocks ff9dfd8
6: Check TODOs/FIXMEs
simon-eisenmann-driveblocks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Mission Planner | ||
|
||
The Mission Planner module generates a reference trajectory/path in a local road model based on mission inputs. These inputs are received from the Human Machine Interface (HMI) or another agent. The resulting trajectory or path is then forwarded to the Behavior Planner for further processing. | ||
|
||
A detailed overview can be seen here: | ||
|
||
 | ||
|
||
## Components | ||
|
||
The Mission Planner consists of several components (ROS2 packages) working together: | ||
|
||
- **Local Mission Planner**: Generates target lanes based on the mission input. | ||
- **HMI (Human Machine Interface)**: Provides a user interface for defining missions via terminal input. | ||
- **Converter**: Converts lanes generated by the Mission Planner into Autoware Trajectories/Paths. | ||
- **Local Road Provider**: Converts the LaneletsStamped message into a RoadSegments message. | ||
- **Local Map Provider**: Converts the RoadSegments message into a LocalMap message. | ||
|
||
## Launching the Software | ||
|
||
To launch all nodes of the software: | ||
|
||
```bash | ||
ros2 launch autoware_local_mission_planner mission_planner_compose.launch.py | ||
``` | ||
|
||
To launch a specific node, such as the mission planner: | ||
|
||
```bash | ||
ros2 launch autoware_local_mission_planner mission_planner.launch.py | ||
``` | ||
|
||
## Additional Notes | ||
|
||
During the beta phase, the mission planner will immediately output a straight trajectory with low velocity to move the vehicle into the local road model. Once the vehicle can be located in the local road model, a trajectory following the ego lane will be computed. |
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,57 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(autoware_hmi) | ||
|
||
# Check for compiler | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
# --- FIND DEPENDENCIES --- | ||
find_package(autoware_cmake REQUIRED) | ||
find_package(rclcpp_components REQUIRED) | ||
ament_auto_find_build_dependencies() | ||
autoware_package() | ||
|
||
ament_auto_add_library(${PROJECT_NAME} SHARED | ||
src/hmi_node.cpp | ||
) | ||
|
||
# Register node | ||
rclcpp_components_register_node(${PROJECT_NAME} | ||
PLUGIN "autoware::mapless_architecture::HMINode" | ||
EXECUTABLE ${PROJECT_NAME}_exe | ||
) | ||
|
||
# Specify include directories | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include>) | ||
|
||
# Specify required C and C++ standards | ||
target_compile_features(${PROJECT_NAME} PUBLIC c_std_99 cxx_std_17) | ||
|
||
# Install the target library | ||
install(TARGETS | ||
${PROJECT_NAME} | ||
DESTINATION lib/${PROJECT_NAME}) | ||
|
||
# Install the launch directory | ||
install(DIRECTORY | ||
launch | ||
DESTINATION share/${PROJECT_NAME}) | ||
|
||
# --- SPECIFY TESTS --- | ||
if(BUILD_TESTING) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
find_package(ament_lint_auto REQUIRED) | ||
|
||
ament_auto_add_gtest(${PROJECT_NAME}_tests test/gtest_main.cpp) | ||
|
||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
# Ensure all packages are correctly installed | ||
ament_auto_package( | ||
INSTALL_TO_SHARE | ||
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,29 @@ | ||
# HMI Node | ||
|
||
Creates a mission based on the terminal input (ROS parameter change). | ||
|
||
Available missions: | ||
|
||
- LANE_KEEP | ||
- LANE_CHANGE_LEFT | ||
- LANE_CHANGE_RIGHT | ||
- TAKE_NEXT_EXIT_LEFT | ||
- TAKE_NEXT_EXIT_RIGHT | ||
|
||
Interact with this node by changing the ROS parameters. For a lane change to the right use this command in the terminal: | ||
|
||
```bash | ||
ros2 param set /mission_planner/hmi mission LANE_CHANGE_RIGHT | ||
``` | ||
|
||
## Output topics | ||
|
||
| Name | Type | Description | | ||
| ------------------------- | ------------------------------------ | ----------- | | ||
| `hmi_node/output/mission` | autoware_planning_msgs::msg::Mission | mission | | ||
|
||
## Node parameters | ||
|
||
| Parameter | Type | Description | | ||
| --------- | ------ | ---------------------------------------------- | | ||
| `mission` | string | the mission (LANE_KEEP, LANE_CHANGE_LEFT, ...) | |
65 changes: 65 additions & 0 deletions
65
planning/mapless_architecture/autoware_hmi/include/autoware/hmi/hmi_node.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,65 @@ | ||
// Copyright 2024 driveblocks GmbH, authors: Simon Eisenmann, Thomas Herrmann | ||
// | ||
// 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 AUTOWARE__HMI__HMI_NODE_HPP_ | ||
#define AUTOWARE__HMI__HMI_NODE_HPP_ | ||
|
||
#include "rclcpp/rclcpp.hpp" | ||
|
||
#include "autoware_planning_msgs/msg/mission.hpp" | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace autoware::mapless_architecture | ||
{ | ||
|
||
/** | ||
* Node for HMI. | ||
*/ | ||
class HMINode : public rclcpp::Node | ||
{ | ||
public: | ||
/** | ||
* @brief Constructor for the HMINode class. | ||
* Initializes the publisher and subscriber with appropriate topics and QoS | ||
* settings. | ||
*/ | ||
explicit HMINode(const rclcpp::NodeOptions & options); | ||
|
||
private: | ||
/** | ||
* @brief Callback function for parameter changes. | ||
* This callback function is triggered whenever a ROS 2 parameter is changed. | ||
* @param parameters The received parameter changes. | ||
*/ | ||
rcl_interfaces::msg::SetParametersResult ParamCallback_( | ||
const std::vector<rclcpp::Parameter> & parameters); | ||
|
||
/** | ||
* @brief Function which publishes the mission. | ||
* | ||
* @param mission The mission that should be published. | ||
*/ | ||
void PublishMission_(std::string mission); | ||
|
||
// Declare ROS2 publisher and subscriber | ||
|
||
rclcpp::Publisher<autoware_planning_msgs::msg::Mission>::SharedPtr mission_publisher_; | ||
|
||
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr param_callback_handle_; | ||
}; | ||
} // namespace autoware::mapless_architecture | ||
|
||
#endif // AUTOWARE__HMI__HMI_NODE_HPP_ |
35 changes: 35 additions & 0 deletions
35
planning/mapless_architecture/autoware_hmi/launch/hmi.launch.py
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,35 @@ | ||
# Copyright 2024 driveblocks GmbH, authors: Simon Eisenmann, Thomas Herrmann | ||
# | ||
# 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. | ||
|
||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
return LaunchDescription( | ||
[ | ||
# hmi executable | ||
Node( | ||
package="autoware_hmi", | ||
executable="autoware_hmi_exe", | ||
name="autoware_hmi", | ||
namespace="mapless_architecture", | ||
remappings=[ | ||
("hmi_node/output/mission", "hmi_node/output/mission"), | ||
], | ||
parameters=[], | ||
output="screen", | ||
), | ||
] | ||
) |
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,24 @@ | ||
<?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_hmi</name> | ||
<version>0.0.1</version> | ||
<description>HMI</description> | ||
<maintainer email="simon.eisenmann@driveblocks.ai">driveblocks</maintainer> | ||
<license>driveblocks proprietary license</license> | ||
|
||
<buildtool_depend>autoware_cmake</buildtool_depend> | ||
|
||
<exec_depend>ros2launch</exec_depend> | ||
|
||
<depend>autoware_planning_msgs</depend> | ||
<depend>rclcpp</depend> | ||
<depend>rclcpp_components</depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>autoware_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
95 changes: 95 additions & 0 deletions
95
planning/mapless_architecture/autoware_hmi/src/hmi_node.cpp
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,95 @@ | ||
// Copyright 2024 driveblocks GmbH, authors: Simon Eisenmann, Thomas Herrmann | ||
// | ||
// 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/hmi/hmi_node.hpp" | ||
|
||
#include "rclcpp/rclcpp.hpp" | ||
|
||
#include "autoware_planning_msgs/msg/mission.hpp" | ||
|
||
namespace autoware::mapless_architecture | ||
{ | ||
using std::placeholders::_1; | ||
|
||
HMINode::HMINode(const rclcpp::NodeOptions & options) : Node("hmi_node", options) | ||
{ | ||
// Set quality of service to best effort (if transmission fails, do not try to | ||
// resend but rather use new sensor data) | ||
// the history_depth is set to 1 (message queue size) | ||
auto qos = rclcpp::QoS(1); | ||
qos.best_effort(); | ||
|
||
// Declare parameter | ||
this->declare_parameter("mission", "LANE_KEEP"); | ||
|
||
// Initialize publisher | ||
mission_publisher_ = | ||
this->create_publisher<autoware_planning_msgs::msg::Mission>("hmi_node/output/mission", 1); | ||
|
||
// Initialize parameters callback handle | ||
param_callback_handle_ = this->add_on_set_parameters_callback( | ||
std::bind(&HMINode::ParamCallback_, this, std::placeholders::_1)); | ||
} | ||
|
||
rcl_interfaces::msg::SetParametersResult HMINode::ParamCallback_( | ||
const std::vector<rclcpp::Parameter> & parameters) | ||
{ | ||
// Initialize output | ||
rcl_interfaces::msg::SetParametersResult result; | ||
|
||
result.successful = false; | ||
result.reason = ""; | ||
std::string mission; | ||
for (const auto & param : parameters) { | ||
if (param.get_name() == "mission") { | ||
if (param.get_type() == rclcpp::ParameterType::PARAMETER_STRING) { | ||
mission = param.as_string(); | ||
|
||
// Publish mission | ||
PublishMission_(mission); | ||
|
||
result.successful = true; | ||
} else { | ||
result.reason = "Incorrect Type"; | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
void HMINode::PublishMission_(std::string mission) | ||
{ | ||
autoware_planning_msgs::msg::Mission missionMessage; | ||
if (mission == "LANE_KEEP") { | ||
missionMessage.mission_type = autoware_planning_msgs::msg::Mission::LANE_KEEP; | ||
} else if (mission == "LANE_CHANGE_LEFT") { | ||
missionMessage.mission_type = autoware_planning_msgs::msg::Mission::LANE_CHANGE_LEFT; | ||
} else if (mission == "LANE_CHANGE_RIGHT") { | ||
missionMessage.mission_type = autoware_planning_msgs::msg::Mission::LANE_CHANGE_RIGHT; | ||
} else if (mission == "TAKE_NEXT_EXIT_LEFT") { | ||
missionMessage.mission_type = autoware_planning_msgs::msg::Mission::TAKE_NEXT_EXIT_LEFT; | ||
} else if (mission == "TAKE_NEXT_EXIT_RIGHT") { | ||
missionMessage.mission_type = autoware_planning_msgs::msg::Mission::TAKE_NEXT_EXIT_RIGHT; | ||
} | ||
|
||
missionMessage.deadline = 1000; // This parameter can be changed if needed (it will be set by the | ||
// software in the future). | ||
|
||
mission_publisher_->publish(missionMessage); | ||
} | ||
} // namespace autoware::mapless_architecture | ||
|
||
#include "rclcpp_components/register_node_macro.hpp" | ||
|
||
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::mapless_architecture::HMINode) |
21 changes: 21 additions & 0 deletions
21
planning/mapless_architecture/autoware_hmi/test/gtest_main.cpp
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,21 @@ | ||
// Copyright 2024 driveblocks GmbH, authors: Simon Eisenmann, Thomas Herrmann | ||
// | ||
// 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 "gtest/gtest.h" | ||
|
||
int main(int argc, char ** argv) | ||
{ | ||
testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add links to each subpackages under the
Local Mission Planner
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!