Skip to content

Commit

Permalink
fix(yabloc): suppress no viable conversion error (#7299)
Browse files Browse the repository at this point in the history
* use tier4_autoware_utils instead of yabloc::Color

Signed-off-by: Kento Yabuuchi <[email protected]>

* use static_cast to convert Color to RGBA

Signed-off-by: Kento Yabuuchi <[email protected]>

* use tier4_autoware_utils instead of yabloc::Color

Signed-off-by: Kento Yabuuchi <[email protected]>

* use static_cast to convert Color to RGBA

Signed-off-by: Kento Yabuuchi <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: Kento Yabuuchi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and KhalilSelyan committed Jul 22, 2024
1 parent b8f3f62 commit ee3d588
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions localization/yabloc/yabloc_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<depend>sophus</depend>
<depend>std_msgs</depend>
<depend>tf2_ros</depend>
<depend>tier4_autoware_utils</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "yabloc_common/ll2_decomposer/ll2_decomposer.hpp"

#include <lanelet2_extension/utility/message_conversion.hpp>
#include <yabloc_common/color.hpp>
#include <tier4_autoware_utils/ros/marker_helper.hpp>
#include <yabloc_common/pub_sub.hpp>

#include <geometry_msgs/msg/polygon.hpp>
Expand Down Expand Up @@ -198,7 +198,7 @@ Ll2Decomposer::MarkerArray Ll2Decomposer::make_sign_marker_msg(
marker.header.frame_id = "map";
marker.header.stamp = get_clock()->now();
marker.type = Marker::LINE_STRIP;
marker.color = common::Color(0.6f, 0.6f, 0.6f, 0.999f);
marker.color = tier4_autoware_utils::createMarkerColor(0.6f, 0.6f, 0.6f, 0.999f);
marker.scale.x = 0.1;
marker.ns = ns;
marker.id = id++;
Expand Down Expand Up @@ -228,7 +228,7 @@ Ll2Decomposer::MarkerArray Ll2Decomposer::make_polygon_marker_msg(
marker.header.frame_id = "map";
marker.header.stamp = get_clock()->now();
marker.type = Marker::LINE_STRIP;
marker.color = common::Color(0.4f, 0.4f, 0.8f, 0.999f);
marker.color = tier4_autoware_utils::createMarkerColor(0.4f, 0.4f, 0.8f, 0.999f);
marker.scale.x = 0.2;
marker.ns = ns;
marker.id = id++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ class ParticleVisualize : public rclcpp::Node
marker.scale.y = 0.1;
marker.scale.z = 0.1;

marker.color = common::color_scale::rainbow(bound_weight(p.weight));
marker.color =
static_cast<std_msgs::msg::ColorRGBA>(common::color_scale::rainbow(bound_weight(p.weight)));
marker.pose.orientation = p.pose.orientation;
marker.pose.position.x = p.pose.position.x;
marker.pose.position.y = p.pose.position.y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ void ParticleVisualizer::publish(const ParticleArray & msg)
marker.scale.x = 0.3;
marker.scale.y = 0.1;
marker.scale.z = 0.1;
marker.color = common::color_scale::rainbow(boundWeight(p.weight));
marker.color =
static_cast<std_msgs::msg::ColorRGBA>(common::color_scale::rainbow(boundWeight(p.weight)));
marker.pose.orientation = p.pose.orientation;
marker.pose.position.x = p.pose.position.x;
marker.pose.position.y = p.pose.position.y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void GnssParticleCorrector::publish_marker(const Eigen::Vector3f & position, boo
marker.pose.position.z = latest_height_.data;

float prob = i / 4.0f;
marker.color = common::color_scale::rainbow(prob);
marker.color = static_cast<std_msgs::msg::ColorRGBA>(common::color_scale::rainbow(prob));
marker.color.a = 0.5f;
marker.scale.x = 0.1;
drawCircle(marker.points, weight_manager_.inverse_normal_pdf(prob, is_rtk_fixed));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <opencv4/opencv2/highgui.hpp>
#include <opencv4/opencv2/imgproc.hpp>
#include <yabloc_common/color.hpp>
#include <tier4_autoware_utils/ros/marker_helper.hpp>

#include <boost/geometry/geometry.hpp>

Expand Down Expand Up @@ -169,7 +169,7 @@ HierarchicalCostMap::MarkerArray HierarchicalCostMap::show_map_range() const
marker.header.frame_id = "map";
marker.id = id++;
marker.type = Marker::LINE_STRIP;
marker.color = common::Color(0, 0, 1.0f, 1.0f);
marker.color = tier4_autoware_utils::createMarkerColor(0, 0, 1.0f, 1.0f);
marker.scale.x = 0.1;
Eigen::Vector2f xy = area.real_scale();
marker.points.push_back(point_msg(xy.x(), xy.y()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void MarkerModule::publish_marker(
marker.type = Marker::ARROW;
marker.id = i;
marker.ns = "arrow";
marker.color = common::color_scale::rainbow(normalize(scores.at(i)));
marker.color =
static_cast<std_msgs::msg::ColorRGBA>(common::color_scale::rainbow(normalize(scores.at(i))));
marker.color.a = 0.5;

marker.pose.position.x = position.x();
Expand Down

0 comments on commit ee3d588

Please sign in to comment.