Skip to content

Commit

Permalink
ci(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed May 18, 2022
1 parent 93555bc commit 784e800
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion evaluator/kinematic_evaluator/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Kinematic Evaluator

TBD
TBD
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class KinematicEvaluatorNode : public rclcpp::Node
std::vector<Metric> metrics_;
std::deque<rclcpp::Time> stamps_;
std::array<std::deque<Stat<double>>, static_cast<size_t>(Metric::SIZE)> metric_stats_;
std::unordered_map< Metric, Stat<double> > metrics_dict_;
std::unordered_map<Metric, Stat<double>> metrics_dict_;
};
} // namespace kinematic_diagnostics

#endif // KINEMATIC_EVALUATOR__MOTION_EVALUATOR_NODE_HPP_
#endif // KINEMATIC_EVALUATOR__KINEMATIC_EVALUATOR_NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using nav_msgs::msg::Odometry;

/**
* @brief calculate velocity deviation of the given trajectory from the reference trajectory
* @param [in] value new value
* @param [in] value new value
* @param [in] stat_prev input trajectory
* @return calculated statistics
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ enum class Metric {
};

static const std::unordered_map<std::string, Metric> str_to_metric = {
{"velocity_stats", Metric::velocity_stats}
};
{"velocity_stats", Metric::velocity_stats}};
static const std::unordered_map<Metric, std::string> metric_to_str = {
{Metric::velocity_stats, "velocity_stats"}
};
{Metric::velocity_stats, "velocity_stats"}};

// Metrics descriptions
static const std::unordered_map<Metric, std::string> metric_descriptions = {
{Metric::velocity_stats, "velocity_stats[m/s]"}
};
{Metric::velocity_stats, "velocity_stats[m/s]"}};

namespace details
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace kinematic_diagnostics
struct Parameters
{
std::array<bool, static_cast<size_t>(Metric::SIZE)> metrics{}; // default values to false
}; // struct Parameters
}; // struct Parameters

} // namespace kinematic_diagnostics

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<arg name="input/twist" default="/kinematic/kinematic_state"/>

<node name="kinematic_evaluator" exec="kinematic_evaluator" pkg="kinematic_evaluator" output="screen">
<param from="$(find-pkg-share kinematic_evaluator)/param/kinematic_evaluator.defaults.yaml"/>
<remap from="~/input/twist" to="$(var input/twist)"/>
Expand Down
2 changes: 1 addition & 1 deletion evaluator/kinematic_evaluator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<depend>tf2</depend>
<depend>tf2_ros</depend>
<depend>tier4_autoware_utils</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class EvalTest : public ::testing::Test
tf_broadcaster_ = std::make_unique<tf2_ros::TransformBroadcaster>(dummy_node);
}

~EvalTest() override { /*rclcpp::shutdown();*/ }
~EvalTest() override
{ /*rclcpp::shutdown();*/
}

void setTargetMetric(kinematic_diagnostics::Metric metric)
{
Expand Down
2 changes: 1 addition & 1 deletion evaluator/localization_evaluator/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Localization Evaluator

TBD
TBD
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ class LocalizationEvaluatorNode : public rclcpp::Node
};
} // namespace localization_diagnostics

#endif // LOCALIZATION_EVALUATOR__MOTION_EVALUATOR_NODE_HPP_
#endif // LOCALIZATION_EVALUATOR__LOCALIZATION_EVALUATOR_NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ enum class Metric {
};

static const std::unordered_map<std::string, Metric> str_to_metric = {
{"lateral_error", Metric::lateral_error},
{"absolute_error", Metric::absolute_error}
};
{"lateral_error", Metric::lateral_error}, {"absolute_error", Metric::absolute_error}};
static const std::unordered_map<Metric, std::string> metric_to_str = {
{Metric::lateral_error, "lateral_error"},
{Metric::absolute_error, "absolute_error"}
};
{Metric::lateral_error, "lateral_error"}, {Metric::absolute_error, "absolute_error"}};

// Metrics descriptions
static const std::unordered_map<Metric, std::string> metric_descriptions = {
{Metric::lateral_error, "lateral error [m]"},
{Metric::absolute_error, "absolute error [m]"}
};
{Metric::lateral_error, "lateral error [m]"}, {Metric::absolute_error, "absolute error [m]"}};

namespace details
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace localization_diagnostics
struct Parameters
{
std::array<bool, static_cast<size_t>(Metric::SIZE)> metrics{}; // default values to false
}; // struct Parameters
}; // struct Parameters

} // namespace localization_diagnostics

Expand Down
2 changes: 1 addition & 1 deletion evaluator/localization_evaluator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<depend>tf2</depend>
<depend>tf2_ros</depend>
<depend>tier4_autoware_utils</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Stat<double> MetricsCalculator::updateStat(
{
switch (metric) {
case Metric::lateral_error:
// TODO: remove dummy + 1 with actual ground truth
// TODO: remove dummy + 1 with actual ground truth
return metrics::updateLateralStats(pos.x, pos_gt.x + 1, stat_prev);
case Metric::absolute_error:
return metrics::updateAbsoluteStats(pos, pos_gt, stat_prev);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class EvalTest : public ::testing::Test
tf_broadcaster_ = std::make_unique<tf2_ros::TransformBroadcaster>(dummy_node);
}

~EvalTest() override { /*rclcpp::shutdown();*/ }
~EvalTest() override
{ /*rclcpp::shutdown();*/
}

void setTargetMetric(localization_diagnostics::Metric metric)
{
Expand Down

0 comments on commit 784e800

Please sign in to comment.