diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 19b846b6a..5a64a48e2 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -15,13 +15,13 @@ jobs: || fromJSON('[ "ubuntu-latest" ]') }} timeout-minutes: 30 - container: ghcr.io/ibis-ssl/crane:base + container: ros:${{ matrix.rosdistro }} env: DEBIAN_FRONTEND: noninteractive strategy: fail-fast: false matrix: - rosdistro: [humble] + rosdistro: [humble, jazzy] steps: - name: suppress warnings run: | @@ -52,6 +52,11 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install wget + run: | + sudo apt-get update + sudo apt-get install -y wget libcpprest-dev + - name: Clone dependency packages run: | mkdir -p dependency_ws @@ -76,7 +81,6 @@ jobs: run: | . /opt/ros/${{ matrix.rosdistro }}/setup.sh colcon build --event-handlers console_cohesion+ \ - --packages-above-and-dependencies ${{ steps.get-modified-packages.outputs.modified-packages }} \ --cmake-args -DCMAKE_BUILD_TYPE=Release \ --mixin coverage-gcc coverage-pytest compile-commands shell: bash diff --git a/.github/workflows/custom_dict.json b/.github/workflows/custom_dict.json index 451ef1d5d..2b4c7acc8 100644 --- a/.github/workflows/custom_dict.json +++ b/.github/workflows/custom_dict.json @@ -6,7 +6,6 @@ "robocupssl", "teleop", "inplay", - "liborocos", "matplotlibcpp", "DPPS", "consai", diff --git a/crane_gui/AMENT_IGNORE b/crane_gui/AMENT_IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/crane_local_planner/CMakeLists.txt b/crane_local_planner/CMakeLists.txt index b74b25048..e70a0dc8c 100755 --- a/crane_local_planner/CMakeLists.txt +++ b/crane_local_planner/CMakeLists.txt @@ -18,7 +18,10 @@ find_package(rclcpp_components REQUIRED) find_package(backward_ros REQUIRED) ament_auto_find_build_dependencies() -ament_auto_add_library(${PROJECT_NAME}_component SHARED DIRECTORY src) +ament_auto_add_library(${PROJECT_NAME}_component SHARED + src/rvo2_planner.cpp + src/crane_local_planner.cpp +) target_precompile_headers(${PROJECT_NAME}_component PUBLIC @@ -37,7 +40,7 @@ ament_auto_add_executable(${PROJECT_NAME}_node src/${PROJECT_NAME}_node.cpp ) -include(/opt/ros/humble/share/backward_ros/cmake/BackwardConfig.cmake) +include(/opt/ros/$ENV{ROS_DISTRO}/share/backward_ros/cmake/BackwardConfig.cmake) add_backward(${PROJECT_NAME}_node) if(BUILD_TESTING) diff --git a/crane_local_planner/include/crane_local_planner/local_planner.hpp b/crane_local_planner/include/crane_local_planner/local_planner.hpp index a4299fcad..7f9b7b635 100644 --- a/crane_local_planner/include/crane_local_planner/local_planner.hpp +++ b/crane_local_planner/include/crane_local_planner/local_planner.hpp @@ -11,12 +11,12 @@ #include #include #include -#include +// #include #include #include #include -#include "gridmap_planner.hpp" +// #include "gridmap_planner.hpp" #include "rvo2_planner.hpp" #include "simple_planner.hpp" #include "visibility_control.h" @@ -37,15 +37,16 @@ class LocalPlannerComponent : public rclcpp::Node explicit LocalPlannerComponent(const rclcpp::NodeOptions & options) : rclcpp::Node("local_planner", options) { - declare_parameter("planner", "gridmap"); + declare_parameter("planner", "rvo2"); auto planner_str = get_parameter("planner").as_string(); crane::ConsaiVisualizerBuffer::activate(*this); process_time_pub = create_publisher("process_time", 10); - if (planner_str == "gridmap") { - planner = std::make_shared(*this); - } else if (planner_str == "simple") { + // if (planner_str == "gridmap") { + // planner = std::make_shared(*this); + // } + if (planner_str == "simple") { planner = std::make_shared(*this); } else if (planner_str == "rvo2") { planner = std::make_shared(*this); diff --git a/crane_local_planner/package.xml b/crane_local_planner/package.xml index 582a852f2..b248c279f 100755 --- a/crane_local_planner/package.xml +++ b/crane_local_planner/package.xml @@ -14,12 +14,12 @@ consai_visualizer_msgs crane_msg_wrappers crane_msgs - grid_map_core - grid_map_ros rclcpp rclcpp_components rvo2_vendor std_msgs + + ament_lint_auto crane_lint_common diff --git a/dependency_jazzy.repos b/dependency_jazzy.repos index 7c49a53e3..1a27dc7cd 100644 --- a/dependency_jazzy.repos +++ b/dependency_jazzy.repos @@ -7,19 +7,3 @@ repositories: type: git url: https://github.com/HansRobo/speak_ros_voicevox_plugin.git version: main - grid_map: - type: git - url: https://github.com/ANYbotics/grid_map.git - version: humble - navigation2: - type: git - url: https://github.com/open-navigation/navigation2.git - version: main - gazebo_ros_pkgs: - type: git - url: https://github.com/ros-simulation/gazebo_ros_pkgs.git - version: ros2 - slam_toolbox: - type: git - url: https://github.com/SteveMacenski/slam_toolbox.git - version: ros2 diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 0c84bc79d..83fcf9fd2 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -9,11 +9,7 @@ WORKDIR $ROS_OVERLAY/src COPY . crane RUN apt-get update && \ - apt-get install -y wget ccache python3-pip ffmpeg&& \ - wget https://launchpad.net/ubuntu/+archive/primary/+files/liborocos-bfl0.8_0.8.0-6_amd64.deb && \ - wget https://launchpad.net/ubuntu/+archive/primary/+files/liborocos-bfl-dev_0.8.0-6_amd64.deb && \ - apt-get install -y ./liborocos-bfl0.8_0.8.0-6_amd64.deb && \ - apt-get install -y ./liborocos-bfl-dev_0.8.0-6_amd64.deb + apt-get install -y wget ccache python3-pip ffmpeg RUN wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz && \ tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz && \ diff --git a/utility/crane_lint_common/package.xml b/utility/crane_lint_common/package.xml index 345ac8ad6..3e7c632d0 100644 --- a/utility/crane_lint_common/package.xml +++ b/utility/crane_lint_common/package.xml @@ -9,7 +9,7 @@ ament_cmake - ament_cmake_clang_format + ament_cmake_copyright ament_cmake_xmllint diff --git a/utility/crane_msg_wrappers/include/crane_msg_wrappers/geometry_wrapper.hpp b/utility/crane_msg_wrappers/include/crane_msg_wrappers/geometry_wrapper.hpp index 956ba70a9..cf505c7c7 100644 --- a/utility/crane_msg_wrappers/include/crane_msg_wrappers/geometry_wrapper.hpp +++ b/utility/crane_msg_wrappers/include/crane_msg_wrappers/geometry_wrapper.hpp @@ -7,8 +7,6 @@ #ifndef CRANE_MSG_WRAPPERS__GEOMETRY_WRAPPER_HPP_ #define CRANE_MSG_WRAPPERS__GEOMETRY_WRAPPER_HPP_ -#include - #include #include #include @@ -34,7 +32,6 @@ class Pose explicit Pose(geometry_msgs::msg::Pose pose); explicit Pose(geometry_msgs::msg::Pose2D pose); - MatrixWrapper::ColumnVector toColumnVector(); geometry_msgs::msg::Pose toROSPose(); geometry_msgs::msg::Pose2D toROSPose2D(); geometry2d::Pose transpose(geometry2d::Pose pose); @@ -66,8 +63,6 @@ class Accel Accel(); Accel(float x, float y, float theta); explicit Accel(geometry_msgs::msg::Accel accel); - - MatrixWrapper::ColumnVector toColumnVector(); }; class Point diff --git a/utility/crane_msg_wrappers/package.xml b/utility/crane_msg_wrappers/package.xml index 07aa42d3c..e462c8819 100755 --- a/utility/crane_msg_wrappers/package.xml +++ b/utility/crane_msg_wrappers/package.xml @@ -15,8 +15,6 @@ crane_msgs eigen geometry_msgs - liborocos-bfl - liborocos-bfl-dev nav_msgs range-v3 rclcpp diff --git a/utility/crane_msg_wrappers/src/geometry_wrapper.cpp b/utility/crane_msg_wrappers/src/geometry_wrapper.cpp index 601161966..240179f7d 100644 --- a/utility/crane_msg_wrappers/src/geometry_wrapper.cpp +++ b/utility/crane_msg_wrappers/src/geometry_wrapper.cpp @@ -47,17 +47,6 @@ Pose::Pose(geometry_msgs::msg::Pose2D pose) this->theta = pi2pi(this->theta); } -MatrixWrapper::ColumnVector Pose::toColumnVector() -{ - MatrixWrapper::ColumnVector column_vector(3); - - column_vector(1) = this->x; - column_vector(2) = this->y; - column_vector(3) = this->theta; - - return column_vector; -} - geometry_msgs::msg::Pose Pose::toROSPose() { geometry_msgs::msg::Pose msg; @@ -165,17 +154,6 @@ Accel::Accel(geometry_msgs::msg::Accel accel) this->theta = accel.angular.z; } -MatrixWrapper::ColumnVector Accel::toColumnVector() -{ - MatrixWrapper::ColumnVector column_vector(3); - - column_vector(1) = this->x; - column_vector(2) = this->y; - column_vector(3) = this->theta; - - return column_vector; -} - Odometry::Odometry() {} Odometry::Odometry(Pose pose, Velocity velocity) diff --git a/utility/gridmap_to_image/.clang-format b/utility/gridmap_to_image/.clang-format deleted file mode 100755 index 1db9fb9f5..000000000 --- a/utility/gridmap_to_image/.clang-format +++ /dev/null @@ -1,17 +0,0 @@ -Language: Cpp -BasedOnStyle: Google - -AccessModifierOffset: -2 -AlignAfterOpenBracket: AlwaysBreak -BraceWrapping: - AfterClass: true - AfterFunction: true - AfterNamespace: true - AfterStruct: true -BreakBeforeBraces: Custom -ColumnLimit: 100 -ConstructorInitializerIndentWidth: 0 -ContinuationIndentWidth: 2 -DerivePointerAlignment: false -PointerAlignment: Middle -ReflowComments: false diff --git a/utility/gridmap_to_image/CMakeLists.txt b/utility/gridmap_to_image/CMakeLists.txt deleted file mode 100755 index 6301e3790..000000000 --- a/utility/gridmap_to_image/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(gridmap_to_image) - -# Default to C++20 -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 20) -endif() - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic -g) -endif() - -# find dependencies -find_package(ament_cmake_auto REQUIRED) -ament_auto_find_build_dependencies() - -ament_auto_add_executable(${PROJECT_NAME}_node src/${PROJECT_NAME}_node.cpp) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - ament_lint_auto_find_test_dependencies() -endif() - -ament_auto_package() diff --git a/utility/gridmap_to_image/package.xml b/utility/gridmap_to_image/package.xml deleted file mode 100755 index af15384cb..000000000 --- a/utility/gridmap_to_image/package.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - gridmap_to_image - 0.0.0 - TODO: Package description - ibis - TODO: License declaration - - ament_cmake_auto - - grid_map_core - grid_map_cv - grid_map_ros - rclcpp - sensor_msgs - - ament_lint_auto - crane_lint_common - - - ament_cmake - - diff --git a/utility/gridmap_to_image/src/gridmap_to_image_node.cpp b/utility/gridmap_to_image/src/gridmap_to_image_node.cpp deleted file mode 100644 index 577c4ae18..000000000 --- a/utility/gridmap_to_image/src/gridmap_to_image_node.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2024 ibis-ssl -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT. - -#include - -#include -#include -#include -#include - -class GridMapToImageNode : public rclcpp::Node -{ -public: - GridMapToImageNode() : Node("grid_map_to_image_node") - { - // grid_mapの購読 - grid_map_sub_ = this->create_subscription( - "/local_planner/grid_map", 10, - std::bind(&GridMapToImageNode::gridMapCallback, this, std::placeholders::_1)); - } - -private: - void gridMapCallback(const grid_map_msgs::msg::GridMap::SharedPtr msg) - { - grid_map::GridMap map; - grid_map::GridMapRosConverter::fromMessage(*msg, map); - - // GridMap内の全てのレイヤーを取得 - for (const auto & layer : map.getLayers()) { - // GridMapをcv::Matに変換 - cv::Mat image; - grid_map::GridMapCvConverter::toImage(map, layer, CV_8UC1, 0.0, 1.0, image); - - // cv::Matをsensor_msgs/Imageに変換 - auto image_msg = cv_bridge::CvImage(std_msgs::msg::Header(), "mono8", image).toImageMsg(); - image_msg->header.stamp = this->get_clock()->now(); - - // トピック名をレイヤー名に基づいて生成し、「/」を「_」に置換 - std::string topic_name = "grid_map_image_" + layer; - std::replace(topic_name.begin(), topic_name.end(), '/', '_'); - - // 該当トピックのパブリッシャーが存在しない場合は作成 - image_pubs_.try_emplace( - topic_name, this->create_publisher(topic_name, 10)); - - // Imageメッセージの発行 - image_pubs_[topic_name]->publish(*image_msg); - } - } - - rclcpp::Subscription::SharedPtr grid_map_sub_; - std::unordered_map::SharedPtr> - image_pubs_; -}; - -int main(int argc, char ** argv) -{ - rclcpp::init(argc, argv); - rclcpp::spin(std::make_shared()); - rclcpp::shutdown(); - return 0; -}