Skip to content

Commit

Permalink
Merge branch 'main' into sync-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Autumn60 authored Aug 23, 2024
2 parents d69d3e6 + 1859c6a commit cf37c28
Show file tree
Hide file tree
Showing 13 changed files with 405 additions and 7 deletions.
109 changes: 109 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"ignorePaths": [
"**/*.bash",
"**/*.cspell.json",
"**/*.dae",
"**/*.html",
"**/*.mp3",
"**/*.mp4",
"**/*.pcd",
"**/*.rviz",
"**/*.sh",
"**/*.stl",
"**/*.svg",
"**/*.wav",
"**/*.zip",
"**/.git/**",
"**/.gitignore",
"**/.vscode/**",
"**/build/**",
"**/CHANGELOG.rst",
"**/.clang-format",
"**/CPPLINT.cfg",
"**/Doxyfile",
"**/install/**",
"**/log/**",
"**/package-lock.json"
],
"ignoreRegExpList": [
"\\[.*/.*\\]\\(https://github.com",
"Copyright .*[0-9]{4}.+",
"github.com[/:][\\w._\\-]+(/[\\w._\\-]+)?",
"ppa:.+/[^\\s]+",
"@[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}"
],
"overrides": [
{
"filename": "**/*.yaml",
"ignoreRegExpList": ["author: .+$", "git_email: .+$", "git_user: .+$", "uses: .+$"]
},
{
"filename": "**/package.xml",
"ignoreRegExpList": ["<author.*?</author>", "<maintainer.*?</maintainer>"]
},
{
"filename": "**/{*.cpp,*.hpp}",
"ignoreRegExpList": ["@author .*$", "[\\@]tparam", "\\author .*$", "Author(s)?( )?: .*$", "TODO\\((.*?)\\)"]
}
],
"words": [
"ackermann",
"adapi",
"aichallenge",
"autocompute",
"automotiveaichallenge",
"autoware",
"awsim",
"booars",
"buildtool",
"colcon",
"costmap",
"cuda",
"cyclonedds",
"dallara",
"dcmake",
"distro",
"downsample",
"freespace",
"gnss",
"gnucxx",
"gtest",
"initialpose",
"lanechange",
"lanefollowing",
"lanelet",
"lanelets",
"libgazebo",
"libgl",
"linalg",
"lowpass",
"mapfile",
"mathcal",
"mgrs",
"odometry",
"osrf",
"pitstop",
"pointcloud",
"rclcpp",
"rclpy",
"rcutils",
"rgba",
"rois",
"rosdep",
"rosdistro",
"rviz",
"schematypens",
"sideshift",
"srvs",
"stddev",
"traj",
"urdf",
"velodyne",
"wextra",
"wmctrl",
"wpedantic",
"xacro",
"xyzrpy",
"zcvf"
]
}
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
aichallenge/workspace/src/aichallenge_submit/aichallenge_submit_launch/** @booars/aic2024-developers
aichallenge/workspace/src/aichallenge_submit/booars_utils/** @Autumn60
aichallenge/workspace/src/aichallenge_submit/goal_pose_setter/** @hrjp
aichallenge/workspace/src/aichallenge_submit/gyro_odometer/** @booars/aic2024-developers
aichallenge/workspace/src/aichallenge_submit/imu_corrector/** @booars/aic2024-developers
aichallenge/workspace/src/aichallenge_submit/imu_gnss_poser/** @booars/aic2024-developers
aichallenge/workspace/src/aichallenge_submit/path_to_trajectory/** @booars/aic2024-developers
aichallenge/workspace/src/aichallenge_submit/racing_kart_description/** @Autumn60
aichallenge/workspace/src/aichallenge_submit/racing_kart_sensor_kit_description/** @booars/aic2024-developers
aichallenge/workspace/src/aichallenge_submit/simple_pure_pursuit/** @sitahara
aichallenge/workspace/src/aichallenge_system/aichallenge_system_launch/** @booars/aic2024-developers
18 changes: 18 additions & 0 deletions .github/workflows/spell-check-differential.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: spell-check-differential

on:
pull_request:
branches: [main]

jobs:
spell-check-differential:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run spell check
uses: streetsidesoftware/cspell-action@v6
with:
config: .cspell.json
incremental_files_only: true
20 changes: 20 additions & 0 deletions .github/workflows/spell-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: spell-check

on:
push:
branches:
- main
workflow_dispatch:

jobs:
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run spell check
uses: streetsidesoftware/cspell-action@v6
with:
config: .cspell.json
incremental_files_only: false
31 changes: 31 additions & 0 deletions .github/workflows/sync-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: sync-upstream

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
sync-upstream:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run sync-branches
uses: autowarefoundation/autoware-github-actions/sync-branches@v1
with:
token: ${{ steps.generate-token.outputs.token }}
base-branch: main
sync-pr-branch: sync-upstream
sync-target-repository: https://github.com/AutomotiveAIChallenge/aichallenge-2024.git
sync-target-branch: main
pr-title: "chore: sync upstream"
pr-labels: |
bot
sync-upstream
auto-merge-method: merge
47 changes: 47 additions & 0 deletions aichallenge/workspace/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format
Language: Cpp
BasedOnStyle: Google

AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AllowShortFunctionsOnASingleLine: InlineOnly
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: true
IncludeCategories:
# C++ system headers
- Regex: <[a-z_]*>
Priority: 6
CaseSensitive: true
# C system headers
- Regex: <.*\.h>
Priority: 5
CaseSensitive: true
# Boost headers
- Regex: boost/.*
Priority: 4
CaseSensitive: true
# Message headers
- Regex: .*_msgs/.*
Priority: 3
CaseSensitive: true
- Regex: .*_srvs/.*
Priority: 3
CaseSensitive: true
# Other Package headers
- Regex: <.*>
Priority: 2
CaseSensitive: true
# Local package headers
- Regex: '".*"'
Priority: 1
CaseSensitive: true
3 changes: 3 additions & 0 deletions aichallenge/workspace/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/build
/install
/log

.vscode
*.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.5)
project(booars_utils)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
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)
endif()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

include_directories(include)

ament_auto_package()
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2024 Booars
//
// 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 BOOARS_UTILS__ROS__FUNCTION_TIMER_HPP_
#define BOOARS_UTILS__ROS__FUNCTION_TIMER_HPP_

#include <memory>
#include <rclcpp/rclcpp.hpp>
#include <utility>

namespace booars_utils::ros {

class FunctionTimer {
private:
rclcpp::TimerBase::SharedPtr timer_;

public:
using SharedPtr = std::shared_ptr<FunctionTimer>;

static SharedPtr create_function_timer(rclcpp::Node* node,
const double update_rate_hz,
std::function<void()> callback) {
return std::make_shared<FunctionTimer>(node, update_rate_hz, callback);
}

explicit FunctionTimer(rclcpp::Node* node, const double update_rate_hz,
std::function<void()> callback) {
const double dt = 1.0 / update_rate_hz;

auto period = std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::duration<double>(dt));
timer_ = std::make_shared<rclcpp::GenericTimer<decltype(callback)>>(
node->get_clock(), period, std::move(callback),
node->get_node_base_interface()->get_context());
node->get_node_timers_interface()->add_timer(timer_, nullptr);
}
};

} // namespace booars_utils::ros

#endif // BOOARS_UTILS__ROS__FUNCTION_TIMER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>booars_utils</name>
<version>0.1.0</version>
<description>The booars_utils package</description>
<maintainer email="[email protected]">Akiro Harada</maintainer>

<license>Apache 2</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<depend>rclcpp</depend>

<test_depend>ament_lint_auto</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <nav_msgs/msg/odometry.hpp>
#include <optional>
#include <rclcpp/rclcpp.hpp>
#include <visualization_msgs/msg/marker.hpp>
#include <rcl_interfaces/msg/set_parameters_result.hpp>

namespace simple_pure_pursuit {

Expand All @@ -18,6 +20,7 @@ using autoware_auto_planning_msgs::msg::TrajectoryPoint;
using geometry_msgs::msg::Pose;
using geometry_msgs::msg::Twist;
using nav_msgs::msg::Odometry;
using visualization_msgs::msg::Marker;

class SimplePurePursuit : public rclcpp::Node {
public:
Expand All @@ -29,6 +32,7 @@ class SimplePurePursuit : public rclcpp::Node {

// publishers
rclcpp::Publisher<AckermannControlCommand>::SharedPtr pub_cmd_;
rclcpp::Publisher<Marker>::SharedPtr mkr_cmd_;

// timer
rclcpp::TimerBase::SharedPtr timer_;
Expand All @@ -40,17 +44,19 @@ class SimplePurePursuit : public rclcpp::Node {


// pure pursuit parameters
const double wheel_base_;
const double lookahead_gain_;
const double lookahead_min_distance_;
const double speed_proportional_gain_;
const bool use_external_target_vel_;
const double external_target_vel_;
double wheel_base_;
double lookahead_gain_;
double lookahead_min_distance_;
double speed_proportional_gain_;
bool use_external_target_vel_;
double external_target_vel_;
OnSetParametersCallbackHandle::SharedPtr reset_param_handler_;


private:
void onTimer();
bool subscribeMessageAvailable();
rcl_interfaces::msg::SetParametersResult parameter_callback(const std::vector<rclcpp::Parameter> &parameters);
};

} // namespace simple_pure_pursuit
Expand Down
Loading

0 comments on commit cf37c28

Please sign in to comment.