22 #include <ISM/utility/GeometryHelper.hpp> 39 for (std::map<ISM::ObjectPtr, std::vector<ISM::VoteSpecifierPtr>>::const_iterator obj_to_votes_it = object_to_votes.begin(); obj_to_votes_it != object_to_votes.end(); ++obj_to_votes_it)
42 std::string name_space =
prefix_ + obj_to_votes_it->first->type +
"_" + obj_to_votes_it->first->observedId;
43 double hue_step = 360 / object_to_votes.size();
44 double hue_value = hue_step * i++;
47 for (
const ISM::VoteSpecifierPtr& vote : obj_to_votes_it->second)
49 ISM::PointPtr dest = ISM::GeometryHelper::applyQuatAndRadiusToPose(obj_to_votes_it->first->pose, vote->objectToRefQuat, vote->radius);
50 marker =
VizHelperRVIZ::createArrowMarkerToPoint(obj_to_votes_it->first->pose->point, dest,
base_frame_, name_space +
"_votes",
id++, 0.0015, 0.003, 0.003,
VizHelperRVIZ::hsvToRGBA(hue_value, 1.0, 1.0), 0, 0.003);
51 return_markers.markers.push_back(marker);
55 return return_markers;
void addVisualization(const std::map< ISM::ObjectPtr, std::vector< ISM::VoteSpecifierPtr >> &object_to_votes)
void publishCollectedMarkers()
static ColorRGBA hsvToRGBA(double hue, double saturation, double value)
visualization_msgs::Marker Marker
visualization_msgs::MarkerArray MarkerArray
static Marker createArrowMarkerToPoint(ISM::PointPtr fromPoint, ISM::PointPtr to, std::string baseFrame, std::string markerNamespace, int id, float xScale, float yScale, float zScale, ColorRGBA color, double markerLifetime)
void addMarker(visualization_msgs::Marker marker)
visualization_msgs::MarkerArray generateVoteMarkers(const std::map< ISM::ObjectPtr, std::vector< ISM::VoteSpecifierPtr >> &object_to_votes)