Skip to content

Commit

Permalink
Merge pull request #9 from rsasaki0109/feature/ci_humble
Browse files Browse the repository at this point in the history
humble CI
  • Loading branch information
rsasaki0109 authored Nov 28, 2023
2 parents de0d747 + 3b3d634 commit cb61214
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 99 deletions.
46 changes: 15 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,34 @@
name: CI

on: [push, pull_request]

on:
pull_request:
branches:
- devel
jobs:
job1:
name: Build
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
container: ros:humble
steps:
- name: ROS2 Install
run: |
# Ref: https://index.ros.org/doc/ros2/Installation/Dashing/Linux-Install-Debians/
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
sudo apt update && sudo apt install curl gnupg2 lsb-release
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'
sudo apt update
sudo apt install ros-dashing-desktop
source /opt/ros/dashing/setup.bash
- uses: actions/checkout@v2-beta
- uses: actions/checkout@v1
with:
submodules: true
- name: Copy repository
run: |
mkdir -p ~/ros2_ws/src/kalman_filter_localization
cp -rf . ~/ros2_ws/src/kalman_filter_localization
- name: Install dependencies
run: |
source /opt/ros/dashing/setup.bash
sudo apt install -y python-rosdep
sudo rosdep init
rosdep update
source /opt/ros/humble/setup.bash
cd ~/ros2_ws/src
rosdep update
rosdep install -r -y --from-paths . --ignore-src
shell: bash
- name: Build packages
run: |
source /opt/ros/dashing/setup.bash
# Install colcon
# Ref: https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/
sudo apt install python3-colcon-common-extensions
source /opt/ros/humble/setup.bash
apt install python3-colcon-common-extensions
cd ~/ros2_ws
colcon build
source ~/ros2_ws/install/setup.bash
- name: Test packages
run: |
source /opt/ros/dashing/setup.bash
source ~/ros2_ws/install/setup.bash
cd ~/ros2_ws
colcon test
colcon test-result --verbose
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ extern "C" {
#include <tf2/transform_datatypes.h>
#include <tf2/convert.h>
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_eigen/tf2_eigen.hpp>
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_sensor_msgs/tf2_sensor_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
// #include <tf2_sensor_msgs/tf2_sensor_msgs.h>

#include <rclcpp_components/register_node_macro.hpp>

Expand Down
65 changes: 0 additions & 65 deletions src/ekf_localization_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,71 +74,6 @@ EkfLocalizationComponent::EkfLocalizationComponent(const rclcpp::NodeOptions & o
declare_parameter("use_odom", false);
get_parameter("use_odom", use_odom_);

set_on_parameters_set_callback(
[this](const std::vector<rclcpp::Parameter> params)
-> rcl_interfaces::msg::SetParametersResult
{
auto results = std::make_shared<rcl_interfaces::msg::SetParametersResult>();
for (auto param : params) {
if (param.get_name() == "var_imu_w") {
if (var_imu_w_ > 0) {
var_imu_w_ = param.as_double();
results->successful = true;
results->reason = "";
} else {
results->successful = false;
results->reason = "var_imu_w must over 0";
}
}
if (param.get_name() == "var_imu_acc") {
if (var_imu_acc_ > 0) {
var_imu_acc_ = param.as_double();
results->successful = true;
results->reason = "";
} else {
results->successful = false;
results->reason = "var_imu_acc must over 0";
}
}
if (param.get_name() == "var_gnss_xy") {
if (var_gnss_xy_ > 0) {
var_gnss_xy_ = param.as_double();
results->successful = true;
results->reason = "";
} else {
results->successful = false;
results->reason = "var_gnss_xy must over 0";
}
}
if (param.get_name() == "var_gnss_z") {
if (var_gnss_z_ > 0) {
var_gnss_z_ = param.as_double();
results->successful = true;
results->reason = "";
} else {
results->successful = false;
results->reason = "var_gnss_z must over 0";
}
}
if (param.get_name() == "pub_period") {
if (pub_period_ > 0) {
pub_period_ = param.as_int();
results->successful = true;
results->reason = "";
} else {
results->successful = false;
results->reason = "pub_period must over 0";
}
}
}
if (!results->successful) {
results->successful = false;
results->reason = "";
}
return *results;
}
);

ekf_.setVarImuGyro(var_imu_w_);
ekf_.setVarImuAcc(var_imu_acc_);
var_gnss_ << var_gnss_xy_, var_gnss_xy_, var_gnss_z_;
Expand Down

0 comments on commit cb61214

Please sign in to comment.