Skip to content
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(radar_static_pointcloud_filter): add radar_static_pointcloud_filter package #2362

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c497749
feat(radar_static_pointcloud_filter): add radar_static_pointcloud_fil…
scepter914 Nov 24, 2022
6405a02
apply pre-commit
scepter914 Nov 24, 2022
2e8f0ba
refactor
scepter914 Nov 24, 2022
2aa1387
use autoware_cmame in CMakeLists.txt
scepter914 Nov 24, 2022
e1f2437
delete transform member variable
scepter914 Nov 24, 2022
a0f29e1
add dependancy
scepter914 Nov 24, 2022
bb7104f
fix transform
scepter914 Nov 24, 2022
88e64af
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 24, 2022
d2abfaf
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 24, 2022
71d59b6
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 25, 2022
fa833d9
add code maintainer
scepter914 Nov 25, 2022
4ac5be2
ci(pre-commit): autofix
pre-commit-ci[bot] Nov 25, 2022
53437ff
fix duration time
scepter914 Nov 25, 2022
40d3d9a
Merge branch 'feat/radar_static_pointcloud_filter' of ssh://github.co…
scepter914 Nov 25, 2022
6fd0875
change duration time
scepter914 Nov 25, 2022
dd5fb71
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 25, 2022
77f602b
Update sensing/radar_static_pointcloud_filter/src/radar_static_pointc…
scepter914 Nov 28, 2022
86fd199
fix from variable renaming
scepter914 Nov 28, 2022
42b3c34
fix function of convert velocity from doppler velocity
scepter914 Nov 28, 2022
093f99b
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 29, 2022
192d606
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 29, 2022
4cdef57
Merge branch 'main' into feat/radar_static_pointcloud_filter
scepter914 Nov 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions sensing/radar_static_pointcloud_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.5)
project(radar_static_pointcloud_filter)

# Dependencies
find_package(autoware_cmake REQUIRED)
autoware_package()

# Targets
ament_auto_add_library(radar_static_pointcloud_filter_node_component SHARED
src/radar_static_pointcloud_filter_node/radar_static_pointcloud_filter_node.cpp
)

rclcpp_components_register_node(radar_static_pointcloud_filter_node_component
PLUGIN "radar_static_pointcloud_filter::RadarStaticPointcloudFilterNode"
EXECUTABLE radar_static_pointcloud_filter_node
)

# Tests
if(BUILD_TESTING)
list(APPEND AMENT_LINT_AUTO_EXCLUDE ament_cmake_uncrustify)

find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

# Package
ament_auto_package(
INSTALL_TO_SHARE
launch
)
36 changes: 36 additions & 0 deletions sensing/radar_static_pointcloud_filter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# radar_static_pointcloud_filter

## radar_static_pointcloud_filter_node

Extract static/dynamic radar pointcloud by using doppler velocity and ego motion.
Calculation cost is O(n). `n` is the number of radar pointcloud.

### Input topics

| Name | Type | Description |
| -------------- | -------------------------- | -------------------------- |
| input/radar | radar_msgs::msg::RadarScan | RadarScan |
| input/odometry | nav_msgs::msg::Odometry | Ego vehicle odometry topic |

### Output topics

| Name | Type | Description |
| ------------------------- | -------------------------- | ------------------------ |
| output/static_radar_scan | radar_msgs::msg::RadarScan | static radar pointcloud |
| output/dynamic_radar_scan | radar_msgs::msg::RadarScan | dynamic radar pointcloud |

### Parameters

| Name | Type | Description |
| ------------------- | ------ | ---------------------------------------------------- |
| doppler_velocity_sd | double | Standard deviation for radar doppler velocity. [m/s] |

### How to launch

```sh
ros2 launch radar_static_pointcloud_filter radar_static_pointcloud_filter.launch
```

### Algorithm

![algorithm](docs/radar_static_pointcloud_filter.drawio.svg)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright 2022 TIER IV, Inc.
//
// 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 RADAR_STATIC_POINTCLOUD_FILTER__RADAR_STATIC_POINTCLOUD_FILTER_NODE_HPP_
#define RADAR_STATIC_POINTCLOUD_FILTER__RADAR_STATIC_POINTCLOUD_FILTER_NODE_HPP_

#include "tier4_autoware_utils/tier4_autoware_utils.hpp"

#include <rclcpp/rclcpp.hpp>

#include <nav_msgs/msg/odometry.hpp>
#include <radar_msgs/msg/radar_scan.hpp>

#include <message_filters/subscriber.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <message_filters/synchronizer.h>

#include <chrono>
#include <memory>
#include <string>
#include <vector>

namespace radar_static_pointcloud_filter
{
using nav_msgs::msg::Odometry;
using radar_msgs::msg::RadarReturn;
using radar_msgs::msg::RadarScan;

class RadarStaticPointcloudFilterNode : public rclcpp::Node
{
public:
explicit RadarStaticPointcloudFilterNode(const rclcpp::NodeOptions & node_options);

struct NodeParam
{
double doppler_velocity_sd{};
};

private:
// Subscriber
message_filters::Subscriber<RadarScan> sub_radar_{};
message_filters::Subscriber<Odometry> sub_odometry_{};
std::shared_ptr<tier4_autoware_utils::TransformListener> transform_listener_;

using SyncPolicy = message_filters::sync_policies::ApproximateTime<RadarScan, Odometry>;
using Sync = message_filters::Synchronizer<SyncPolicy>;
typename std::shared_ptr<Sync> sync_ptr_;

// Data buffer
geometry_msgs::msg::TransformStamped::ConstSharedPtr transform_;

// Callback
void onData(const RadarScan::ConstSharedPtr radar_msg, const Odometry::ConstSharedPtr odom_msg);

// Publisher
rclcpp::Publisher<RadarScan>::SharedPtr pub_static_radar_{};
rclcpp::Publisher<RadarScan>::SharedPtr pub_dynamic_radar_{};

// Parameter Server
OnSetParametersCallbackHandle::SharedPtr set_param_res_;
rcl_interfaces::msg::SetParametersResult onSetParam(
const std::vector<rclcpp::Parameter> & params);

// Parameter
NodeParam node_param_{};

// Function
bool isStaticPointcloud(
const RadarReturn & radar_return, const Odometry::ConstSharedPtr & odom_msg,
geometry_msgs::msg::TransformStamped::ConstSharedPtr transform);
};
} // namespace radar_static_pointcloud_filter

#endif // RADAR_STATIC_POINTCLOUD_FILTER__RADAR_STATIC_POINTCLOUD_FILTER_NODE_HPP_
Loading