Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 6, 2025
1 parent a35886d commit f496f24
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions localization/autoware_localization_util/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# autoware_localization_util

## Overview

`autoware_localization_util` is a collection of localization utility packages. It contains 5 individual libiary that used by autoware localization nodes.

Check warning on line 5 in localization/autoware_localization_util/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (libiary)

- `covariance_ellipse` 2d covariance visualization wrapper.
Expand All @@ -10,21 +11,25 @@
- `util_func` A tool library which contains several function for localization nodes.

## Design

- `covariance_ellipse` Translate `geometry_msgs::msg::PoseWithCovariance` message into ellipse visual marker to demonstrate covariance distribution.
- `diagnostics_module` Manage diagnostics message's content, level and publish timing of localization nodes.
- `smart_pose_buffer` A buffer library which implements pose message buffering, pose interpolate and pose validation.
- `tree_structured_parzen_estimator` A Probability Estimator (AKA TSPE) library that includes estimator and log likelihood ratio calculation.

Check warning on line 18 in localization/autoware_localization_util/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (TSPE)
- `util_func` Tool function collection.

## Usage
### covariance_ellipse

### covariance_ellipse

Include header file to use:

```cpp
#include "autoware/localization_util/covariance_ellipse.hpp"
```

calculate ellipse and visualize

```cpp
autoware::localization_util::Ellipse ellipse_ = autoware::localization_util::calculate_xy_ellipse(input_msg->pose, scale_);

Expand All @@ -35,17 +40,20 @@ autoware::localization_util::Ellipse ellipse_ = autoware::localization_util::cal
### diagnostics_module

Include header file to use:

```cpp
#include "autoware/localization_util/diagnostics_module.hpp"
```

init diagnostics manager

```cpp
std::unique_ptr<autoware::localization_util::DiagnosticsModule> diagnostics_ =
std::make_unique<autoware::localization_util::DiagnosticsModule>(this, "gyro_odometer_status");
```

clean message buffer, add message, set diagnostics message logging level and publish diagnostics message

```cpp
diagnostics_->clear();
diagnostics_->add_key_value(
Expand All @@ -67,6 +75,7 @@ diagnostics_->publish(vehicle_twist_msg_ptr->header.stamp);
### smart_pose_buffer
buffer init
```cpp
#include "autoware/localization_util/smart_pose_buffer.hpp"
Expand All @@ -79,6 +88,7 @@ initial_pose_buffer_ = std::make_unique<SmartPoseBuffer>(
```

interpolate and pop out old pose message

```cpp
std::optional<SmartPoseBuffer::InterpolateResult> interpolation_result_opt =
initial_pose_buffer_->interpolate(sensor_ros_time);
Expand All @@ -91,6 +101,7 @@ interpolation_result_opt.value();
```
clear buffer
```cpp
initial_pose_buffer_->clear();
```
Expand All @@ -111,11 +122,13 @@ param_.initial_pose_estimation.n_startup_trials, sample_mean, sample_stddev);
```
get estimation result
```cpp
const TreeStructuredParzenEstimator::Input input = tpe.get_next_input();
```

add new data to the estimator

```cpp
TreeStructuredParzenEstimator::Input result(6);
result[0] = pose.position.x;
Expand All @@ -130,6 +143,7 @@ tpe.add_trial(TreeStructuredParzenEstimator::Trial{result, ndt_result.transform_
### util_func
include header file to use
```cpp
#include "autoware/localization_util/util_func.hpp"
Expand All @@ -140,6 +154,7 @@ using autoware::localization_util::pose_to_matrix4f;
```

list of usefull function

Check warning on line 156 in localization/autoware_localization_util/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Misspelled word (usefull) Suggestions: (useful*)

```cpp
std_msgs::msg::ColorRGBA exchange_color_crc(double x);
double calc_diff_for_radian(const double lhs_rad, const double rhs_rad);
Expand Down Expand Up @@ -168,4 +183,4 @@ T transform(const T & input, const geometry_msgs::msg::TransformStamped & transf
void output_pose_with_cov_to_log(
const rclcpp::Logger & logger, const std::string & prefix,
const geometry_msgs::msg::PoseWithCovarianceStamped & pose_with_cov);
```
```

0 comments on commit f496f24

Please sign in to comment.